Page MenuHomePhabricator

crypto: add the ChaCha20Poly1305 AEAD as specified in RFC8439
AcceptedPublic

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

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Summary

This adds an implementation of the ChaCha20Poly1305 AEAD exactly matching
the version specified in RFC8439 section 2.8, including tests and official
test vectors.

This is a partial backport of core#28008 and a backport of core#29815
https://github.com/bitcoin/bitcoin/pull/28008/commits/9ff0768bdcca06836ccc673eacfa648e801930cb

Squashing with ccore#29815 bypasses a change from core#29404 (#include <config/bitcoin-config.h>)

Depends on D19017

Test Plan

ninja all check-all

Event Timeline

PiRK requested review of this revision.Tue, Dec 2, 14:47
Fabien requested changes to this revision.Wed, Dec 3, 08:48
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/crypto/chacha20poly1305.cpp
29

What's the point? It won't build if this is defined, and there is no build system check for the availability of this function. Also it's defined in string.h/cstring which is not included

src/crypto/chacha20poly1305.h
12

this should come before the std headers

This revision now requires changes to proceed.Wed, Dec 3, 08:48
src/crypto/chacha20poly1305.cpp
29

I will check if we can squash with https://github.com/bitcoin/bitcoin/pull/29815

This revision is now accepted and ready to land.Wed, Dec 3, 10:08