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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: nss/lib/freebl/blapi.h
===================================================================
--- nss/lib/freebl/blapi.h (revision 228205)
+++ nss/lib/freebl/blapi.h (working copy)
@@ -818,7 +818,32 @@
unsigned int *outputLen, unsigned int maxOutputLen,
const unsigned char *input, unsigned int inputLen);
+/******************************************/
+/*
+** ChaCha20+Poly1305 AEAD
+*/
+extern ChaCha20Poly1305Context *
+ChaCha20Poly1305_CreateContext(const unsigned char *key, unsigned int keyLen,
+ 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.
+ const unsigned char *ad, unsigned int adLen,
+ unsigned int tagBits);
+
+extern void
+ChaCha20Poly1305_DestroyContext(ChaCha20Poly1305Context *ctx, PRBool freeit);
+
+extern SECStatus
+ChaCha20Poly1305_Seal(const ChaCha20Poly1305Context *ctx,
+ unsigned char *output, unsigned int *outputLen,
+ unsigned int maxOutputLen,
+ 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
+
+extern SECStatus
+ChaCha20Poly1305_Open(const ChaCha20Poly1305Context *ctx,
+ unsigned char *output, unsigned int *outputLen,
+ unsigned int maxOutputLen,
+ const unsigned char *input, unsigned int inputLen);
+
/******************************************/
/*
** MD5 secure hash function

Powered by Google App Engine
This is Rietveld 408576698