X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=keccak%2Fkeccak.c;h=2c1d9368c0f5f3bc6e8b235853775758902acf68;hb=9023000e91b6065961051339700526c98f8438e8;hp=809f21901ee17c5c13ac36e45ea980cb6217b01b;hpb=25ccd391d2f02575799e94bf9aac1e108e7c0f3b;p=avr-crypto-lib.git diff --git a/keccak/keccak.c b/keccak/keccak.c index 809f219..2c1d936 100644 --- a/keccak/keccak.c +++ b/keccak/keccak.c @@ -62,7 +62,7 @@ void keccak_dump_ctx(keccak_ctx_t* ctx){ #endif /* -static uint64_t rc[] PROGMEM = { +const uint64_t rc[] PROGMEM = { 0x0000000000000001LL, 0x0000000000008082LL, 0x800000000000808ALL, 0x8000000080008000LL, 0x000000000000808BLL, 0x0000000080000001LL, @@ -78,7 +78,7 @@ static uint64_t rc[] PROGMEM = { }; */ -static uint8_t rc_comp[] PROGMEM = { +const static uint8_t rc_comp[] PROGMEM = { 0x01, 0x92, 0xda, 0x70, 0x9b, 0x21, 0xf1, 0x59, 0x8a, 0x88, 0x39, 0x2a, @@ -87,11 +87,7 @@ static uint8_t rc_comp[] PROGMEM = { 0xf1, 0xd0, 0x21, 0x78, }; -uint64_t rotl64(uint64_t a, uint8_t r){ - return (a<>(64-r)); -} - -static uint8_t r[5][5] PROGMEM = { +const static uint8_t r[5][5] PROGMEM = { { ROT_CODE( 0), ROT_CODE(36), ROT_CODE( 3), ROT_CODE(41), ROT_CODE(18) }, { ROT_CODE( 1), ROT_CODE(44), ROT_CODE(10), ROT_CODE(45), ROT_CODE( 2) }, { ROT_CODE(62), ROT_CODE( 6), ROT_CODE(43), ROT_CODE(15), ROT_CODE(61) },