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

Side by Side Diff: nss/mozilla/security/nss/lib/util/pkcs11t.h

Issue 10919163: Add GCM, CTR, and CTS modes to AES. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/
Patch Set: Fix comments as rsleevi suggested, fix a 32-bit bug and miscellaneous issues Created 8 years, 3 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 | Annotate | Revision Log
OLDNEW
1 /* ***** BEGIN LICENSE BLOCK ***** 1 /* ***** BEGIN LICENSE BLOCK *****
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
3 * 3 *
4 * The contents of this file are subject to the Mozilla Public License Version 4 * The contents of this file are subject to the Mozilla Public License Version
5 * 1.1 (the "License"); you may not use this file except in compliance with 5 * 1.1 (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at 6 * the License. You may obtain a copy of the License at
7 * http://www.mozilla.org/MPL/ 7 * http://www.mozilla.org/MPL/
8 * 8 *
9 * Software distributed under the License is distributed on an "AS IS" basis, 9 * Software distributed under the License is distributed on an "AS IS" basis,
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 /* CKM_AES_KEY_GEN, CKM_AES_ECB, CKM_AES_CBC, CKM_AES_MAC, 911 /* CKM_AES_KEY_GEN, CKM_AES_ECB, CKM_AES_CBC, CKM_AES_MAC,
912 * CKM_AES_MAC_GENERAL, CKM_AES_CBC_PAD, CKM_DSA_PARAMETER_GEN, 912 * CKM_AES_MAC_GENERAL, CKM_AES_CBC_PAD, CKM_DSA_PARAMETER_GEN,
913 * CKM_DH_PKCS_PARAMETER_GEN, and CKM_X9_42_DH_PARAMETER_GEN are 913 * CKM_DH_PKCS_PARAMETER_GEN, and CKM_X9_42_DH_PARAMETER_GEN are
914 * new for v2.11 */ 914 * new for v2.11 */
915 #define CKM_AES_KEY_GEN 0x00001080 915 #define CKM_AES_KEY_GEN 0x00001080
916 #define CKM_AES_ECB 0x00001081 916 #define CKM_AES_ECB 0x00001081
917 #define CKM_AES_CBC 0x00001082 917 #define CKM_AES_CBC 0x00001082
918 #define CKM_AES_MAC 0x00001083 918 #define CKM_AES_MAC 0x00001083
919 #define CKM_AES_MAC_GENERAL 0x00001084 919 #define CKM_AES_MAC_GENERAL 0x00001084
920 #define CKM_AES_CBC_PAD 0x00001085 920 #define CKM_AES_CBC_PAD 0x00001085
921 /* new for v2.20 amendment 3 */
922 #define CKM_AES_CTR 0x00001086
923 /* new for v2.30 */
924 #define CKM_AES_GCM 0x00001087
925 #define CKM_AES_CCM 0x00001088
926 #define CKM_AES_CTS 0x00001089
921 927
922 /* BlowFish and TwoFish are new for v2.20 */ 928 /* BlowFish and TwoFish are new for v2.20 */
923 #define CKM_BLOWFISH_KEY_GEN 0x00001090 929 #define CKM_BLOWFISH_KEY_GEN 0x00001090
924 #define CKM_BLOWFISH_CBC 0x00001091 930 #define CKM_BLOWFISH_CBC 0x00001091
925 #define CKM_TWOFISH_KEY_GEN 0x00001092 931 #define CKM_TWOFISH_KEY_GEN 0x00001092
926 #define CKM_TWOFISH_CBC 0x00001093 932 #define CKM_TWOFISH_CBC 0x00001093
927 933
928 /* Camellia is proposed for v2.20 Amendment 3 */ 934 /* Camellia is proposed for v2.20 Amendment 3 */
929 #define CKM_CAMELLIA_KEY_GEN 0x00000550 935 #define CKM_CAMELLIA_KEY_GEN 0x00000550
930 #define CKM_CAMELLIA_ECB 0x00000551 936 #define CKM_CAMELLIA_ECB 0x00000551
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
1511 typedef CK_DES_CBC_ENCRYPT_DATA_PARAMS CK_PTR CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR ; 1517 typedef CK_DES_CBC_ENCRYPT_DATA_PARAMS CK_PTR CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR ;
1512 1518
1513 typedef struct CK_AES_CBC_ENCRYPT_DATA_PARAMS { 1519 typedef struct CK_AES_CBC_ENCRYPT_DATA_PARAMS {
1514 CK_BYTE iv[16]; 1520 CK_BYTE iv[16];
1515 CK_BYTE_PTR pData; 1521 CK_BYTE_PTR pData;
1516 CK_ULONG length; 1522 CK_ULONG length;
1517 } CK_AES_CBC_ENCRYPT_DATA_PARAMS; 1523 } CK_AES_CBC_ENCRYPT_DATA_PARAMS;
1518 1524
1519 typedef CK_AES_CBC_ENCRYPT_DATA_PARAMS CK_PTR CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR ; 1525 typedef CK_AES_CBC_ENCRYPT_DATA_PARAMS CK_PTR CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR ;
1520 1526
1527 typedef struct CK_AES_CTR_PARAMS {
1528 CK_ULONG ulCounterBits;
1529 CK_BYTE cb[16];
1530 } CK_AES_CTR_PARAMS;
1531
1532 typedef CK_AES_CTR_PARAMS CK_PTR CK_AES_CTR_PARAMS_PTR;
1533
1534 typedef struct CK_AES_GCM_PARAMS {
1535 CK_BYTE_PTR pIv;
1536 CK_ULONG ulIvLen;
1537 CK_BYTE_PTR pAAD;
1538 CK_ULONG ulAADLen;
1539 CK_ULONG ulTagBits;
1540 } CK_AES_GCM_PARAMS;
1541
1542 typedef CK_AES_GCM_PARAMS CK_PTR CK_AES_GCM_PARAMS_PTR;
1543
1544 typedef struct CK_AES_CCM_PARAMS {
1545 CK_ULONG ulDataLen;
1546 CK_BYTE_PTR pNonce;
1547 CK_ULONG ulNonceLen;
1548 CK_BYTE_PTR pAAD;
1549 CK_ULONG ulAADLen;
1550 CK_ULONG ulMACLen;
1551 } CK_AES_CCM_PARAMS;
1552
1553 typedef CK_AES_CCM_PARAMS CK_PTR CK_AES_CCM_PARAMS_PTR;
1554
1521 /* CK_SKIPJACK_PRIVATE_WRAP_PARAMS provides the parameters to the 1555 /* CK_SKIPJACK_PRIVATE_WRAP_PARAMS provides the parameters to the
1522 * CKM_SKIPJACK_PRIVATE_WRAP mechanism */ 1556 * CKM_SKIPJACK_PRIVATE_WRAP mechanism */
1523 /* CK_SKIPJACK_PRIVATE_WRAP_PARAMS is new for v2.0 */ 1557 /* CK_SKIPJACK_PRIVATE_WRAP_PARAMS is new for v2.0 */
1524 typedef struct CK_SKIPJACK_PRIVATE_WRAP_PARAMS { 1558 typedef struct CK_SKIPJACK_PRIVATE_WRAP_PARAMS {
1525 CK_ULONG ulPasswordLen; 1559 CK_ULONG ulPasswordLen;
1526 CK_BYTE_PTR pPassword; 1560 CK_BYTE_PTR pPassword;
1527 CK_ULONG ulPublicDataLen; 1561 CK_ULONG ulPublicDataLen;
1528 CK_BYTE_PTR pPublicData; 1562 CK_BYTE_PTR pPublicData;
1529 CK_ULONG ulPAndGLen; 1563 CK_ULONG ulPAndGLen;
1530 CK_ULONG ulQLen; 1564 CK_ULONG ulQLen;
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
1776 /* stuff that for historic reasons is in this header file but should have 1810 /* stuff that for historic reasons is in this header file but should have
1777 * been in pkcs11n.h */ 1811 * been in pkcs11n.h */
1778 #define CKK_INVALID_KEY_TYPE 0xffffffff 1812 #define CKK_INVALID_KEY_TYPE 0xffffffff
1779 1813
1780 #include "pkcs11n.h" 1814 #include "pkcs11n.h"
1781 1815
1782 /* undo packing */ 1816 /* undo packing */
1783 #include "pkcs11u.h" 1817 #include "pkcs11u.h"
1784 1818
1785 #endif 1819 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698