#!/bin/bash # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Script to generate padding.c containing PKCS 1.5 padding byte arrays for # various combinations of RSA key lengths and message digest algorithms. Pad_Preamble="0x00,0x01" SHA1_digestinfo="0x30,0x21,0x30,0x09,0x06,0x05,0x2b,0x0e,0x03,0x02,0x1a,0x05"\ ",0x00,0x04,0x14" SHA256_digestinfo="0x30,0x31,0x30,0x0d,0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03"\ ",0x04,0x02,0x01,0x05,0x00,0x04,0x20" SHA512_digestinfo="0x30,0x51,0x30,0x0d,0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03"\ ",0x04,0x02,0x03,0x05,0x00,0x04,0x40" RSA1024_Len=128 RSA2048_Len=256 RSA4096_Len=512 RSA8192_Len=1024 SHA1_T_Len=35 SHA256_T_Len=51 SHA512_T_Len=83 HashAlgos=( SHA1 SHA256 SHA512 ) RSAAlgos=( RSA1024 RSA2048 RSA4096 RSA8192 ) function genFFOctets { count=$1 while [ $count -gt 0 ]; do echo -n "0xff," let count=count-1 done } cat <