HomePhabricator

crypto: add FSChaCha20, a rekeying wrapper around ChaCha20

Description

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

Details

Provenance
Pieter Wuille <pieter@wuille.net>Authored on Jun 28 2023, 22:20
PiRKCommitted on Wed, Dec 3, 12:20
PiRKPushed on Wed, Dec 3, 12:20
Reviewer
Restricted Project
Differential Revision
D19019: crypto: add FSChaCha20, a rekeying wrapper around ChaCha20
Parents
rABCbe0a2db1ebe5: crypto: add the ChaCha20Poly1305 AEAD as specified in RFC8439
Branches
Unknown
Tags
Unknown