summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/des/cfb_enc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/des/cfb_enc.c')
-rw-r--r--src/lib/libcrypto/des/cfb_enc.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/lib/libcrypto/des/cfb_enc.c b/src/lib/libcrypto/des/cfb_enc.c
index 342e785691..17bf77ca9e 100644
--- a/src/lib/libcrypto/des/cfb_enc.c
+++ b/src/lib/libcrypto/des/cfb_enc.c
@@ -64,14 +64,8 @@
64 * the second. The second 12 bits will come from the 3rd and half the 4th 64 * the second. The second 12 bits will come from the 3rd and half the 4th
65 * byte. 65 * byte.
66 */ 66 */
67void des_cfb_encrypt(in, out, numbits, length, schedule, ivec, enc) 67void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits,
68unsigned char *in; 68 long length, DES_key_schedule *schedule, DES_cblock *ivec, int enc)
69unsigned char *out;
70int numbits;
71long length;
72des_key_schedule schedule;
73des_cblock (*ivec);
74int enc;
75 { 69 {
76 register DES_LONG d0,d1,v0,v1,n=(numbits+7)/8; 70 register DES_LONG d0,d1,v0,v1,n=(numbits+7)/8;
77 register DES_LONG mask0,mask1; 71 register DES_LONG mask0,mask1;
@@ -96,7 +90,7 @@ int enc;
96 mask1=0x00000000L; 90 mask1=0x00000000L;
97 } 91 }
98 92
99 iv=(unsigned char *)ivec; 93 iv = &(*ivec)[0];
100 c2l(iv,v0); 94 c2l(iv,v0);
101 c2l(iv,v1); 95 c2l(iv,v1);
102 if (enc) 96 if (enc)
@@ -106,7 +100,7 @@ int enc;
106 l-=n; 100 l-=n;
107 ti[0]=v0; 101 ti[0]=v0;
108 ti[1]=v1; 102 ti[1]=v1;
109 des_encrypt((DES_LONG *)ti,schedule,DES_ENCRYPT); 103 DES_encrypt1((DES_LONG *)ti,schedule,DES_ENCRYPT);
110 c2ln(in,d0,d1,n); 104 c2ln(in,d0,d1,n);
111 in+=n; 105 in+=n;
112 d0=(d0^ti[0])&mask0; 106 d0=(d0^ti[0])&mask0;
@@ -138,7 +132,7 @@ int enc;
138 l-=n; 132 l-=n;
139 ti[0]=v0; 133 ti[0]=v0;
140 ti[1]=v1; 134 ti[1]=v1;
141 des_encrypt((DES_LONG *)ti,schedule,DES_ENCRYPT); 135 DES_encrypt1((DES_LONG *)ti,schedule,DES_ENCRYPT);
142 c2ln(in,d0,d1,n); 136 c2ln(in,d0,d1,n);
143 in+=n; 137 in+=n;
144 /* 30-08-94 - eay - changed because l>>32 and 138 /* 30-08-94 - eay - changed because l>>32 and
@@ -163,7 +157,7 @@ int enc;
163 out+=n; 157 out+=n;
164 } 158 }
165 } 159 }
166 iv=(unsigned char *)ivec; 160 iv = &(*ivec)[0];
167 l2c(v0,iv); 161 l2c(v0,iv);
168 l2c(v1,iv); 162 l2c(v1,iv);
169 v0=v1=d0=d1=ti[0]=ti[1]=0; 163 v0=v1=d0=d1=ti[0]=ti[1]=0;