chiark / gitweb /
Update crypto code from Catacomb 2.5.0.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 26 Sep 2019 03:43:26 +0000 (04:43 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 26 Sep 2019 03:43:26 +0000 (04:43 +0100)
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
sha3.c

index c24f6cc25a0051c7df512c1c8f2880ac04ea5abd..e34d76185a6fef715de8e1ebe6a09bfbbb1039dd 100644 (file)
@@ -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 0fede83d2ee9a291712912c6d0b2888405eb7f11..4da0f0cdba00daa9c1d60d5ed332014086a8ea4e 100644 (file)
--- 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); }