X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=cscipher%2Fcscipher_small.c;h=640bcf271bb373408f08d61436d82bf276dc8c67;hb=ca591a22fb1e3500567c3d0b730009b44ba33c2c;hp=9cec6e8a4b3ab132823a851dc6b806a791d5cf1b;hpb=0542221a3e793e4455e84b271b07aa0959d5dfb3;p=avr-crypto-lib.git diff --git a/cscipher/cscipher_small.c b/cscipher/cscipher_small.c index 9cec6e8..640bcf2 100644 --- a/cscipher/cscipher_small.c +++ b/cscipher/cscipher_small.c @@ -57,11 +57,11 @@ uint8_t p(uint8_t a){ #define P(a) pgm_read_byte(cscipher_sbox+(a)) #endif -static uint8_t round_const[] PROGMEM = { +static const uint8_t round_const[] PROGMEM = { 0xb7, 0xe1, 0x51, 0x62, 0x8a, 0xed, 0x2a, 0x6a, 0xbf, 0x71, 0x58, 0x80, 0x9c, 0xf4, 0xf3, 0xc7 }; -static uint8_t ks_const[] PROGMEM = { +static const uint8_t ks_const[] PROGMEM = { 0x29,0x0d,0x61,0x40,0x9c,0xeb,0x9e,0x8f, 0x1f,0x85,0x5f,0x58,0x5b,0x01,0x39,0x86, 0x97,0x2e,0xd7,0xd6,0x35,0xae,0x17,0x16, @@ -146,9 +146,9 @@ void cscipher_dec(void* buffer, const cscipher_ctx_t* ctx){ }while(i--); } -void cscipher_init(void* key, cscipher_ctx_t* ctx){ +void cscipher_init(const void* key, cscipher_ctx_t* ctx){ uint8_t tmp_key[16], tmp[8]; - uint8_t i,j,k,t; + uint8_t i,j,k,t=0; memcpy(tmp_key, key, 16); for(i=0; i<9; ++i){ #if DEBUG