Index: openssl/crypto/chacha/chacha.h |
diff --git a/openssl/crypto/srp/srp_lcl.h b/openssl/crypto/chacha/chacha.h |
similarity index 75% |
copy from openssl/crypto/srp/srp_lcl.h |
copy to openssl/crypto/chacha/chacha.h |
index 42bda3f148f396f70aa7bef56973b336add884c8..d56519d4532ab47ed72b146e063ba32ebaadfa9d 100644 |
--- a/openssl/crypto/srp/srp_lcl.h |
+++ b/openssl/crypto/chacha/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 |
} |