crypto: add FSChaCha20, a rekeying wrapper around ChaCha20
Summary:
This adds the FSChaCha20 stream cipher as specified in BIP324, a
wrapper around the ChaCha20 stream cipher (specified in RFC8439
section 2.4) which automatically rekeys every N messages, and
manages the nonces used for encryption.
Co-authored-by: dhruv <856960+dhruv@users.noreply.github.com>
This is a partial backport of core#28008
https://github.com/bitcoin/bitcoin/pull/28008/commits/0fee267792eb8cbdd48ad78f1712420b5d8d905b
Depends on D19018
Test Plan: ninja all check-all bitcoin-fuzzers
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D19019