| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 | 2 |
| 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 # Script to generate padding.c containing PKCS 1.5 padding byte arrays for | 7 # Script to generate padding.c containing PKCS 1.5 padding byte arrays for |
| 8 # various combinations of RSA key lengths and message digest algorithms. | 8 # various combinations of RSA key lengths and message digest algorithms. |
| 9 | 9 |
| 10 Pad_Preamble="0x00,0x01" | 10 Pad_Preamble="0x00,0x01" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 for rsaalgo in ${RSAAlgos[@]} | 165 for rsaalgo in ${RSAAlgos[@]} |
| 166 do | 166 do |
| 167 for hashalgo in ${HashAlgos[@]} | 167 for hashalgo in ${HashAlgos[@]} |
| 168 do | 168 do |
| 169 echo ${rsaalgo}NUMBYTES - ${hashalgo}_DIGEST_SIZE, | 169 echo ${rsaalgo}NUMBYTES - ${hashalgo}_DIGEST_SIZE, |
| 170 done | 170 done |
| 171 done | 171 done |
| 172 echo "};" | 172 echo "};" |
| 173 echo | 173 echo |
| 174 | 174 |
| 175 # Generate signature algorithm to messge digest algorithm map. | |
| 176 echo "const int hash_type_map[] = {" | |
| 177 for rsaalgo in ${RSAAlgos[@]} | |
| 178 do | |
| 179 for hashalgo in ${HashAlgos[@]} | |
| 180 do | |
| 181 echo ${hashalgo}_DIGEST_ALGORITHM, | |
| 182 done | |
| 183 done | |
| 184 echo "};" | |
| 185 echo | |
| 186 | |
| 187 # Generate algorithm to message digest's output size map. | 175 # Generate algorithm to message digest's output size map. |
| 188 echo "const int hash_size_map[NUMALGORITHMS] = {" | 176 echo "const int hash_size_map[NUMALGORITHMS] = {" |
| 189 for rsaalgo in ${RSAAlgos[@]} | 177 for rsaalgo in ${RSAAlgos[@]} |
| 190 do | 178 do |
| 191 for hashalgo in ${HashAlgos[@]} | 179 for hashalgo in ${HashAlgos[@]} |
| 192 do | 180 do |
| 193 echo ${hashalgo}_DIGEST_SIZE, | 181 echo ${hashalgo}_DIGEST_SIZE, |
| 194 done | 182 done |
| 195 done | 183 done |
| 196 echo "};" | 184 echo "};" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 227 do | 215 do |
| 228 for hashalgo in ${HashAlgos[@]} | 216 for hashalgo in ${HashAlgos[@]} |
| 229 do | 217 do |
| 230 echo \"${rsaalgo} ${hashalgo}\", | 218 echo \"${rsaalgo} ${hashalgo}\", |
| 231 done | 219 done |
| 232 done | 220 done |
| 233 echo "};" | 221 echo "};" |
| 234 echo | 222 echo |
| 235 | 223 |
| 236 #echo "#endif /* VBOOT_REFERENCE_PADDING_H_ */" | 224 #echo "#endif /* VBOOT_REFERENCE_PADDING_H_ */" |
| OLD | NEW |