On Fri, Sep 25, 2020 at 11:04 AM Jeffrey Walton <[email protected]> wrote:
>
> On Fri, Sep 25, 2020 at 10:25 AM Niels Möller <[email protected]> wrote:
> >
> > Jeffrey Walton <[email protected]> writes:
> > ...
> It should be easy enough to test. Start with a counter of 0xfffffff8
> and encrypt a couple of [64-byte] blocks. You can use Bernstein's
> reference implementation to generate test vectors.[1]

My bad. Start with a counter of 0xfffffff8 and encrypt or decrypt
16*64 bytes. That will get you into the corner case.

> Here's a hacked version of Bernstein's code that allows you to set the
> counter to something other than 0's:
> https://github.com/noloader/cryptopp-test/blob/master/ChaCha20/chacha.c.
> See the XXX_ctr_setup function.

While not obvious, setting the counter is how you seek in the ChaCha
stream. It allows you to encrypt or decrypt an arbitrary block of
64-bytes.

Jeff
_______________________________________________
nettle-bugs mailing list
[email protected]
http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs

Reply via email to