Lines Matching refs:test_case
85 const cipher_test_case_t *test_case = ct->test_data; in cipher_type_self_test() local
100 if (test_case == NULL) in cipher_type_self_test()
107 while (test_case != NULL) { in cipher_type_self_test()
110 status = cipher_type_alloc(ct, &c, test_case->key_length_octets); in cipher_type_self_test()
120 status = cipher_init(c, test_case->key, direction_encrypt); in cipher_type_self_test()
127 if (test_case->ciphertext_length_octets > SELF_TEST_BUF_OCTETS) { in cipher_type_self_test()
131 for (i=0; i < test_case->plaintext_length_octets; i++) in cipher_type_self_test()
132 buffer[i] = test_case->plaintext[i]; in cipher_type_self_test()
136 test_case->plaintext_length_octets)); in cipher_type_self_test()
139 status = cipher_set_iv(c, test_case->idx); in cipher_type_self_test()
146 len = test_case->plaintext_length_octets; in cipher_type_self_test()
155 test_case->ciphertext_length_octets)); in cipher_type_self_test()
158 if (len != test_case->ciphertext_length_octets) in cipher_type_self_test()
161 for (i=0; i < test_case->ciphertext_length_octets; i++) in cipher_type_self_test()
162 if (buffer[i] != test_case->ciphertext[i]) { in cipher_type_self_test()
172 2*test_case->plaintext_length_octets)); in cipher_type_self_test()
174 octet_string_hex_string(test_case->ciphertext, in cipher_type_self_test()
175 2*test_case->plaintext_length_octets)); in cipher_type_self_test()
187 status = cipher_init(c, test_case->key, direction_decrypt); in cipher_type_self_test()
194 if (test_case->ciphertext_length_octets > SELF_TEST_BUF_OCTETS) { in cipher_type_self_test()
198 for (i=0; i < test_case->ciphertext_length_octets; i++) in cipher_type_self_test()
199 buffer[i] = test_case->ciphertext[i]; in cipher_type_self_test()
203 test_case->plaintext_length_octets)); in cipher_type_self_test()
206 status = cipher_set_iv(c, test_case->idx); in cipher_type_self_test()
213 len = test_case->ciphertext_length_octets; in cipher_type_self_test()
222 test_case->plaintext_length_octets)); in cipher_type_self_test()
225 if (len != test_case->plaintext_length_octets) in cipher_type_self_test()
228 for (i=0; i < test_case->plaintext_length_octets; i++) in cipher_type_self_test()
229 if (buffer[i] != test_case->plaintext[i]) { in cipher_type_self_test()
238 2*test_case->plaintext_length_octets)); in cipher_type_self_test()
240 octet_string_hex_string(test_case->plaintext, in cipher_type_self_test()
241 2*test_case->plaintext_length_octets)); in cipher_type_self_test()
256 test_case = test_case->next_test_case; in cipher_type_self_test()
263 test_case = ct->test_data; in cipher_type_self_test()
264 status = cipher_type_alloc(ct, &c, test_case->key_length_octets); in cipher_type_self_test()
290 if (test_case->key_length_octets > MAX_KEY_LEN) in cipher_type_self_test()
292 status = rand_source_get_octet_string(key, test_case->key_length_octets); in cipher_type_self_test()
307 status = cipher_set_iv(c, test_case->idx); in cipher_type_self_test()
332 status = cipher_set_iv(c, test_case->idx); in cipher_type_self_test()