destest.c (120631) | destest.c (142425) |
---|---|
1/* crypto/des/destest.c */ 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 * All rights reserved. 4 * 5 * This package is an SSL implementation written 6 * by Eric Young (eay@cryptsoft.com). 7 * The implementation was written so as to conform with Netscapes SSL. 8 * --- 425 unchanged lines hidden (view full) --- 434 for (i=0; i<(NUM_TESTS-2); i++) 435 { 436 DES_set_key_unchecked(&key_data[i],&ks); 437 DES_set_key_unchecked(&key_data[i+1],&ks2); 438 DES_set_key_unchecked(&key_data[i+2],&ks3); 439 memcpy(in,plain_data[i],8); 440 memset(out,0,8); 441 memset(outin,0,8); | 1/* crypto/des/destest.c */ 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 * All rights reserved. 4 * 5 * This package is an SSL implementation written 6 * by Eric Young (eay@cryptsoft.com). 7 * The implementation was written so as to conform with Netscapes SSL. 8 * --- 425 unchanged lines hidden (view full) --- 434 for (i=0; i<(NUM_TESTS-2); i++) 435 { 436 DES_set_key_unchecked(&key_data[i],&ks); 437 DES_set_key_unchecked(&key_data[i+1],&ks2); 438 DES_set_key_unchecked(&key_data[i+2],&ks3); 439 memcpy(in,plain_data[i],8); 440 memset(out,0,8); 441 memset(outin,0,8); |
442 des_ecb2_encrypt(&in,&out,ks,ks2,DES_ENCRYPT); 443 des_ecb2_encrypt(&out,&outin,ks,ks2,DES_DECRYPT); | 442 des_ecb2_encrypt(in,out,ks,ks2,DES_ENCRYPT); 443 des_ecb2_encrypt(out,outin,ks,ks2,DES_DECRYPT); |
444 445 if (memcmp(out,cipher_ecb2[i],8) != 0) 446 { 447 printf("Encryption error %2d\nk=%s p=%s o=%s act=%s\n", 448 i+1,pt(key_data[i]),pt(in),pt(cipher_ecb2[i]), 449 pt(out)); 450 err=1; 451 } --- 497 unchanged lines hidden --- | 444 445 if (memcmp(out,cipher_ecb2[i],8) != 0) 446 { 447 printf("Encryption error %2d\nk=%s p=%s o=%s act=%s\n", 448 i+1,pt(key_data[i]),pt(in),pt(cipher_ecb2[i]), 449 pt(out)); 450 err=1; 451 } --- 497 unchanged lines hidden --- |