]> git.cryptolib.org Git - avr-crypto-lib.git/blobdiff - bcal/bcal-ctr.c
global style change (now * is attached to identifier not to type)
[avr-crypto-lib.git] / bcal / bcal-ctr.c
index 694cedd145d294672fba5e2d2664c85b8101d164..c0d7d771e15654a66b68069c036232fe94d55785 100644 (file)
@@ -24,7 +24,7 @@
 #include "bcal-ctr.h"
 #include "memxor.h"
 
-static void increment_be(voidblock, uint8_t size_B){
+static void increment_be(void *block, uint8_t size_B){
        uint16_t c=1;
        do{
                --size_B;
@@ -34,7 +34,7 @@ static void increment_be(void* block, uint8_t size_B){
        }while(size_B);
 }
 
-uint8_t bcal_ctr_init(const bcdesc_t* desc, const void* key, uint16_t keysize_b, inc_fp_t inc_func, bcal_ctr_ctx_t* ctx){
+uint8_t bcal_ctr_init(const bcdesc_t *desc, const void *key, uint16_t keysize_b, inc_fp_t inc_func, bcal_ctr_ctx_t *ctx){
        ctx->desc = (bcdesc_t*)desc;
        if(inc_func){
                ctx->inc_func = inc_func;
@@ -49,18 +49,18 @@ uint8_t bcal_ctr_init(const bcdesc_t* desc, const void* key, uint16_t keysize_b,
        return bcal_cipher_init(desc, key, keysize_b, &(ctx->cctx));
 }
 
-void bcal_ctr_free(bcal_ctr_ctx_tctx){
+void bcal_ctr_free(bcal_ctr_ctx_t *ctx){
        free(ctx->in_block);
        bcal_cipher_free(&(ctx->cctx));
 }
 
-void bcal_ctr_loadIV(const void* iv, bcal_ctr_ctx_t* ctx){
+void bcal_ctr_loadIV(const void *iv, bcal_ctr_ctx_t *ctx){
        if(iv){
                memcpy(ctx->in_block, iv, ctx->blocksize_B);
        }
 }
 
-void bcal_ctr_encNext(void* block, bcal_ctr_ctx_t* ctx){
+void bcal_ctr_encNext(void *block, bcal_ctr_ctx_t *ctx){
        uint8_t tmp[ctx->blocksize_B];
        memcpy(tmp, ctx->in_block, ctx->blocksize_B);
        bcal_cipher_enc(tmp, &(ctx->cctx));
@@ -68,11 +68,11 @@ void bcal_ctr_encNext(void* block, bcal_ctr_ctx_t* ctx){
        ctx->inc_func(ctx->in_block, ctx->blocksize_B);
 }
 
-void bcal_ctr_decNext(void* block, bcal_ctr_ctx_t* ctx){
+void bcal_ctr_decNext(void *block, bcal_ctr_ctx_t *ctx){
        bcal_ctr_encNext(block, ctx);
 }
 
-void bcal_ctr_encMsg(const void* iv, void* msg, uint32_t msg_len_b, bcal_ctr_ctx_t* ctx){
+void bcal_ctr_encMsg(const void *iv, void *msg, uint32_t msg_len_b, bcal_ctr_ctx_t *ctx){
        bcal_ctr_loadIV(iv, ctx);
        uint16_t blocksize_b;
        blocksize_b = ctx->blocksize_B*8;
@@ -89,7 +89,7 @@ void bcal_ctr_encMsg(const void* iv, void* msg, uint32_t msg_len_b, bcal_ctr_ctx
        memxor(msg, tmp, (msg_len_b+7)/8);
 }
 
-void bcal_ctr_decMsg(const void* iv, void* msg, uint32_t msg_len_b, bcal_ctr_ctx_t* ctx){
+void bcal_ctr_decMsg(const void *iv, void *msg, uint32_t msg_len_b, bcal_ctr_ctx_t *ctx){
        bcal_ctr_encMsg(iv, msg, msg_len_b, ctx);
 }