diff options
| author | bcook <> | 2015-12-09 14:07:55 +0000 |
|---|---|---|
| committer | bcook <> | 2015-12-09 14:07:55 +0000 |
| commit | 9c3c66be91c8f6aee01b5b594cb0340b86a35bfb (patch) | |
| tree | 1fd23b20d3830264a735dfa139cc354f0d92098e /src/lib/libcrypto/chacha/chacha.h | |
| parent | 26ccd614b42fd7f690774eaed50c06d0e092e82f (diff) | |
| download | openbsd-9c3c66be91c8f6aee01b5b594cb0340b86a35bfb.tar.gz openbsd-9c3c66be91c8f6aee01b5b594cb0340b86a35bfb.tar.bz2 openbsd-9c3c66be91c8f6aee01b5b594cb0340b86a35bfb.zip | |
Change the counter argument for CRYPTO_chacha_20 to be 64-bits on all platforms.
The recently-added EVP_aead_chacha20_poly1305_ietf() function, which implements
informational RFC 7539, "ChaCha20 and Poly1305 for IETF Protocols", needs a
64-bit counter to avoid truncation on 32-bit platforms.
The existing TLS ChaCha20-Poly1305 ciphersuite is not impacted by this, but
making this change requires an ABI bump.
ok jsing@, "Looks sane" beck@
Diffstat (limited to 'src/lib/libcrypto/chacha/chacha.h')
| -rw-r--r-- | src/lib/libcrypto/chacha/chacha.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/libcrypto/chacha/chacha.h b/src/lib/libcrypto/chacha/chacha.h index 8af5ef856f..8d94e626f8 100644 --- a/src/lib/libcrypto/chacha/chacha.h +++ b/src/lib/libcrypto/chacha/chacha.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: chacha.h,v 1.6 2014/07/25 14:04:51 jsing Exp $ */ | 1 | /* $OpenBSD: chacha.h,v 1.7 2015/12/09 14:07:55 bcook Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
| 4 | * | 4 | * |
| @@ -25,6 +25,7 @@ | |||
| 25 | #endif | 25 | #endif |
| 26 | 26 | ||
| 27 | #include <stddef.h> | 27 | #include <stddef.h> |
| 28 | #include <stdint.h> | ||
| 28 | 29 | ||
| 29 | #ifdef __cplusplus | 30 | #ifdef __cplusplus |
| 30 | extern "C" { | 31 | extern "C" { |
| @@ -44,7 +45,7 @@ void ChaCha(ChaCha_ctx *ctx, unsigned char *out, const unsigned char *in, | |||
| 44 | size_t len); | 45 | size_t len); |
| 45 | 46 | ||
| 46 | void CRYPTO_chacha_20(unsigned char *out, const unsigned char *in, size_t len, | 47 | void CRYPTO_chacha_20(unsigned char *out, const unsigned char *in, size_t len, |
| 47 | const unsigned char key[32], const unsigned char iv[8], size_t counter); | 48 | const unsigned char key[32], const unsigned char iv[8], uint64_t counter); |
| 48 | 49 | ||
| 49 | #ifdef __cplusplus | 50 | #ifdef __cplusplus |
| 50 | } | 51 | } |
