Lines Matching refs:cdat

903 static int cipher_test_valid_fragmentation(CIPHER_DATA *cdat)  in cipher_test_valid_fragmentation()  argument
905 return (cdat->aead == EVP_CIPH_CCM_MODE in cipher_test_valid_fragmentation()
906 || cdat->aead == EVP_CIPH_CBC_MODE in cipher_test_valid_fragmentation()
907 || (cdat->aead == -1 in cipher_test_valid_fragmentation()
908 && EVP_CIPHER_get_mode(cdat->cipher) == EVP_CIPH_STREAM_CIPHER) in cipher_test_valid_fragmentation()
909 || ((EVP_CIPHER_get_flags(cdat->cipher) & EVP_CIPH_FLAG_CTS) != 0) in cipher_test_valid_fragmentation()
910 || EVP_CIPHER_get_mode(cdat->cipher) == EVP_CIPH_SIV_MODE in cipher_test_valid_fragmentation()
911 || EVP_CIPHER_get_mode(cdat->cipher) == EVP_CIPH_GCM_SIV_MODE in cipher_test_valid_fragmentation()
912 || EVP_CIPHER_get_mode(cdat->cipher) == EVP_CIPH_XTS_MODE in cipher_test_valid_fragmentation()
913 || EVP_CIPHER_get_mode(cdat->cipher) == EVP_CIPH_WRAP_MODE) ? 0 : 1; in cipher_test_valid_fragmentation()
920 CIPHER_DATA *cdat; in cipher_test_init() local
944 if (!TEST_ptr(cdat = OPENSSL_zalloc(sizeof(*cdat)))) in cipher_test_init()
947 cdat->init_controls = sk_OPENSSL_STRING_new_null(); in cipher_test_init()
948 cdat->cipher = cipher; in cipher_test_init()
949 cdat->fetched_cipher = fetched_cipher; in cipher_test_init()
950 cdat->enc = -1; in cipher_test_init()
953 cdat->aead = m != 0 ? m : -1; in cipher_test_init()
955 cdat->aead = 0; in cipher_test_init()
957 if (data_chunk_size != 0 && !cipher_test_valid_fragmentation(cdat)) { in cipher_test_init()
960 OPENSSL_free(cdat); in cipher_test_init()
966 t->data = cdat; in cipher_test_init()
975 CIPHER_DATA *cdat = t->data; in cipher_test_cleanup() local
977 OPENSSL_free(cdat->key); in cipher_test_cleanup()
978 OPENSSL_free(cdat->iv); in cipher_test_cleanup()
979 OPENSSL_free(cdat->next_iv); in cipher_test_cleanup()
980 OPENSSL_free(cdat->ciphertext); in cipher_test_cleanup()
981 OPENSSL_free(cdat->plaintext); in cipher_test_cleanup()
983 OPENSSL_free(cdat->aad[i]); in cipher_test_cleanup()
984 OPENSSL_free(cdat->tag); in cipher_test_cleanup()
985 OPENSSL_free(cdat->mac_key); in cipher_test_cleanup()
986 EVP_CIPHER_free(cdat->fetched_cipher); in cipher_test_cleanup()
987 ctrlfree(cdat->init_controls); in cipher_test_cleanup()
993 CIPHER_DATA *cdat = t->data; in cipher_test_parse() local
997 return parse_bin(value, &cdat->key, &cdat->key_len); in cipher_test_parse()
1002 cdat->rounds = (unsigned int)i; in cipher_test_parse()
1006 return parse_bin(value, &cdat->iv, &cdat->iv_len); in cipher_test_parse()
1008 return parse_bin(value, &cdat->next_iv, &cdat->iv_len); in cipher_test_parse()
1010 return parse_bin(value, &cdat->plaintext, &cdat->plaintext_len); in cipher_test_parse()
1012 return parse_bin(value, &cdat->ciphertext, &cdat->ciphertext_len); in cipher_test_parse()
1017 cdat->key_bits = (size_t)i; in cipher_test_parse()
1020 if (cdat->aead) { in cipher_test_parse()
1024 cdat->tls_aad = tls_aad = 1; in cipher_test_parse()
1027 if (cdat->aad[i] == NULL) in cipher_test_parse()
1028 return parse_bin(value, &cdat->aad[i], &cdat->aad_len[i]); in cipher_test_parse()
1033 return parse_bin(value, &cdat->tag, &cdat->tag_len); in cipher_test_parse()
1036 cdat->tag_late = 1; in cipher_test_parse()
1038 cdat->tag_late = 0; in cipher_test_parse()
1044 return parse_bin(value, &cdat->mac_key, &cdat->mac_key_len); in cipher_test_parse()
1048 cdat->tls_version = (int)strtol(value, &endptr, 0); in cipher_test_parse()
1055 cdat->enc = 1; in cipher_test_parse()
1057 cdat->enc = 0; in cipher_test_parse()
1063 cdat->cts_mode = value; in cipher_test_parse()
1067 cdat->xts_standard = value; in cipher_test_parse()
1071 return ctrladd(cdat->init_controls, value); in cipher_test_parse()
1463 CIPHER_DATA *cdat = t->data; in cipher_test_run() local
1469 TEST_info("RUNNING TEST FOR CIPHER %s\n", EVP_CIPHER_get0_name(cdat->cipher)); in cipher_test_run()
1470 if (!cdat->key) { in cipher_test_run()
1474 if (!cdat->iv && EVP_CIPHER_get_iv_length(cdat->cipher) > 0) { in cipher_test_run()
1476 if (EVP_CIPHER_get_mode(cdat->cipher) != EVP_CIPH_WRAP_MODE) { in cipher_test_run()
1481 if (cdat->aead && cdat->tag == NULL && !cdat->tls_aad) { in cipher_test_run()
1486 if (sk_OPENSSL_STRING_num(cdat->init_controls) > 0) { in cipher_test_run()
1487 if (!ctrl2params(t, cdat->init_controls, NULL, in cipher_test_run()
1492 fragmax = (cipher_test_valid_fragmentation(cdat) == 0) ? 0 : 1; in cipher_test_run()
1521 if (cdat->enc) { in cipher_test_run()
1527 if (cdat->enc != 1) { in cipher_test_run()