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