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

Unified Diff: openssl/include/openssl/chacha.h

Issue 59083010: third_party/openssl: add ChaCha20+Poly1305 support. Base URL: https://chromium.googlesource.com/chromium/deps/openssl.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « openssl/crypto/poly1305/poly1305test.c ('k') | openssl/include/openssl/crypto.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: openssl/include/openssl/chacha.h
diff --git a/openssl/crypto/srp/srp_lcl.h b/openssl/include/openssl/chacha.h
similarity index 75%
copy from openssl/crypto/srp/srp_lcl.h
copy to openssl/include/openssl/chacha.h
index 42bda3f148f396f70aa7bef56973b336add884c8..d56519d4532ab47ed72b146e063ba32ebaadfa9d 100644
--- a/openssl/crypto/srp/srp_lcl.h
+++ b/openssl/include/openssl/chacha.h
@@ -1,16 +1,20 @@
-/* crypto/srp/srp_lcl.h */
-/* Written by Peter Sylvester (peter.sylvester@edelweb.fr)
- * for the EdelKey project and contributed to the OpenSSL project 2004.
+/*
+ * Chacha stream algorithm.
+ *
+ * Created on: Jun, 2013
+ * Author: Elie Bursztein (elieb@google.com)
+ *
+ * Adapted from the estream code by D. Bernstein.
*/
/* ====================================================================
- * Copyright (c) 2004 The OpenSSL Project. All rights reserved.
+ * Copyright (c) 2011-2013 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -49,32 +53,30 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
- *
- * This product includes cryptographic software written by Eric Young
- * (eay@cryptsoft.com). This product includes software written by Tim
- * Hudson (tjh@cryptsoft.com).
- *
*/
-#ifndef HEADER_SRP_LCL_H
-#define HEADER_SRP_LCL_H
+#ifndef HEADER_CHACHA_H
+#define HEADER_CHACHA_H
-#include <openssl/srp.h>
-#include <openssl/sha.h>
+#include <openssl/opensslconf.h>
-#if 0
-#define srp_bn_print(a) {fprintf(stderr, #a "="); BN_print_fp(stderr,a); \
- fprintf(stderr,"\n");}
-#else
-#define srp_bn_print(a)
+#if defined(OPENSSL_NO_CHACHA)
+#error ChaCha support is disabled.
#endif
-
+#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
-
+/* CRYPTO_chacha_20 encrypts |in_len| bytes from |in| with the given key and
+ * nonce and writes the result to |out|, which may be equal to |in|. The
+ * initial block counter is specified by |counter|. */
+void CRYPTO_chacha_20(unsigned char *out,
+ const unsigned char *in, size_t in_len,
+ const unsigned char key[32],
+ const unsigned char nonce[8],
+ size_t counter);
#ifdef __cplusplus
}
« no previous file with comments | « openssl/crypto/poly1305/poly1305test.c ('k') | openssl/include/openssl/crypto.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698