diff options
author | Ben Laurie <ben@openssl.org> | 2001-07-30 17:46:22 +0000 |
---|---|---|
committer | Ben Laurie <ben@openssl.org> | 2001-07-30 17:46:22 +0000 |
commit | 3ba5d1cf2eb6ef28ac5f6d9f3d28020d00c5be50 (patch) | |
tree | 73d3b6e7e2ee0ce832943a1e080501b8a96c40d6 /crypto/des/des_enc.c | |
parent | be2e2c32972e421ecc78bb79b502cb9d76d0c391 (diff) |
Make EVPs allocate context memory, thus making them extensible. Rationalise
DES's keyschedules.
I know these two should be separate, and I'll back out the DES changes if they
are deemed to be an error.
Note that there is a memory leak lurking in SSL somewhere in this version.
Diffstat (limited to 'crypto/des/des_enc.c')
-rw-r--r-- | crypto/des/des_enc.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/crypto/des/des_enc.c b/crypto/des/des_enc.c index 0bd9fa39bc..81633c0c67 100644 --- a/crypto/des/des_enc.c +++ b/crypto/des/des_enc.c @@ -58,7 +58,7 @@ #include "des_locl.h" -void des_encrypt1(DES_LONG *data, des_key_schedule ks, int enc) +void des_encrypt1(DES_LONG *data, des_key_schedule *ks, int enc) { register DES_LONG l,r,t,u; #ifdef DES_PTR @@ -84,7 +84,7 @@ void des_encrypt1(DES_LONG *data, des_key_schedule ks, int enc) r=ROTATE(r,29)&0xffffffffL; l=ROTATE(l,29)&0xffffffffL; - s=ks->ks.deslong; + s=ks->ks->deslong; /* I don't know if it is worth the effort of loop unrolling the * inner loop */ if (enc) @@ -156,7 +156,7 @@ void des_encrypt1(DES_LONG *data, des_key_schedule ks, int enc) l=r=t=u=0; } -void des_encrypt2(DES_LONG *data, des_key_schedule ks, int enc) +void des_encrypt2(DES_LONG *data, des_key_schedule *ks, int enc) { register DES_LONG l,r,t,u; #ifdef DES_PTR @@ -180,7 +180,7 @@ void des_encrypt2(DES_LONG *data, des_key_schedule ks, int enc) r=ROTATE(r,29)&0xffffffffL; l=ROTATE(l,29)&0xffffffffL; - s=ks->ks.deslong; + s=ks->ks->deslong; /* I don't know if it is worth the effort of loop unrolling the * inner loop */ if (enc) @@ -247,8 +247,8 @@ void des_encrypt2(DES_LONG *data, des_key_schedule ks, int enc) l=r=t=u=0; } -void des_encrypt3(DES_LONG *data, des_key_schedule ks1, des_key_schedule ks2, - des_key_schedule ks3) +void des_encrypt3(DES_LONG *data, des_key_schedule *ks1, + des_key_schedule *ks2, des_key_schedule *ks3) { register DES_LONG l,r; @@ -267,8 +267,8 @@ void des_encrypt3(DES_LONG *data, des_key_schedule ks1, des_key_schedule ks2, data[1]=r; } -void des_decrypt3(DES_LONG *data, des_key_schedule ks1, des_key_schedule ks2, - des_key_schedule ks3) +void des_decrypt3(DES_LONG *data, des_key_schedule *ks1, + des_key_schedule *ks2, des_key_schedule *ks3) { register DES_LONG l,r; @@ -293,8 +293,9 @@ void des_decrypt3(DES_LONG *data, des_key_schedule ks1, des_key_schedule ks2, #include "ncbc_enc.c" /* des_ncbc_encrypt */ void des_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output, - long length, des_key_schedule ks1, des_key_schedule ks2, - des_key_schedule ks3, des_cblock *ivec, int enc) + long length, des_key_schedule *ks1, + des_key_schedule *ks2, des_key_schedule *ks3, + des_cblock *ivec, int enc) { register DES_LONG tin0,tin1; register DES_LONG tout0,tout1,xor0,xor1; |