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

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

Issue 1585007: combined patch for: (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 "rsa.h" 8 #include "cryptolib.h"
9 #include "sha.h"
10 9
11 10
12 /* 11 /*
13 * PKCS 1.5 padding (from the RSA PKCS#1 v2.1 standard) 12 * PKCS 1.5 padding (from the RSA PKCS#1 v2.1 standard)
14 * 13 *
15 * Depending on the RSA key size and hash function, the padding is calculated 14 * Depending on the RSA key size and hash function, the padding is calculated
16 * as follows: 15 * as follows:
17 * 16 *
18 * 0x00 || 0x01 || PS || 0x00 || T 17 * 0x00 || 0x01 || PS || 0x00 || T
19 * 18 *
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 RSA2048NUMBYTES - SHA256_DIGEST_SIZE, 162 RSA2048NUMBYTES - SHA256_DIGEST_SIZE,
164 RSA2048NUMBYTES - SHA512_DIGEST_SIZE, 163 RSA2048NUMBYTES - SHA512_DIGEST_SIZE,
165 RSA4096NUMBYTES - SHA1_DIGEST_SIZE, 164 RSA4096NUMBYTES - SHA1_DIGEST_SIZE,
166 RSA4096NUMBYTES - SHA256_DIGEST_SIZE, 165 RSA4096NUMBYTES - SHA256_DIGEST_SIZE,
167 RSA4096NUMBYTES - SHA512_DIGEST_SIZE, 166 RSA4096NUMBYTES - SHA512_DIGEST_SIZE,
168 RSA8192NUMBYTES - SHA1_DIGEST_SIZE, 167 RSA8192NUMBYTES - SHA1_DIGEST_SIZE,
169 RSA8192NUMBYTES - SHA256_DIGEST_SIZE, 168 RSA8192NUMBYTES - SHA256_DIGEST_SIZE,
170 RSA8192NUMBYTES - SHA512_DIGEST_SIZE, 169 RSA8192NUMBYTES - SHA512_DIGEST_SIZE,
171 }; 170 };
172 171
172 const int hash_type_map[] = {
173 SHA1_DIGEST_ALGORITHM,
174 SHA256_DIGEST_ALGORITHM,
175 SHA512_DIGEST_ALGORITHM,
176 SHA1_DIGEST_ALGORITHM,
177 SHA256_DIGEST_ALGORITHM,
178 SHA512_DIGEST_ALGORITHM,
179 SHA1_DIGEST_ALGORITHM,
180 SHA256_DIGEST_ALGORITHM,
181 SHA512_DIGEST_ALGORITHM,
182 SHA1_DIGEST_ALGORITHM,
183 SHA256_DIGEST_ALGORITHM,
184 SHA512_DIGEST_ALGORITHM,
185 };
186
173 const int hash_size_map[NUMALGORITHMS] = { 187 const int hash_size_map[NUMALGORITHMS] = {
174 SHA1_DIGEST_SIZE, 188 SHA1_DIGEST_SIZE,
175 SHA256_DIGEST_SIZE, 189 SHA256_DIGEST_SIZE,
176 SHA512_DIGEST_SIZE, 190 SHA512_DIGEST_SIZE,
177 SHA1_DIGEST_SIZE, 191 SHA1_DIGEST_SIZE,
178 SHA256_DIGEST_SIZE, 192 SHA256_DIGEST_SIZE,
179 SHA512_DIGEST_SIZE, 193 SHA512_DIGEST_SIZE,
180 SHA1_DIGEST_SIZE, 194 SHA1_DIGEST_SIZE,
181 SHA256_DIGEST_SIZE, 195 SHA256_DIGEST_SIZE,
182 SHA512_DIGEST_SIZE, 196 SHA512_DIGEST_SIZE,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 "RSA2048 SHA256", 237 "RSA2048 SHA256",
224 "RSA2048 SHA512", 238 "RSA2048 SHA512",
225 "RSA4096 SHA1", 239 "RSA4096 SHA1",
226 "RSA4096 SHA256", 240 "RSA4096 SHA256",
227 "RSA4096 SHA512", 241 "RSA4096 SHA512",
228 "RSA8192 SHA1", 242 "RSA8192 SHA1",
229 "RSA8192 SHA256", 243 "RSA8192 SHA256",
230 "RSA8192 SHA512", 244 "RSA8192 SHA512",
231 }; 245 };
232 246
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