summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/cast/c_cfb64.c
diff options
context:
space:
mode:
authorbeck <>1999-09-29 04:37:45 +0000
committerbeck <>1999-09-29 04:37:45 +0000
commitde8f24ea083384bb66b32ec105dc4743c5663cdf (patch)
tree1412176ae62a3cab2cf2b0b92150fcbceaac6092 /src/lib/libcrypto/cast/c_cfb64.c
parentcb929d29896bcb87c2a97417fbd03e50078fc178 (diff)
downloadopenbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.gz
openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.bz2
openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.zip
OpenSSL 0.9.4 merge
Diffstat (limited to 'src/lib/libcrypto/cast/c_cfb64.c')
-rw-r--r--src/lib/libcrypto/cast/c_cfb64.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/lib/libcrypto/cast/c_cfb64.c b/src/lib/libcrypto/cast/c_cfb64.c
index c46c375f75..514c005c32 100644
--- a/src/lib/libcrypto/cast/c_cfb64.c
+++ b/src/lib/libcrypto/cast/c_cfb64.c
@@ -56,7 +56,7 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59#include "cast.h" 59#include <openssl/cast.h>
60#include "cast_lcl.h" 60#include "cast_lcl.h"
61 61
62/* The input and output encrypted as though 64bit cfb mode is being 62/* The input and output encrypted as though 64bit cfb mode is being
@@ -64,14 +64,9 @@
64 * 64bit block we have used is contained in *num; 64 * 64bit block we have used is contained in *num;
65 */ 65 */
66 66
67void CAST_cfb64_encrypt(in, out, length, schedule, ivec, num, encrypt) 67void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out,
68unsigned char *in; 68 long length, CAST_KEY *schedule, unsigned char *ivec,
69unsigned char *out; 69 int *num, int enc)
70long length;
71CAST_KEY *schedule;
72unsigned char *ivec;
73int *num;
74int encrypt;
75 { 70 {
76 register CAST_LONG v0,v1,t; 71 register CAST_LONG v0,v1,t;
77 register int n= *num; 72 register int n= *num;
@@ -79,8 +74,8 @@ int encrypt;
79 CAST_LONG ti[2]; 74 CAST_LONG ti[2];
80 unsigned char *iv,c,cc; 75 unsigned char *iv,c,cc;
81 76
82 iv=(unsigned char *)ivec; 77 iv=ivec;
83 if (encrypt) 78 if (enc)
84 { 79 {
85 while (l--) 80 while (l--)
86 { 81 {
@@ -89,10 +84,10 @@ int encrypt;
89 n2l(iv,v0); ti[0]=v0; 84 n2l(iv,v0); ti[0]=v0;
90 n2l(iv,v1); ti[1]=v1; 85 n2l(iv,v1); ti[1]=v1;
91 CAST_encrypt((CAST_LONG *)ti,schedule); 86 CAST_encrypt((CAST_LONG *)ti,schedule);
92 iv=(unsigned char *)ivec; 87 iv=ivec;
93 t=ti[0]; l2n(t,iv); 88 t=ti[0]; l2n(t,iv);
94 t=ti[1]; l2n(t,iv); 89 t=ti[1]; l2n(t,iv);
95 iv=(unsigned char *)ivec; 90 iv=ivec;
96 } 91 }
97 c= *(in++)^iv[n]; 92 c= *(in++)^iv[n];
98 *(out++)=c; 93 *(out++)=c;
@@ -109,10 +104,10 @@ int encrypt;
109 n2l(iv,v0); ti[0]=v0; 104 n2l(iv,v0); ti[0]=v0;
110 n2l(iv,v1); ti[1]=v1; 105 n2l(iv,v1); ti[1]=v1;
111 CAST_encrypt((CAST_LONG *)ti,schedule); 106 CAST_encrypt((CAST_LONG *)ti,schedule);
112 iv=(unsigned char *)ivec; 107 iv=ivec;
113 t=ti[0]; l2n(t,iv); 108 t=ti[0]; l2n(t,iv);
114 t=ti[1]; l2n(t,iv); 109 t=ti[1]; l2n(t,iv);
115 iv=(unsigned char *)ivec; 110 iv=ivec;
116 } 111 }
117 cc= *(in++); 112 cc= *(in++);
118 c=iv[n]; 113 c=iv[n];