X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fcast%2Fc_cfb64.c;h=dcec13a2019d522fdbe8f4f8baa7172c57bfac85;hp=a9d32517c432a688a490ddd1f9bbe37813ec1629;hb=8bbfd94e36559ceb7187d4d8a63e950713b93e0d;hpb=6b691a5c85ddc4e407e32781841fee5c029506cd diff --git a/crypto/cast/c_cfb64.c b/crypto/cast/c_cfb64.c index a9d32517c4..dcec13a201 100644 --- a/crypto/cast/c_cfb64.c +++ b/crypto/cast/c_cfb64.c @@ -56,7 +56,7 @@ * [including the GNU Public Licence.] */ -#include "cast.h" +#include #include "cast_lcl.h" /* The input and output encrypted as though 64bit cfb mode is being @@ -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, const CAST_KEY *schedule, unsigned char *ivec, + int *num, int enc) { 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 (enc) { 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]; @@ -118,4 +119,3 @@ void CAST_cfb64_encrypt(unsigned char *in, unsigned char *out, long length, v0=v1=ti[0]=ti[1]=t=c=cc=0; *num=n; } -