X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fdes%2Fdestest.c;h=14f4dfe77c01dd5fa9ad69b112efccbc5d3286eb;hp=62cc7a57d1e8bc759060efc8ad84dbd572bad533;hb=9ccc00ef6ea65567622e40c49aca43f2c6d79cdb;hpb=35a1cc90bc1795e8893c11e442790ee7f659fffb diff --git a/crypto/des/destest.c b/crypto/des/destest.c index 62cc7a57d1..14f4dfe77c 100644 --- a/crypto/des/destest.c +++ b/crypto/des/destest.c @@ -345,12 +345,7 @@ static unsigned char ofb_cipher[24] = { 0x35, 0xf2, 0x4a, 0x24, 0x2e, 0xeb, 0x3d, 0x3f, 0x3d, 0x6d, 0x5b, 0xe3, 0x25, 0x5a, 0xf8, 0xc3 }; - -# if 0 -static DES_LONG cbc_cksum_ret = 0xB462FEF7L; -# else static DES_LONG cbc_cksum_ret = 0xF7FE62B4L; -# endif static unsigned char cbc_cksum_data[8] = { 0x1D, 0x26, 0x93, 0x97, 0xf7, 0xfe, 0x62, 0xb4 }; @@ -362,7 +357,7 @@ int main(int argc, char *argv[]) { int j, err = 0; unsigned int i; - des_cblock in, out, outin, iv3, iv2; + des_cblock in, out, outin, iv3; des_key_schedule ks, ks2, ks3; unsigned char cbc_in[40]; unsigned char cbc_out[40]; @@ -372,56 +367,6 @@ int main(int argc, char *argv[]) int num; char *str; -# ifndef OPENSSL_NO_DESCBCM - printf("Doing cbcm\n"); - if ((j = DES_set_key_checked(&cbc_key, &ks)) != 0) { - printf("Key error %d\n", j); - err = 1; - } - if ((j = DES_set_key_checked(&cbc2_key, &ks2)) != 0) { - printf("Key error %d\n", j); - err = 1; - } - if ((j = DES_set_key_checked(&cbc3_key, &ks3)) != 0) { - printf("Key error %d\n", j); - err = 1; - } - memset(cbc_out, 0, 40); - memset(cbc_in, 0, 40); - i = strlen((char *)cbc_data) + 1; - /* i=((i+7)/8)*8; */ - memcpy(iv3, cbc_iv, sizeof(cbc_iv)); - memset(iv2, '\0', sizeof iv2); - - DES_ede3_cbcm_encrypt(cbc_data, cbc_out, 16L, &ks, &ks2, &ks3, &iv3, &iv2, - DES_ENCRYPT); - DES_ede3_cbcm_encrypt(&cbc_data[16], &cbc_out[16], i - 16, &ks, &ks2, - &ks3, &iv3, &iv2, DES_ENCRYPT); -/*- if (memcmp(cbc_out,cbc3_ok, - (unsigned int)(strlen((char *)cbc_data)+1+7)/8*8) != 0) - { - printf("des_ede3_cbc_encrypt encrypt error\n"); - err=1; - } -*/ - memcpy(iv3, cbc_iv, sizeof(cbc_iv)); - memset(iv2, '\0', sizeof iv2); - DES_ede3_cbcm_encrypt(cbc_out, cbc_in, i, &ks, &ks2, &ks3, &iv3, &iv2, - DES_DECRYPT); - if (memcmp(cbc_in, cbc_data, strlen((char *)cbc_data) + 1) != 0) { - unsigned int n; - - printf("des_ede3_cbcm_encrypt decrypt error\n"); - for (n = 0; n < i; ++n) - printf(" %02x", cbc_data[n]); - printf("\n"); - for (n = 0; n < i; ++n) - printf(" %02x", cbc_in[n]); - printf("\n"); - err = 1; - } -# endif - printf("Doing ecb\n"); for (i = 0; i < NUM_TESTS; i++) { DES_set_key_unchecked(&key_data[i], &ks);