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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 done | 135 done |
136 echo "};" | 136 echo "};" |
137 echo | 137 echo |
138 | 138 |
139 # Generate algorithm signature length map. | 139 # Generate algorithm signature length map. |
140 echo "const int siglen_map[NUMALGORITHMS] = {" | 140 echo "const int siglen_map[NUMALGORITHMS] = {" |
141 for rsaalgo in ${RSAAlgos[@]} | 141 for rsaalgo in ${RSAAlgos[@]} |
142 do | 142 do |
143 for hashalgo in ${HashAlgos[@]} | 143 for hashalgo in ${HashAlgos[@]} |
144 do | 144 do |
145 echo ${rsaalgo}NUMWORDS, | 145 echo ${rsaalgo}NUMBYTES, |
146 done | 146 done |
147 done | 147 done |
148 echo "};" | 148 echo "};" |
149 echo | 149 echo |
150 | 150 |
151 # Generate algorithm padding array map. | 151 # Generate algorithm padding array map. |
152 echo "const uint8_t* padding_map[NUMALGORITHMS] = {" | 152 echo "const uint8_t* padding_map[NUMALGORITHMS] = {" |
153 for rsaalgo in ${RSAAlgos[@]} | 153 for rsaalgo in ${RSAAlgos[@]} |
154 do | 154 do |
155 for hashalgo in ${HashAlgos[@]} | 155 for hashalgo in ${HashAlgos[@]} |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 do | 215 do |
216 for hashalgo in ${HashAlgos[@]} | 216 for hashalgo in ${HashAlgos[@]} |
217 do | 217 do |
218 echo \"${rsaalgo} ${hashalgo}\", | 218 echo \"${rsaalgo} ${hashalgo}\", |
219 done | 219 done |
220 done | 220 done |
221 echo "};" | 221 echo "};" |
222 echo | 222 echo |
223 | 223 |
224 #echo "#endif /* VBOOT_REFERENCE_PADDING_H_ */" | 224 #echo "#endif /* VBOOT_REFERENCE_PADDING_H_ */" |
OLD | NEW |