X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fcast%2Fc_enc.c;h=357c41ebf08a7864525393bf630d2d0ed49598d3;hb=32cf5baeae21774db04af2ad2d74567a617c6fec;hp=ef70c8898121642febcce7162c8aa67a0ca06ccb;hpb=90ba7e21e1e04ba833c807bcb3dc2bdc5136a6b5;p=oweals%2Fopenssl.git diff --git a/crypto/cast/c_enc.c b/crypto/cast/c_enc.c index ef70c88981..357c41ebf0 100644 --- a/crypto/cast/c_enc.c +++ b/crypto/cast/c_enc.c @@ -59,9 +59,10 @@ #include #include "cast_lcl.h" -void CAST_encrypt(CAST_LONG *data, CAST_KEY *key) +void CAST_encrypt(CAST_LONG *data, const CAST_KEY *key) { - register CAST_LONG l,r,*k,t; + register CAST_LONG l,r,t; + const register CAST_LONG *k; k= &(key->data[0]); l=data[0]; @@ -91,9 +92,10 @@ void CAST_encrypt(CAST_LONG *data, CAST_KEY *key) data[0]=r&0xffffffffL; } -void CAST_decrypt(CAST_LONG *data, CAST_KEY *key) +void CAST_decrypt(CAST_LONG *data, const CAST_KEY *key) { - register CAST_LONG l,r,*k,t; + register CAST_LONG l,r,t; + const register CAST_LONG *k; k= &(key->data[0]); l=data[0]; @@ -124,14 +126,14 @@ void CAST_decrypt(CAST_LONG *data, CAST_KEY *key) } void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, - CAST_KEY *ks, unsigned char *iv, int _encrypt) + const CAST_KEY *ks, unsigned char *iv, int enc) { register CAST_LONG tin0,tin1; register CAST_LONG tout0,tout1,xor0,xor1; register long l=length; CAST_LONG tin[2]; - if (_encrypt) + if (enc) { n2l(iv,tout0); n2l(iv,tout1); @@ -204,4 +206,3 @@ void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, tin0=tin1=tout0=tout1=xor0=xor1=0; tin[0]=tin[1]=0; } -