diff options
author | Richard Levitte <levitte@openssl.org> | 2001-10-24 21:21:12 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2001-10-24 21:21:12 +0000 |
commit | c2e4f17c1a0d4d5115c6ede9492de1615fe392ac (patch) | |
tree | 14dda5edeaebac01b4baa3aa026c40a784a44266 /crypto/des/cbc3_enc.c | |
parent | 979689aa5cfa100ccbc1f25064e9398be4b7b05c (diff) | |
download | openssl-new-c2e4f17c1a0d4d5115c6ede9492de1615fe392ac.tar.gz |
Due to an increasing number of clashes between modern OpenSSL and
libdes (which is still used out there) or other des implementations,
the OpenSSL DES functions are renamed to begin with DES_ instead of
des_. Compatibility routines are provided and declared by including
openssl/des_old.h. Those declarations are the same as were in des.h
when the OpenSSL project started, which is exactly how libdes looked
at that time, and hopefully still looks today.
The compatibility functions will be removed in some future release, at
the latest in version 1.0.
Diffstat (limited to 'crypto/des/cbc3_enc.c')
-rw-r--r-- | crypto/des/cbc3_enc.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/crypto/des/cbc3_enc.c b/crypto/des/cbc3_enc.c index c7cc7c1706..b5db4e14f7 100644 --- a/crypto/des/cbc3_enc.c +++ b/crypto/des/cbc3_enc.c @@ -59,41 +59,41 @@ #include "des_locl.h" /* HAS BUGS! DON'T USE - this is only present for use in des.c */ -void des_3cbc_encrypt(des_cblock *input, des_cblock *output, long length, - des_key_schedule ks1, des_key_schedule ks2, des_cblock *iv1, - des_cblock *iv2, int enc) +void DES_3cbc_encrypt(DES_cblock *input, DES_cblock *output, long length, + DES_key_schedule ks1, DES_key_schedule ks2, DES_cblock *iv1, + DES_cblock *iv2, int enc) { int off=((int)length-1)/8; long l8=((length+7)/8)*8; - des_cblock niv1,niv2; + DES_cblock niv1,niv2; if (enc == DES_ENCRYPT) { - des_cbc_encrypt((unsigned char*)input, + DES_cbc_encrypt((unsigned char*)input, (unsigned char*)output,length,&ks1,iv1,enc); - if (length >= sizeof(des_cblock)) - memcpy(niv1,output[off],sizeof(des_cblock)); - des_cbc_encrypt((unsigned char*)output, + if (length >= sizeof(DES_cblock)) + memcpy(niv1,output[off],sizeof(DES_cblock)); + DES_cbc_encrypt((unsigned char*)output, (unsigned char*)output,l8,&ks2,iv1,!enc); - des_cbc_encrypt((unsigned char*)output, + DES_cbc_encrypt((unsigned char*)output, (unsigned char*)output,l8,&ks1,iv2,enc); - if (length >= sizeof(des_cblock)) - memcpy(niv2,output[off],sizeof(des_cblock)); + if (length >= sizeof(DES_cblock)) + memcpy(niv2,output[off],sizeof(DES_cblock)); } else { - if (length >= sizeof(des_cblock)) - memcpy(niv2,input[off],sizeof(des_cblock)); - des_cbc_encrypt((unsigned char*)input, + if (length >= sizeof(DES_cblock)) + memcpy(niv2,input[off],sizeof(DES_cblock)); + DES_cbc_encrypt((unsigned char*)input, (unsigned char*)output,l8,&ks1,iv2,enc); - des_cbc_encrypt((unsigned char*)output, + DES_cbc_encrypt((unsigned char*)output, (unsigned char*)output,l8,&ks2,iv1,!enc); - if (length >= sizeof(des_cblock)) - memcpy(niv1,output[off],sizeof(des_cblock)); - des_cbc_encrypt((unsigned char*)output, + if (length >= sizeof(DES_cblock)) + memcpy(niv1,output[off],sizeof(DES_cblock)); + DES_cbc_encrypt((unsigned char*)output, (unsigned char*)output,length,&ks1,iv1,enc); } - memcpy(*iv1,niv1,sizeof(des_cblock)); - memcpy(*iv2,niv2,sizeof(des_cblock)); + memcpy(*iv1,niv1,sizeof(DES_cblock)); + memcpy(*iv2,niv2,sizeof(DES_cblock)); } |