test/crypto.c

branch
ucx-3.1
changeset 816
839fefbdedc7
parent 747
efbd59642577
equal deleted inserted replaced
815:1f40ca07ae1b 816:839fefbdedc7
234 for(int k=0;k<16;k++) { 234 for(int k=0;k<16;k++) {
235 for(int i=0;i<20;i++) { 235 for(int i=0;i<20;i++) {
236 char *aes128 = util_encrypt_str_k(sn, strings[i], &keys128[k]); 236 char *aes128 = util_encrypt_str_k(sn, strings[i], &keys128[k]);
237 char *aes256 = util_encrypt_str_k(sn, strings[i], &keys256[k]); 237 char *aes256 = util_encrypt_str_k(sn, strings[i], &keys256[k]);
238 238
239 char *d1 = util_decrypt_str_k(sn, aes128, &keys128[k]); 239 char *dec1 = util_decrypt_str_k(sn, aes128, &keys128[k]);
240 char *d2 = util_decrypt_str_k(sn, aes256, &keys256[k]); 240 char *dec2 = util_decrypt_str_k(sn, aes256, &keys256[k]);
241 241
242 UCX_TEST_ASSERT(!strcmp(d1, strings[i]), "aes128 encrypt failed"); 242 UCX_TEST_ASSERT(!strcmp(dec1, strings[i]), "aes128 encrypt failed");
243 UCX_TEST_ASSERT(!strcmp(d2, strings[i]), "aes256 encrypt failed"); 243 UCX_TEST_ASSERT(!strcmp(dec2, strings[i]), "aes256 encrypt failed");
244 } 244 }
245 } 245 }
246 246
247 UCX_TEST_END; 247 UCX_TEST_END;
248 } 248 }

mercurial