elements/src/crypto
Pieter Wuille 511a8d406e crypto: Implement RFC8439-compatible variant of ChaCha20
There are two variants of ChaCha20 in use. The original one uses a 64-bit
nonce and a 64-bit block counter, while the one used in RFC8439 uses a
96-bit nonce and 32-bit block counter. This commit changes the interface
to use the 96/32 split (but automatically incrementing the first 32-bit
part of the nonce when the 32-bit block counter overflows, so to retain
compatibility with >256 GiB output).

Simultaneously, also merge the SetIV and Seek64 functions, as we almost
always call both anyway.

Co-authored-by: dhruv <856960+dhruv@users.noreply.github.com>
2023-07-07 17:16:27 -04:00
..
ctaes Update ctaes 2016-12-08 17:09:07 -08:00
aes.cpp scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
aes.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
chacha20.cpp crypto: Implement RFC8439-compatible variant of ChaCha20 2023-07-07 17:16:27 -04:00
chacha20.h crypto: Implement RFC8439-compatible variant of ChaCha20 2023-07-07 17:16:27 -04:00
chacha_poly_aead.cpp crypto: Implement RFC8439-compatible variant of ChaCha20 2023-07-07 17:16:27 -04:00
chacha_poly_aead.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
common.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
hkdf_sha256_32.cpp scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
hkdf_sha256_32.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
hmac_sha256.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
hmac_sha256.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
hmac_sha512.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
hmac_sha512.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
muhash.cpp Only support 32-byte keys in ChaCha20{,Aligned} 2023-01-30 18:12:21 -05:00
muhash.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
poly1305.cpp Add Poly1305 implementation 2019-03-26 18:12:29 +01:00
poly1305.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
ripemd160.cpp clang-tidy: Fix modernize-use-default-member-init in headers 2023-01-31 11:50:10 +00:00
ripemd160.h clang-tidy: Fix modernize-use-default-member-init in headers 2023-01-31 11:50:10 +00:00
sha1.cpp clang-tidy: Fix modernize-use-default-member-init in headers 2023-01-31 11:50:10 +00:00
sha1.h clang-tidy: Fix modernize-use-default-member-init in headers 2023-01-31 11:50:10 +00:00
sha3.cpp Unroll Keccak-f implementation 2020-09-06 18:35:23 -07:00
sha3.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
sha256.cpp clang-tidy: Fix modernize-use-default-member-init in headers 2023-01-31 11:50:10 +00:00
sha256.h clang-tidy: Fix modernize-use-default-member-init in headers 2023-01-31 11:50:10 +00:00
sha256_arm_shani.cpp doc: Fix typos 2022-02-17 03:42:08 +09:00
sha256_avx2.cpp scripted-diff: Use platform-agnostic ALWAYS_INLINE macro 2023-05-04 20:58:01 +01:00
sha256_sse4.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
sha256_sse41.cpp scripted-diff: Use platform-agnostic ALWAYS_INLINE macro 2023-05-04 20:58:01 +01:00
sha256_x86_shani.cpp scripted-diff: Use platform-agnostic ALWAYS_INLINE macro 2023-05-04 20:58:01 +01:00
sha512.cpp clang-tidy: Fix modernize-use-default-member-init in headers 2023-01-31 11:50:10 +00:00
sha512.h clang-tidy: Fix modernize-use-default-member-init in headers 2023-01-31 11:50:10 +00:00
siphash.cpp refactor: use braced init for integer constants instead of c style casts 2023-01-03 19:31:29 -06:00
siphash.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00