Don't use reserved name "_encrypt" for parameters;
instead I've picked "enc", because that's what's in the prototypes. ("_encrypt" is reserved only as an external name, but still using it in an application doesn't look like good style to me -- and it certainly isn't if the point is just avoiding shadowing, which is apparently why the previous name "encrypt" was changed.)
This commit is contained in:
parent
2adca9cdc6
commit
608217d8d0
@ -66,7 +66,7 @@
|
|||||||
|
|
||||||
void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out,
|
void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out,
|
||||||
long length, CAST_KEY *schedule, unsigned char *ivec,
|
long length, CAST_KEY *schedule, unsigned char *ivec,
|
||||||
int *num, int _encrypt)
|
int *num, int enc)
|
||||||
{
|
{
|
||||||
register CAST_LONG v0,v1,t;
|
register CAST_LONG v0,v1,t;
|
||||||
register int n= *num;
|
register int n= *num;
|
||||||
@ -75,7 +75,7 @@ void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out,
|
|||||||
unsigned char *iv,c,cc;
|
unsigned char *iv,c,cc;
|
||||||
|
|
||||||
iv=ivec;
|
iv=ivec;
|
||||||
if (_encrypt)
|
if (enc)
|
||||||
{
|
{
|
||||||
while (l--)
|
while (l--)
|
||||||
{
|
{
|
||||||
|
@ -63,13 +63,13 @@
|
|||||||
char *CAST_version="CAST" OPENSSL_VERSION_PTEXT;
|
char *CAST_version="CAST" OPENSSL_VERSION_PTEXT;
|
||||||
|
|
||||||
void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
||||||
CAST_KEY *ks, int _encrypt)
|
CAST_KEY *ks, int enc)
|
||||||
{
|
{
|
||||||
CAST_LONG l,d[2];
|
CAST_LONG l,d[2];
|
||||||
|
|
||||||
n2l(in,l); d[0]=l;
|
n2l(in,l); d[0]=l;
|
||||||
n2l(in,l); d[1]=l;
|
n2l(in,l); d[1]=l;
|
||||||
if (_encrypt)
|
if (enc)
|
||||||
CAST_encrypt(d,ks);
|
CAST_encrypt(d,ks);
|
||||||
else
|
else
|
||||||
CAST_decrypt(d,ks);
|
CAST_decrypt(d,ks);
|
||||||
|
@ -124,14 +124,14 @@ void CAST_decrypt(CAST_LONG *data, CAST_KEY *key)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
|
void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
|
||||||
CAST_KEY *ks, unsigned char *iv, int _encrypt)
|
CAST_KEY *ks, unsigned char *iv, int enc)
|
||||||
{
|
{
|
||||||
register CAST_LONG tin0,tin1;
|
register CAST_LONG tin0,tin1;
|
||||||
register CAST_LONG tout0,tout1,xor0,xor1;
|
register CAST_LONG tout0,tout1,xor0,xor1;
|
||||||
register long l=length;
|
register long l=length;
|
||||||
CAST_LONG tin[2];
|
CAST_LONG tin[2];
|
||||||
|
|
||||||
if (_encrypt)
|
if (enc)
|
||||||
{
|
{
|
||||||
n2l(iv,tout0);
|
n2l(iv,tout0);
|
||||||
n2l(iv,tout1);
|
n2l(iv,tout1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user