]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
(CAMELLIA_F_HALF_INV): Deleted macro.
authorNiels Möller <nisse@lysator.liu.se>
Mon, 20 Sep 2010 09:14:08 +0000 (11:14 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Mon, 20 Sep 2010 09:14:08 +0000 (11:14 +0200)
(camellia_set_encrypt_key): Deleted the CAMELLIA_F_HALF_INV
operations intended for moving the key xor into the middle of the
round.

Rev: nettle/camellia-set-encrypt-key.c:1.5

camellia-set-encrypt-key.c

index 500128fe30cc1ee724abb616d956bda5c77032c2..ee3799466bb95dd48be13fabcdb386dd487983c2 100644 (file)
     (y) = ((uint64_t) __yl << 32) | __yr;      \
   } while (0)
 
-#define CAMELLIA_F_HALF_INV(x) do {            \
-    uint32_t __t, __w;                         \
-    __t = (x) >> 32;                           \
-    __w = __t ^(x);                            \
-    __w = ROL32(8, __w);                       \
-    (x) = ((uint64_t) __w << 32) | (__t ^ __w);        \
-  } while (0)
-
 void
 camellia_set_encrypt_key(struct camellia_ctx *ctx,
                         unsigned length, const uint8_t *key)
@@ -317,15 +309,4 @@ camellia_set_encrypt_key(struct camellia_ctx *ctx,
     }
   ctx->keys[i-2] = subkey[i-2];
   ctx->keys[i-1] = subkey[i] ^ subkey[i-1];
-
-  for (i = 0; i < ctx->nkeys; i += 8)
-    {
-      /* apply the inverse of the last half of F-function */
-      CAMELLIA_F_HALF_INV(ctx->keys[i+1]);
-      CAMELLIA_F_HALF_INV(ctx->keys[i+2]);
-      CAMELLIA_F_HALF_INV(ctx->keys[i+3]);
-      CAMELLIA_F_HALF_INV(ctx->keys[i+4]);
-      CAMELLIA_F_HALF_INV(ctx->keys[i+5]);
-      CAMELLIA_F_HALF_INV(ctx->keys[i+6]);
-    }
 }