X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=skein%2Fthreefish256_enc.c;h=ebfa03975aec82ebff4b2a0537f29447e4534741;hb=b8d6b2bd3ddea45506f584c7d44fe5fff0557ed1;hp=8bfbf9de471bad329a6490300d49c25f4e7358b0;hpb=4f50c75ee5a6cc88bf7ea71957ed509e298e6c25;p=avr-crypto-lib.git diff --git a/skein/threefish256_enc.c b/skein/threefish256_enc.c index 8bfbf9d..ebfa039 100644 --- a/skein/threefish256_enc.c +++ b/skein/threefish256_enc.c @@ -21,9 +21,9 @@ * \email daniel.otte@rub.de * \date 2009-03-12 * \license GPLv3 or later - * - * - * + * + * + * */ #include @@ -39,7 +39,8 @@ void permute_4(void* data){ X(3) = t; } -#define THREEFISH_KEY_CONST 0x5555555555555555LL /* 2**64/3 */ +//#define THREEFISH_KEY_CONST 0x5555555555555555LL /* 2**64/3 */ +#define THREEFISH_KEY_CONST 0x1BD11BDAA9FC1A22LL #define K(s) (((uint64_t*)key)[(s)]) #define T(s) (((uint64_t*)tweak)[(s)]) @@ -69,8 +70,12 @@ void add_key_4(void* data, const threefish256_ctx_t* ctx, uint8_t s){ void threefish256_enc(void* data, const threefish256_ctx_t* ctx){ uint8_t i=0,s=0; - uint8_t r0[8] = { 5, 36, 13, 58, 26, 53, 11, 59}; +/* old constans, changed at round 2 of the SHA-3 contest + uint8_t r0[8] = { 5, 36, 13, 58, 26, 53, 11, 59}; uint8_t r1[8] = {56, 28, 46, 44, 20, 35, 42, 50}; +*/ + uint8_t r0[8] = {14, 52, 23, 5, 25, 46, 58, 32}; + uint8_t r1[8] = {16, 57, 40, 37, 33, 12, 22, 32}; do{ if(i%4==0){ add_key_4(data, ctx, s);