X-Git-Url: https://git.cryptolib.org/?p=avr-crypto-lib.git;a=blobdiff_plain;f=rc5%2Frc5.c;h=ea3a24d85bb709611946b43310bb80841c2f5151;hp=441f61d21ef95ea009ce29aebb4e6f689cd7dbe8;hb=4b5da1dc27a791b5c448274a3db09cd035b33493;hpb=d32eba56ce10ea6b9eff123b50d9842673b38f2b diff --git a/rc5/rc5.c b/rc5/rc5.c index 441f61d..ea3a24d 100644 --- a/rc5/rc5.c +++ b/rc5/rc5.c @@ -1,7 +1,7 @@ /* rc5.c */ /* This file is part of the AVR-Crypto-Lib. - Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de) + Copyright (C) 2006-2015 Daniel Otte (bg@nerilex.org) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ /* rc5.c a C implementation of RC5 for AVR microcontrollers * * author: Daniel Otte - * email: daniel.otte@rub.de + * email: bg@nerilex.org * license: GPLv3 * * this implementation is limited to 64bit blocks and a maximum of 255 rounds @@ -37,7 +37,7 @@ #define ROTL32(v,n) (((v)<<(n))|((v)>>(32-(n)))) #define ROTR32(v,n) (((v)>>(n))|((v)<<(32-(n)))) -void rc5_enc(void* buffer, const rc5_ctx_t* ctx){ +void rc5_enc(void *buffer, const rc5_ctx_t *ctx){ uint8_t i; A += ctx->s[0]; B += ctx->s[1]; @@ -47,7 +47,7 @@ void rc5_enc(void* buffer, const rc5_ctx_t* ctx){ } } -void rc5_dec(void* buffer, const rc5_ctx_t* ctx){ +void rc5_dec(void *buffer, const rc5_ctx_t *ctx){ uint8_t i; for(i=ctx->rounds; i>0; --i){ B = ROTR32(B - ctx->s[i*2+1], A&31) ^ A; @@ -64,7 +64,7 @@ Q32 = 10011110001101110111100110111001 = 9e3779b9 #define Q32 0x9e3779b9 -void rc5_init(void* key, uint16_t keysize_b, uint8_t rounds, rc5_ctx_t* ctx){ +void rc5_init(void *key, uint16_t keysize_b, uint8_t rounds, rc5_ctx_t *ctx){ uint16_t c,n,m,j,i,t; uint32_t a,b,l[(keysize_b+31)/32]; ctx->rounds = rounds; @@ -91,7 +91,7 @@ void rc5_init(void* key, uint16_t keysize_b, uint8_t rounds, rc5_ctx_t* ctx){ } } -void rc5_free(rc5_ctx_t* ctx){ +void rc5_free(rc5_ctx_t *ctx){ if(ctx->s) free(ctx->s); }