diff options
Diffstat (limited to 'src/lib/libcrypto/des/xcbc_enc.c')
-rw-r--r-- | src/lib/libcrypto/des/xcbc_enc.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/lib/libcrypto/des/xcbc_enc.c b/src/lib/libcrypto/des/xcbc_enc.c index ccfede13ac..47246eb466 100644 --- a/src/lib/libcrypto/des/xcbc_enc.c +++ b/src/lib/libcrypto/des/xcbc_enc.c | |||
@@ -79,8 +79,8 @@ static unsigned char desx_white_in2out[256]={ | |||
79 | 0xA7,0x1C,0xC9,0x09,0x69,0x9A,0x83,0xCF,0x29,0x39,0xB9,0xE9,0x4C,0xFF,0x43,0xAB, | 79 | 0xA7,0x1C,0xC9,0x09,0x69,0x9A,0x83,0xCF,0x29,0x39,0xB9,0xE9,0x4C,0xFF,0x43,0xAB, |
80 | }; | 80 | }; |
81 | 81 | ||
82 | void des_xwhite_in2out(const_des_cblock *des_key, const_des_cblock *in_white, | 82 | void DES_xwhite_in2out(const_DES_cblock *des_key, const_DES_cblock *in_white, |
83 | des_cblock *out_white) | 83 | DES_cblock *out_white) |
84 | { | 84 | { |
85 | int out0,out1; | 85 | int out0,out1; |
86 | int i; | 86 | int i; |
@@ -107,9 +107,10 @@ void des_xwhite_in2out(const_des_cblock *des_key, const_des_cblock *in_white, | |||
107 | } | 107 | } |
108 | } | 108 | } |
109 | 109 | ||
110 | void des_xcbc_encrypt(const unsigned char *in, unsigned char *out, | 110 | void DES_xcbc_encrypt(const unsigned char *in, unsigned char *out, |
111 | long length, des_key_schedule schedule, des_cblock *ivec, | 111 | long length, DES_key_schedule *schedule, |
112 | const_des_cblock *inw, const_des_cblock *outw, int enc) | 112 | DES_cblock *ivec, const_DES_cblock *inw, |
113 | const_DES_cblock *outw, int enc) | ||
113 | { | 114 | { |
114 | register DES_LONG tin0,tin1; | 115 | register DES_LONG tin0,tin1; |
115 | register DES_LONG tout0,tout1,xor0,xor1; | 116 | register DES_LONG tout0,tout1,xor0,xor1; |
@@ -138,7 +139,7 @@ void des_xcbc_encrypt(const unsigned char *in, unsigned char *out, | |||
138 | c2l(in,tin1); | 139 | c2l(in,tin1); |
139 | tin0^=tout0^inW0; tin[0]=tin0; | 140 | tin0^=tout0^inW0; tin[0]=tin0; |
140 | tin1^=tout1^inW1; tin[1]=tin1; | 141 | tin1^=tout1^inW1; tin[1]=tin1; |
141 | des_encrypt1(tin,schedule,DES_ENCRYPT); | 142 | DES_encrypt1(tin,schedule,DES_ENCRYPT); |
142 | tout0=tin[0]^outW0; l2c(tout0,out); | 143 | tout0=tin[0]^outW0; l2c(tout0,out); |
143 | tout1=tin[1]^outW1; l2c(tout1,out); | 144 | tout1=tin[1]^outW1; l2c(tout1,out); |
144 | } | 145 | } |
@@ -147,7 +148,7 @@ void des_xcbc_encrypt(const unsigned char *in, unsigned char *out, | |||
147 | c2ln(in,tin0,tin1,l+8); | 148 | c2ln(in,tin0,tin1,l+8); |
148 | tin0^=tout0^inW0; tin[0]=tin0; | 149 | tin0^=tout0^inW0; tin[0]=tin0; |
149 | tin1^=tout1^inW1; tin[1]=tin1; | 150 | tin1^=tout1^inW1; tin[1]=tin1; |
150 | des_encrypt1(tin,schedule,DES_ENCRYPT); | 151 | DES_encrypt1(tin,schedule,DES_ENCRYPT); |
151 | tout0=tin[0]^outW0; l2c(tout0,out); | 152 | tout0=tin[0]^outW0; l2c(tout0,out); |
152 | tout1=tin[1]^outW1; l2c(tout1,out); | 153 | tout1=tin[1]^outW1; l2c(tout1,out); |
153 | } | 154 | } |
@@ -163,7 +164,7 @@ void des_xcbc_encrypt(const unsigned char *in, unsigned char *out, | |||
163 | { | 164 | { |
164 | c2l(in,tin0); tin[0]=tin0^outW0; | 165 | c2l(in,tin0); tin[0]=tin0^outW0; |
165 | c2l(in,tin1); tin[1]=tin1^outW1; | 166 | c2l(in,tin1); tin[1]=tin1^outW1; |
166 | des_encrypt1(tin,schedule,DES_DECRYPT); | 167 | DES_encrypt1(tin,schedule,DES_DECRYPT); |
167 | tout0=tin[0]^xor0^inW0; | 168 | tout0=tin[0]^xor0^inW0; |
168 | tout1=tin[1]^xor1^inW1; | 169 | tout1=tin[1]^xor1^inW1; |
169 | l2c(tout0,out); | 170 | l2c(tout0,out); |
@@ -175,7 +176,7 @@ void des_xcbc_encrypt(const unsigned char *in, unsigned char *out, | |||
175 | { | 176 | { |
176 | c2l(in,tin0); tin[0]=tin0^outW0; | 177 | c2l(in,tin0); tin[0]=tin0^outW0; |
177 | c2l(in,tin1); tin[1]=tin1^outW1; | 178 | c2l(in,tin1); tin[1]=tin1^outW1; |
178 | des_encrypt1(tin,schedule,DES_DECRYPT); | 179 | DES_encrypt1(tin,schedule,DES_DECRYPT); |
179 | tout0=tin[0]^xor0^inW0; | 180 | tout0=tin[0]^xor0^inW0; |
180 | tout1=tin[1]^xor1^inW1; | 181 | tout1=tin[1]^xor1^inW1; |
181 | l2cn(tout0,tout1,out,l+8); | 182 | l2cn(tout0,tout1,out,l+8); |