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

Side by Side Diff: openssl/crypto/chacha/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 unified diff | Download patch
« no previous file with comments | « openssl/crypto/chacha/Makefile ('k') | openssl/crypto/chacha/chacha_enc.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* crypto/srp/srp_lcl.h */ 1 /*
2 /* Written by Peter Sylvester (peter.sylvester@edelweb.fr) 2 * Chacha stream algorithm.
3 * for the EdelKey project and contributed to the OpenSSL project 2004. 3 *
4 * Created on: Jun, 2013
5 * Author: Elie Bursztein (elieb@google.com)
6 *
7 * Adapted from the estream code by D. Bernstein.
4 */ 8 */
5 /* ==================================================================== 9 /* ====================================================================
6 * Copyright (c) 2004 The OpenSSL Project. All rights reserved. 10 * Copyright (c) 2011-2013 The OpenSSL Project. All rights reserved.
7 * 11 *
8 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 13 * modification, are permitted provided that the following conditions
10 * are met: 14 * are met:
11 * 15 *
12 * 1. Redistributions of source code must retain the above copyright 16 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 17 * notice, this list of conditions and the following disclaimer.
14 * 18 *
15 * 2. Redistributions in binary form must reproduce the above copyright 19 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in 20 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the 21 * the documentation and/or other materials provided with the
18 * distribution. 22 * distribution.
19 * 23 *
20 * 3. All advertising materials mentioning features or use of this 24 * 3. All advertising materials mentioning features or use of this
21 * software must display the following acknowledgment: 25 * software must display the following acknowledgment:
22 * "This product includes software developed by the OpenSSL Project 26 * "This product includes software developed by the OpenSSL Project
23 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 27 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
(...skipping 18 matching lines...) Expand all
42 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 46 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 47 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 48 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 49 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 50 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 51 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 52 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 53 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50 * OF THE POSSIBILITY OF SUCH DAMAGE. 54 * OF THE POSSIBILITY OF SUCH DAMAGE.
51 * ==================================================================== 55 * ====================================================================
52 *
53 * This product includes cryptographic software written by Eric Young
54 * (eay@cryptsoft.com). This product includes software written by Tim
55 * Hudson (tjh@cryptsoft.com).
56 *
57 */ 56 */
58 #ifndef HEADER_SRP_LCL_H 57 #ifndef HEADER_CHACHA_H
59 #define HEADER_SRP_LCL_H 58 #define HEADER_CHACHA_H
60 59
61 #include <openssl/srp.h> 60 #include <openssl/opensslconf.h>
62 #include <openssl/sha.h>
63 61
64 #if 0 62 #if defined(OPENSSL_NO_CHACHA)
65 #define srp_bn_print(a) {fprintf(stderr, #a "="); BN_print_fp(stderr,a); \ 63 #error ChaCha support is disabled.
66 fprintf(stderr,"\n");}
67 #else
68 #define srp_bn_print(a)
69 #endif 64 #endif
70 65
71 66 #include <stddef.h>
72 67
73 #ifdef __cplusplus 68 #ifdef __cplusplus
74 extern "C" { 69 extern "C" {
75 #endif 70 #endif
76 71
77 72 /* CRYPTO_chacha_20 encrypts |in_len| bytes from |in| with the given key and
73 * nonce and writes the result to |out|, which may be equal to |in|. The
74 * initial block counter is specified by |counter|. */
75 void CRYPTO_chacha_20(unsigned char *out,
76 » » const unsigned char *in, size_t in_len,
77 » » const unsigned char key[32],
78 » » const unsigned char nonce[8],
79 » » size_t counter);
78 80
79 #ifdef __cplusplus 81 #ifdef __cplusplus
80 } 82 }
81 #endif 83 #endif
82 84
83 #endif 85 #endif
OLDNEW
« no previous file with comments | « openssl/crypto/chacha/Makefile ('k') | openssl/crypto/chacha/chacha_enc.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698