From: Jonathan L. <jon...@us...> - 2010-05-20 22:36:27
|
Update of /cvsroot/srtp/srtp/crypto/cipher In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv6520/cipher Modified Files: cipher.c Log Message: Add cipher_type_test, like cipher_type_self_test but with an external set of test cases. Index: cipher.c =================================================================== RCS file: /cvsroot/srtp/srtp/crypto/cipher/cipher.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** cipher.c 15 May 2010 04:58:04 -0000 1.8 --- cipher.c 20 May 2010 22:36:19 -0000 1.9 *************** *** 72,77 **** /* ! * cipher_type_self_test(ct) tests a cipher of type ct against test cases ! * provided in an array of values of key, salt, xtd_seq_num_t, * plaintext, and ciphertext that is known to be good */ --- 72,77 ---- /* ! * cipher_type_test(ct, test_data) tests a cipher of type ct against ! * test cases provided in a list test_data of values of key, salt, iv, * plaintext, and ciphertext that is known to be good */ *************** *** 82,87 **** err_status_t ! cipher_type_self_test(const cipher_type_t *ct) { ! const cipher_test_case_t *test_case = ct->test_data; cipher_t *c; err_status_t status; --- 82,87 ---- err_status_t ! cipher_type_test(const cipher_type_t *ct, const cipher_test_case_t *test_data) { ! const cipher_test_case_t *test_case = test_data; cipher_t *c; err_status_t status; *************** *** 261,265 **** /* allocate cipher, using paramaters from the first test case */ ! test_case = ct->test_data; status = cipher_type_alloc(ct, &c, test_case->key_length_octets); if (status) --- 261,265 ---- /* allocate cipher, using paramaters from the first test case */ ! test_case = test_data; status = cipher_type_alloc(ct, &c, test_case->key_length_octets); if (status) *************** *** 369,372 **** --- 369,382 ---- + /* + * cipher_type_self_test(ct) performs cipher_type_test on ct's internal + * list of test data. + */ + + err_status_t + cipher_type_self_test(const cipher_type_t *ct) { + return cipher_type_test(ct, ct->test_data); + } + /* * cipher_bits_per_second(c, l, t) computes (an estimate of) the |