summaryrefslogtreecommitdiffstats
path: root/crypto/cast/c_cfb64.c
diff options
context:
space:
mode:
authorBen Laurie <ben@openssl.org>1999-05-13 17:10:42 +0000
committerBen Laurie <ben@openssl.org>1999-05-13 17:10:42 +0000
commit90ba7e21e1e04ba833c807bcb3dc2bdc5136a6b5 (patch)
treeef2bc7e23be9f0d0efdd7bf9c4531696bede3b00 /crypto/cast/c_cfb64.c
parent224551f73222609952dcc0f21a6b007009c23d60 (diff)
Avoid shadowing, and a bit of constification while I'm at it.
Diffstat (limited to 'crypto/cast/c_cfb64.c')
-rw-r--r--crypto/cast/c_cfb64.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/crypto/cast/c_cfb64.c b/crypto/cast/c_cfb64.c
index 50d234b466..095e05a563 100644
--- a/crypto/cast/c_cfb64.c
+++ b/crypto/cast/c_cfb64.c
@@ -64,8 +64,9 @@
* 64bit block we have used is contained in *num;
*/
-void CAST_cfb64_encrypt(unsigned char *in, unsigned char *out, long length,
- CAST_KEY *schedule, unsigned char *ivec, int *num, int encrypt)
+void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, CAST_KEY *schedule, unsigned char *ivec,
+ int *num, int _encrypt)
{
register CAST_LONG v0,v1,t;
register int n= *num;
@@ -73,8 +74,8 @@ void CAST_cfb64_encrypt(unsigned char *in, unsigned char *out, long length,
CAST_LONG ti[2];
unsigned char *iv,c,cc;
- iv=(unsigned char *)ivec;
- if (encrypt)
+ iv=ivec;
+ if (_encrypt)
{
while (l--)
{
@@ -83,10 +84,10 @@ void CAST_cfb64_encrypt(unsigned char *in, unsigned char *out, long length,
n2l(iv,v0); ti[0]=v0;
n2l(iv,v1); ti[1]=v1;
CAST_encrypt((CAST_LONG *)ti,schedule);
- iv=(unsigned char *)ivec;
+ iv=ivec;
t=ti[0]; l2n(t,iv);
t=ti[1]; l2n(t,iv);
- iv=(unsigned char *)ivec;
+ iv=ivec;
}
c= *(in++)^iv[n];
*(out++)=c;
@@ -103,10 +104,10 @@ void CAST_cfb64_encrypt(unsigned char *in, unsigned char *out, long length,
n2l(iv,v0); ti[0]=v0;
n2l(iv,v1); ti[1]=v1;
CAST_encrypt((CAST_LONG *)ti,schedule);
- iv=(unsigned char *)ivec;
+ iv=ivec;
t=ti[0]; l2n(t,iv);
t=ti[1]; l2n(t,iv);
- iv=(unsigned char *)ivec;
+ iv=ivec;
}
cc= *(in++);
c=iv[n];