From ef1224d4309eaa1c77b513f47a64b451e6202834 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Thu, 26 Sep 2019 04:43:26 +0100 Subject: [PATCH] Update crypto code from Catacomb 2.5.0. This change committed automatically by `import-catacomb-crypto'. * Import updated `keccak1600.c' from upstream `symm/keccak1600.c'. * Import updated `sha3.c' from upstream `symm/sha3.c'. Detailed list of changes: * no upstream changes: import-catacomb-crypto patch for keccak1600 and sha3 Upstream-Revision: ad7da99a043dab9addc7fce6b22b30f12c7676e6 --- keccak1600.c | 4 ++-- sha3.c | 13 ------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/keccak1600.c b/keccak1600.c index c24f6cc..e34d761 100644 --- a/keccak1600.c +++ b/keccak1600.c @@ -259,8 +259,8 @@ static const lane rcon[24] = { #else /* A target with fused and/not (`bic', `andc2'). Everything is simple. */ -#define STATE_INIT(z) do ; while (0) -#define STATE_OUT(z) do ; while (0) +#define STATE_INIT(z) do {} while (0) +#define STATE_OUT(z) do {} while (0) #endif diff --git a/sha3.c b/sha3.c index 0fede83..4da0f0c 100644 --- a/sha3.c +++ b/sha3.c @@ -195,19 +195,6 @@ static void leftenc_sz(shake_ctx *ctx, size_t n) shake_hash(ctx, b + i, 9 - i); } -static void rightenc_sz(shake_ctx *ctx, size_t n) -{ - kludge64 t; - octet b[9]; - unsigned i; - - SET64(t, ((n&~(size_t)MASK32) >> 16) >> 16, n&MASK32); - STORE64_B_(b, t); - for (i = 0; i < 7 && !b[i]; i++); - b[8] = 8 - i; - shake_hash(ctx, b + i, 9 - i); -} - static void stringenc(shake_ctx *ctx, const void *p, size_t sz) { leftenc_sz(ctx, 8*sz); if (sz) shake_hash(ctx, p, sz); } -- 2.11.0