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

Side by Side Diff: nss/lib/freebl/blapi.h

Issue 27510015: Support ChaCha20+Poly1305 cipher suites. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Make ChaCha20Poly1305 function conform to freebl API, undo changes to chacha20.c, use generic code … Created 7 years, 2 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 /* 1 /*
2 * crypto.h - public data structures and prototypes for the crypto library 2 * crypto.h - public data structures and prototypes for the crypto library
3 * 3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public 4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 7
8 #ifndef _BLAPI_H_ 8 #ifndef _BLAPI_H_
9 #define _BLAPI_H_ 9 #define _BLAPI_H_
10 10
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 ** "maxOutputLen" the maximum amount of data that can ever be 811 ** "maxOutputLen" the maximum amount of data that can ever be
812 ** stored in "output" 812 ** stored in "output"
813 ** "input" the input data 813 ** "input" the input data
814 ** "inputLen" the amount of input data 814 ** "inputLen" the amount of input data
815 */ 815 */
816 extern SECStatus 816 extern SECStatus
817 Camellia_Decrypt(CamelliaContext *cx, unsigned char *output, 817 Camellia_Decrypt(CamelliaContext *cx, unsigned char *output,
818 unsigned int *outputLen, unsigned int maxOutputLen, 818 unsigned int *outputLen, unsigned int maxOutputLen,
819 const unsigned char *input, unsigned int inputLen); 819 const unsigned char *input, unsigned int inputLen);
820 820
821 /******************************************/
822 /*
823 ** ChaCha20+Poly1305 AEAD
824 */
825
826 extern ChaCha20Poly1305Context *
827 ChaCha20Poly1305_CreateContext(const unsigned char *key, unsigned int keyLen,
828 const unsigned char *nonce, unsigned int nonceLen ,
wtc 2013/10/19 01:09:42 Do you think this function should assume |key| and
agl 2013/10/21 21:53:39 I'm ok with that if you are. (There are tweaks to
wtc 2013/10/22 22:36:42 I decided to leave the length arguments there.
829 const unsigned char *ad, unsigned int adLen,
830 unsigned int tagBits);
831
832 extern void
833 ChaCha20Poly1305_DestroyContext(ChaCha20Poly1305Context *ctx, PRBool freeit);
834
835 extern SECStatus
836 ChaCha20Poly1305_Seal(const ChaCha20Poly1305Context *ctx,
837 unsigned char *output, unsigned int *outputLen,
838 unsigned int maxOutputLen,
839 const unsigned char *input, unsigned int inputLen);
wtc 2013/10/19 19:51:02 I will go back to your original design and let the
wtc 2013/10/20 23:21:28 I just realized this won't work because Poly1305 k
840
841 extern SECStatus
842 ChaCha20Poly1305_Open(const ChaCha20Poly1305Context *ctx,
843 unsigned char *output, unsigned int *outputLen,
844 unsigned int maxOutputLen,
845 const unsigned char *input, unsigned int inputLen);
821 846
822 /******************************************/ 847 /******************************************/
823 /* 848 /*
824 ** MD5 secure hash function 849 ** MD5 secure hash function
825 */ 850 */
826 851
827 /* 852 /*
828 ** Hash a null terminated string "src" into "dest" using MD5 853 ** Hash a null terminated string "src" into "dest" using MD5
829 */ 854 */
830 extern SECStatus MD5_Hash(unsigned char *dest, const char *src); 855 extern SECStatus MD5_Hash(unsigned char *dest, const char *src);
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
1404 PRBool BLAPI_VerifySelf(const char *name); 1429 PRBool BLAPI_VerifySelf(const char *name);
1405 1430
1406 /*********************************************************************/ 1431 /*********************************************************************/
1407 extern const SECHashObject * HASH_GetRawHashObject(HASH_HashType hashType); 1432 extern const SECHashObject * HASH_GetRawHashObject(HASH_HashType hashType);
1408 1433
1409 extern void BL_SetForkState(PRBool forked); 1434 extern void BL_SetForkState(PRBool forked);
1410 1435
1411 SEC_END_PROTOS 1436 SEC_END_PROTOS
1412 1437
1413 #endif /* _BLAPI_H_ */ 1438 #endif /* _BLAPI_H_ */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698