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

Side by Side Diff: nss/lib/pk11wrap/pk11mech.c

Issue 27510015: Support ChaCha20+Poly1305 cipher suites. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Fold long lines Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 /* This Source Code Form is subject to the terms of the Mozilla Public 1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 /* 4 /*
5 * This file maps various PKCS #11 Mechanisms to related mechanisms, key 5 * This file maps various PKCS #11 Mechanisms to related mechanisms, key
6 * types, and ASN.1 encodings. 6 * types, and ASN.1 encodings.
7 */ 7 */
8 #include "seccomon.h" 8 #include "seccomon.h"
9 #include "secmod.h" 9 #include "secmod.h"
10 #include "secmodi.h" 10 #include "secmodi.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 * Get the mechanism needed for the given key type 145 * Get the mechanism needed for the given key type
146 */ 146 */
147 CK_MECHANISM_TYPE 147 CK_MECHANISM_TYPE
148 PK11_GetKeyMechanism(CK_KEY_TYPE type) 148 PK11_GetKeyMechanism(CK_KEY_TYPE type)
149 { 149 {
150 switch (type) { 150 switch (type) {
151 case CKK_SEED: 151 case CKK_SEED:
152 return CKM_SEED_CBC; 152 return CKM_SEED_CBC;
153 case CKK_CAMELLIA: 153 case CKK_CAMELLIA:
154 return CKM_CAMELLIA_CBC; 154 return CKM_CAMELLIA_CBC;
155 case CKK_NSS_CHACHA20:
156 return CKM_NSS_CHACHA20_POLY1305;
155 case CKK_AES: 157 case CKK_AES:
156 return CKM_AES_CBC; 158 return CKM_AES_CBC;
157 case CKK_DES: 159 case CKK_DES:
158 return CKM_DES_CBC; 160 return CKM_DES_CBC;
159 case CKK_DES3: 161 case CKK_DES3:
160 return CKM_DES3_KEY_GEN; 162 return CKM_DES3_KEY_GEN;
161 case CKK_DES2: 163 case CKK_DES2:
162 return CKM_DES2_KEY_GEN; 164 return CKM_DES2_KEY_GEN;
163 case CKK_CDMF: 165 case CKK_CDMF:
164 return CKM_CDMF_CBC; 166 return CKM_CDMF_CBC;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 case CKM_SEED_CBC_PAD: 214 case CKM_SEED_CBC_PAD:
213 case CKM_SEED_KEY_GEN: 215 case CKM_SEED_KEY_GEN:
214 return CKK_SEED; 216 return CKK_SEED;
215 case CKM_CAMELLIA_ECB: 217 case CKM_CAMELLIA_ECB:
216 case CKM_CAMELLIA_CBC: 218 case CKM_CAMELLIA_CBC:
217 case CKM_CAMELLIA_MAC: 219 case CKM_CAMELLIA_MAC:
218 case CKM_CAMELLIA_MAC_GENERAL: 220 case CKM_CAMELLIA_MAC_GENERAL:
219 case CKM_CAMELLIA_CBC_PAD: 221 case CKM_CAMELLIA_CBC_PAD:
220 case CKM_CAMELLIA_KEY_GEN: 222 case CKM_CAMELLIA_KEY_GEN:
221 return CKK_CAMELLIA; 223 return CKK_CAMELLIA;
224 case CKM_NSS_CHACHA20_POLY1305:
225 return CKK_NSS_CHACHA20;
222 case CKM_AES_ECB: 226 case CKM_AES_ECB:
223 case CKM_AES_CBC: 227 case CKM_AES_CBC:
224 case CKM_AES_CCM: 228 case CKM_AES_CCM:
225 case CKM_AES_CTR: 229 case CKM_AES_CTR:
226 case CKM_AES_CTS: 230 case CKM_AES_CTS:
227 case CKM_AES_GCM: 231 case CKM_AES_GCM:
228 case CKM_AES_MAC: 232 case CKM_AES_MAC:
229 case CKM_AES_MAC_GENERAL: 233 case CKM_AES_MAC_GENERAL:
230 case CKM_AES_CBC_PAD: 234 case CKM_AES_CBC_PAD:
231 case CKM_AES_KEY_GEN: 235 case CKM_AES_KEY_GEN:
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 case CKM_SEED_CBC_PAD: 426 case CKM_SEED_CBC_PAD:
423 case CKM_SEED_KEY_GEN: 427 case CKM_SEED_KEY_GEN:
424 return CKM_SEED_KEY_GEN; 428 return CKM_SEED_KEY_GEN;
425 case CKM_CAMELLIA_ECB: 429 case CKM_CAMELLIA_ECB:
426 case CKM_CAMELLIA_CBC: 430 case CKM_CAMELLIA_CBC:
427 case CKM_CAMELLIA_MAC: 431 case CKM_CAMELLIA_MAC:
428 case CKM_CAMELLIA_MAC_GENERAL: 432 case CKM_CAMELLIA_MAC_GENERAL:
429 case CKM_CAMELLIA_CBC_PAD: 433 case CKM_CAMELLIA_CBC_PAD:
430 case CKM_CAMELLIA_KEY_GEN: 434 case CKM_CAMELLIA_KEY_GEN:
431 return CKM_CAMELLIA_KEY_GEN; 435 return CKM_CAMELLIA_KEY_GEN;
436 case CKM_NSS_CHACHA20_POLY1305:
437 return CKM_NSS_CHACHA20_KEY_GEN;
432 case CKM_AES_ECB: 438 case CKM_AES_ECB:
433 case CKM_AES_CBC: 439 case CKM_AES_CBC:
434 case CKM_AES_CCM: 440 case CKM_AES_CCM:
435 case CKM_AES_CTR: 441 case CKM_AES_CTR:
436 case CKM_AES_CTS: 442 case CKM_AES_CTS:
437 case CKM_AES_GCM: 443 case CKM_AES_GCM:
438 case CKM_AES_MAC: 444 case CKM_AES_MAC:
439 case CKM_AES_MAC_GENERAL: 445 case CKM_AES_MAC_GENERAL:
440 case CKM_AES_CBC_PAD: 446 case CKM_AES_CBC_PAD:
441 case CKM_AES_KEY_GEN: 447 case CKM_AES_KEY_GEN:
(...skipping 1435 matching lines...) Expand 10 before | Expand all | Expand 10 after
1877 case SEC_OID_MISSI_DSS: 1883 case SEC_OID_MISSI_DSS:
1878 case SEC_OID_MISSI_DSS_OLD: 1884 case SEC_OID_MISSI_DSS_OLD:
1879 case SEC_OID_MISSI_KEA_DSS_OLD: 1885 case SEC_OID_MISSI_KEA_DSS_OLD:
1880 case SEC_OID_BOGUS_DSA_SIGNATURE_WITH_SHA1_DIGEST: 1886 case SEC_OID_BOGUS_DSA_SIGNATURE_WITH_SHA1_DIGEST:
1881 return SEC_OID_ANSIX9_DSA_SIGNATURE; 1887 return SEC_OID_ANSIX9_DSA_SIGNATURE;
1882 default: 1888 default:
1883 break; 1889 break;
1884 } 1890 }
1885 return algTag; 1891 return algTag;
1886 } 1892 }
OLDNEW
« no previous file with comments | « nss/lib/freebl/poly1305/poly1305-donna-x64-sse2-incremental-source.c ('k') | nss/lib/softoken/pkcs11.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698