ср, 10 окт. 2018 г. в 20:29, Niels Möller <[email protected]>: > > Dmitry Eremin-Solenikov <[email protected]> writes: > > > If src == dst, ctr16 code will fail to increment src and dst pointers, > > always overwriting first block. > > > > Signed-off-by: Dmitry Eremin-Solenikov <[email protected]> > > --- > > ctr16.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/ctr16.c b/ctr16.c > > index 60418e8b9032..7e1c23d20832 100644 > > --- a/ctr16.c > > +++ b/ctr16.c > > @@ -91,7 +91,7 @@ _ctr_crypt16(const void *ctx, nettle_cipher_func *f, > > f(ctx, CTR_BUFFER_LIMIT, buffer->b, buffer->b); > > if (length - i < CTR_BUFFER_LIMIT) > > goto done; > > - memxor3 (dst, src, buffer->b, CTR_BUFFER_LIMIT); > > + memxor3 (dst + i, src + i, buffer->b, CTR_BUFFER_LIMIT); > > } > > > > if (blocks > 0) > > Applied, thanks!
Thank you! > If I understand this correctly, bug is triggered only when processing >= > 1024 bytes (2 * CTR_BUFFER_LIMIT) at a time. Yes. > If you would like to write > a test case, that's appreciated. I will try to, though I'm busy with other tasks. -- With best wishes Dmitry _______________________________________________ nettle-bugs mailing list [email protected] http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs
