X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=jh%2Fjh_simple_speed_core.c;h=5a7e16fbb56bd6c5f54cc5b65cc83ba22e43629a;hb=fb928c1c4c392b9e987631f84f1027af94e05beb;hp=36a58208568586c4f13f73db2051c6faf297babc;hpb=4f19c43af8afeb3c569eb7b4aa15907832cf8e5c;p=arm-crypto-lib.git diff --git a/jh/jh_simple_speed_core.c b/jh/jh_simple_speed_core.c index 36a5820..5a7e16f 100644 --- a/jh/jh_simple_speed_core.c +++ b/jh/jh_simple_speed_core.c @@ -33,15 +33,15 @@ static void jh_round(uint8_t* a, uint8_t roundno){ uint8_t b[128]; - uint8_t i,r,u,v,x,y; + uint8_t i,r=0,u,v,x,y; const uint8_t *pr; pr = jh_round_const + 32*roundno; for(i=0; i<128; ++i){ if(i%4==0){ r = *pr++; } - b[i]=jh_lutbox[((r&0xC0)<<2)|a[i]]; - r<<=2; + b[i] = jh_lutbox[((r&0xC0)<<2)|a[i]]; + r <<= 2; } for(i=0;i<128;++i){ u = jh_permutation_table[2*i]; @@ -62,15 +62,6 @@ void jh_round(uint8_t* a, uint8_t roundno){ } } -static -uint8_t jh_l_inv(uint8_t a){ - uint8_t v,w; - v = a>>4; - w = a&0xf; - v ^= ((w<<1)^(w>>3)^((w>>2)&2))&0xf; - w ^= ((v<<1)^(v>>3)^((v>>2)&2))&0xf; - return w|(v<<4); -} static inline void group(uint8_t *a){