From: Niels Möller Date: Wed, 25 Jan 2023 13:40:05 +0000 (+0100) Subject: Fix pointer bug in previous change. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e3056ebffb6a82168949034ddcfa854bace4ec6;p=thirdparty%2Fnettle.git Fix pointer bug in previous change. --- diff --git a/ocb.c b/ocb.c index aab6b6b2..fd798d30 100644 --- a/ocb.c +++ b/ocb.c @@ -202,12 +202,15 @@ ocb_encrypt (struct ocb_ctx *ctx, const struct ocb_key *key, if (length > 0) { union nettle_block16 block; - pad_block (&block, length, src + n*OCB_BLOCK_SIZE); + + src += n*OCB_BLOCK_SIZE; dst += n*OCB_BLOCK_SIZE; + + pad_block (&block, length, src); block16_xor (&ctx->checksum, &block); block16_xor (&ctx->offset, &key->L[0]); f (cipher, OCB_BLOCK_SIZE, block.b, ctx->offset.b); - memxor3 (dst + n*OCB_BLOCK_SIZE, block.b, src, length); + memxor3 (dst, block.b, src, length); ctx->message_count++; } }