Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Side by Side Diff: src/platform/vboot_reference/crypto/padding.c

Issue 1593002: Revert "VBoot Reference: Refactor Part 2 - Crypto Libraries" (Closed)
Patch Set: Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * DO NOT MODIFY THIS FILE DIRECTLY. 2 * DO NOT MODIFY THIS FILE DIRECTLY.
3 * 3 *
4 * This file is automatically generated by genpadding.sh and contains padding 4 * This file is automatically generated by genpadding.sh and contains padding
5 * arrays corresponding to various combinations of algorithms for RSA signatures . 5 * arrays corresponding to various combinations of algorithms for RSA signatures .
6 */ 6 */
7 7
8 #include "cryptolib.h" 8 #include "rsa.h"
9 #include "sha.h"
10
9 11
10 /* 12 /*
11 * PKCS 1.5 padding (from the RSA PKCS#1 v2.1 standard) 13 * PKCS 1.5 padding (from the RSA PKCS#1 v2.1 standard)
12 * 14 *
13 * Depending on the RSA key size and hash function, the padding is calculated 15 * Depending on the RSA key size and hash function, the padding is calculated
14 * as follows: 16 * as follows:
15 * 17 *
16 * 0x00 || 0x01 || PS || 0x00 || T 18 * 0x00 || 0x01 || PS || 0x00 || T
17 * 19 *
18 * T: DER Encoded DigestInfo value which depends on the hash function used. 20 * T: DER Encoded DigestInfo value which depends on the hash function used.
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 RSA2048NUMBYTES - SHA256_DIGEST_SIZE, 163 RSA2048NUMBYTES - SHA256_DIGEST_SIZE,
162 RSA2048NUMBYTES - SHA512_DIGEST_SIZE, 164 RSA2048NUMBYTES - SHA512_DIGEST_SIZE,
163 RSA4096NUMBYTES - SHA1_DIGEST_SIZE, 165 RSA4096NUMBYTES - SHA1_DIGEST_SIZE,
164 RSA4096NUMBYTES - SHA256_DIGEST_SIZE, 166 RSA4096NUMBYTES - SHA256_DIGEST_SIZE,
165 RSA4096NUMBYTES - SHA512_DIGEST_SIZE, 167 RSA4096NUMBYTES - SHA512_DIGEST_SIZE,
166 RSA8192NUMBYTES - SHA1_DIGEST_SIZE, 168 RSA8192NUMBYTES - SHA1_DIGEST_SIZE,
167 RSA8192NUMBYTES - SHA256_DIGEST_SIZE, 169 RSA8192NUMBYTES - SHA256_DIGEST_SIZE,
168 RSA8192NUMBYTES - SHA512_DIGEST_SIZE, 170 RSA8192NUMBYTES - SHA512_DIGEST_SIZE,
169 }; 171 };
170 172
171 const int hash_type_map[] = {
172 SHA1_DIGEST_ALGORITHM,
173 SHA256_DIGEST_ALGORITHM,
174 SHA512_DIGEST_ALGORITHM,
175 SHA1_DIGEST_ALGORITHM,
176 SHA256_DIGEST_ALGORITHM,
177 SHA512_DIGEST_ALGORITHM,
178 SHA1_DIGEST_ALGORITHM,
179 SHA256_DIGEST_ALGORITHM,
180 SHA512_DIGEST_ALGORITHM,
181 SHA1_DIGEST_ALGORITHM,
182 SHA256_DIGEST_ALGORITHM,
183 SHA512_DIGEST_ALGORITHM,
184 };
185
186 const int hash_size_map[NUMALGORITHMS] = { 173 const int hash_size_map[NUMALGORITHMS] = {
187 SHA1_DIGEST_SIZE, 174 SHA1_DIGEST_SIZE,
188 SHA256_DIGEST_SIZE, 175 SHA256_DIGEST_SIZE,
189 SHA512_DIGEST_SIZE, 176 SHA512_DIGEST_SIZE,
190 SHA1_DIGEST_SIZE, 177 SHA1_DIGEST_SIZE,
191 SHA256_DIGEST_SIZE, 178 SHA256_DIGEST_SIZE,
192 SHA512_DIGEST_SIZE, 179 SHA512_DIGEST_SIZE,
193 SHA1_DIGEST_SIZE, 180 SHA1_DIGEST_SIZE,
194 SHA256_DIGEST_SIZE, 181 SHA256_DIGEST_SIZE,
195 SHA512_DIGEST_SIZE, 182 SHA512_DIGEST_SIZE,
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 "RSA2048 SHA1", 222 "RSA2048 SHA1",
236 "RSA2048 SHA256", 223 "RSA2048 SHA256",
237 "RSA2048 SHA512", 224 "RSA2048 SHA512",
238 "RSA4096 SHA1", 225 "RSA4096 SHA1",
239 "RSA4096 SHA256", 226 "RSA4096 SHA256",
240 "RSA4096 SHA512", 227 "RSA4096 SHA512",
241 "RSA8192 SHA1", 228 "RSA8192 SHA1",
242 "RSA8192 SHA256", 229 "RSA8192 SHA256",
243 "RSA8192 SHA512", 230 "RSA8192 SHA512",
244 }; 231 };
232
OLDNEW
« no previous file with comments | « src/platform/vboot_reference/crypto/genpadding.sh ('k') | src/platform/vboot_reference/crypto/rsa.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698