Page MenuHomePhabricator

crypto: refactor ChaCha20 classes to use Span<std::byte> interface
ClosedPublic

Authored by PiRK on Wed, Dec 3, 14:13.

Event Timeline

PiRK requested review of this revision.Wed, Dec 3, 14:13
Fabien requested changes to this revision.Thu, Dec 4, 08:31
Fabien added a subscriber: Fabien.

More a question than requesting change

src/crypto/chacha20.cpp
47 ↗(On Diff #56842)

see related question in the header

src/crypto/chacha20.h
100 ↗(On Diff #56842)

Here and below

101 ↗(On Diff #56842)

I wonder if the size be enforced at compile time like so

src/crypto/chacha20poly1305.cpp
20 ↗(On Diff #56842)

same here

This revision now requires changes to proceed.Thu, Dec 4, 08:31
PiRK requested review of this revision.Thu, Dec 4, 10:05

We can probably do that after we switch from Span to std::span. The Span template does not have the Extent parameter

add a TODO comment regarding compile time enforcement of KEYLEN

add another comment about the same in SetKey

Fabien requested changes to this revision.Thu, Dec 4, 11:47
Fabien added inline comments.
src/crypto/chacha20.cpp
48

This comment should be before the assert

src/crypto/chacha20.h
100
106
This revision now requires changes to proceed.Thu, Dec 4, 11:47

fix 3 comments as suggested

This revision is now accepted and ready to land.Thu, Dec 4, 14:18