From: Niels Möller Date: Mon, 20 Sep 2010 09:14:08 +0000 (+0200) Subject: (CAMELLIA_F_HALF_INV): Deleted macro. X-Git-Tag: nettle_2.2_release_20110711~255 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c1e83849379894471833744d93b34f5d1da17654;p=thirdparty%2Fnettle.git (CAMELLIA_F_HALF_INV): Deleted macro. (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 --- diff --git a/camellia-set-encrypt-key.c b/camellia-set-encrypt-key.c index 500128fe..ee379946 100644 --- a/camellia-set-encrypt-key.c +++ b/camellia-set-encrypt-key.c @@ -74,14 +74,6 @@ (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]); - } }