diff options
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)); } |