Lines Matching refs:tv

218 static int test_omac1_vector(const struct omac1_test_vector *tv,  in test_omac1_vector()  argument
230 if (omac1_aes_128(tv->k, tv->msg, tv->msg_len, result) || in test_omac1_vector()
231 os_memcmp(result, tv->tag, 16) != 0) { in test_omac1_vector()
236 if (tv->msg_len > 1) { in test_omac1_vector()
238 addr[0] = tv->msg; in test_omac1_vector()
240 addr[1] = tv->msg + 1; in test_omac1_vector()
241 len[1] = tv->msg_len - 1; in test_omac1_vector()
243 if (omac1_aes_128_vector(tv->k, 2, addr, len, result) || in test_omac1_vector()
244 os_memcmp(result, tv->tag, 16) != 0) { in test_omac1_vector()
251 addr[0] = tv->msg; in test_omac1_vector()
252 len[0] = tv->msg_len - 2; in test_omac1_vector()
253 addr[1] = tv->msg + tv->msg_len - 2; in test_omac1_vector()
255 addr[2] = tv->msg + tv->msg_len - 1; in test_omac1_vector()
258 if (omac1_aes_128_vector(tv->k, 3, addr, len, result) || in test_omac1_vector()
259 os_memcmp(result, tv->tag, 16) != 0) { in test_omac1_vector()
388 struct cbc_test_vector *tv = &vectors[i]; in test_cbc() local
390 buf = os_malloc(tv->len); in test_cbc()
396 os_memcpy(buf, tv->plain, tv->len); in test_cbc()
397 if (aes_128_cbc_encrypt(tv->key, tv->iv, buf, tv->len) || in test_cbc()
398 os_memcmp(buf, tv->cipher, tv->len) != 0) { in test_cbc()
403 os_memcpy(buf, tv->cipher, tv->len); in test_cbc()
404 if (aes_128_cbc_decrypt(tv->key, tv->iv, buf, tv->len) || in test_cbc()
405 os_memcmp(buf, tv->plain, tv->len) != 0) { in test_cbc()
478 struct ecb_test_vector *tv = &vectors[i]; in test_ecb() local
480 if (hexstr2bin(tv->key, key, sizeof(key)) || in test_ecb()
481 hexstr2bin(tv->plaintext, plain, sizeof(plain)) || in test_ecb()
482 hexstr2bin(tv->ciphertext, cipher, sizeof(cipher))) { in test_ecb()