]> git.cryptolib.org Git - avr-crypto-lib.git/blobdiff - cscipher/cscipher_small.c
global style change (now * is attached to identifier not to type)
[avr-crypto-lib.git] / cscipher / cscipher_small.c
index 9e8b297f7598154b7fc778806699b34e20a4dceb..e68d70d9a8a38263810ec6f809de510c2a05ec16 100644 (file)
@@ -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,
@@ -95,7 +95,7 @@ static uint16_t m_inv(uint16_t a){
 }
 
 
-void cscipher_enc(void* buffer, const cscipher_ctx_t* ctx){
+void cscipher_enc(void *buffer, const cscipher_ctx_t *ctx){
        uint8_t i,j,k;
        uint8_t tmp[8];
        for(i=0; i<8; ++i){
@@ -123,7 +123,7 @@ void cscipher_enc(void* buffer, const cscipher_ctx_t* ctx){
        memxor(buffer, ctx->keys[8], 8);
 }
 
-void cscipher_dec(void* buffer, const cscipher_ctx_t* ctx){
+void cscipher_dec(void *buffer, const cscipher_ctx_t *ctx){
        uint8_t i=7,j,k;
        uint8_t tmp[8];
        memxor(buffer, ctx->keys[8], 8);
@@ -146,9 +146,9 @@ void cscipher_dec(void* buffer, const cscipher_ctx_t* ctx){
        }while(i--);
 }
 
-void cscipher_init(const 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