Page MenuHomePhabricator

crypto: add FSChaCha20, a rekeying wrapper around ChaCha20
Needs ReviewPublic

Authored by PiRK on Tue, Dec 2, 14:48.

Details

Reviewers
None
Group Reviewers
Restricted Project
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