Lines Matching refs:tst
150 const struct ecdsa_keygen_st *tst = &ecdsa_keygen_data[id]; in ecdsa_keygen_test() local
154 if (!TEST_ptr(pkey = EVP_PKEY_Q_keygen(libctx, NULL, "EC", tst->curve_name)) in ecdsa_keygen_test()
211 const struct ecdsa_pub_verify_st *tst = &ecdsa_pv_data[id]; in ecdsa_pub_verify_test() local
217 if (!TEST_true(ecdsa_create_pkey(&pkey, tst->curve_name, in ecdsa_pub_verify_test()
218 tst->pub, tst->pub_len, tst->pass))) in ecdsa_pub_verify_test()
221 if (tst->pass) { in ecdsa_pub_verify_test()
223 || !TEST_int_eq(EVP_PKEY_public_check(key_ctx), tst->pass)) in ecdsa_pub_verify_test()
282 const struct ecdsa_siggen_st *tst = &ecdsa_siggen_data[id]; in ecdsa_siggen_test() local
284 if (!TEST_ptr(pkey = EVP_PKEY_Q_keygen(libctx, NULL, "EC", tst->curve_name))) in ecdsa_siggen_test()
287 if (!TEST_true(sig_gen(pkey, NULL, tst->digest_alg, tst->msg, tst->msg_len, in ecdsa_siggen_test()
312 const struct ecdsa_sigver_st *tst = &ecdsa_sigver_data[id]; in ecdsa_sigver_test() local
314 if (!TEST_true(ecdsa_create_pkey(&pkey, tst->curve_name, in ecdsa_sigver_test()
315 tst->pub, tst->pub_len, 1))) in ecdsa_sigver_test()
319 || !TEST_ptr(rbn = BN_bin2bn(tst->r, tst->r_len, NULL)) in ecdsa_sigver_test()
320 || !TEST_ptr(sbn = BN_bin2bn(tst->s, tst->s_len, NULL)) in ecdsa_sigver_test()
327 || !TEST_true(EVP_DigestVerifyInit_ex(md_ctx, NULL, tst->digest_alg, in ecdsa_sigver_test()
332 tst->msg, tst->msg_len), tst->pass) in ecdsa_sigver_test()
468 const struct ecdsa_pub_verify_st *tst = &eddsa_pv_data[id]; in eddsa_pub_verify_test() local
473 if (!TEST_true(eddsa_create_pkey(&pkey, tst->curve_name, in eddsa_pub_verify_test()
474 tst->pub, tst->pub_len, 1))) in eddsa_pub_verify_test()
478 || !TEST_int_eq(EVP_PKEY_public_check(key_ctx), tst->pass)) in eddsa_pub_verify_test()
493 const struct ecdsa_pub_verify_st *tst = &eddsa_pv_data[id]; in eddsa_keygen_test() local
497 if (!TEST_ptr(pkey = EVP_PKEY_Q_keygen(libctx, NULL, tst->curve_name)) in eddsa_keygen_test()
560 const struct dsa_paramgen_st *tst = &dsa_keygen_data[id]; in dsa_keygen_test() local
564 if (!TEST_ptr(param_key = dsa_paramgen(tst->L, tst->N)) in dsa_keygen_test()
602 const struct dsa_paramgen_st *tst = &dsa_paramgen_data[id]; in dsa_paramgen_test() local
606 || !TEST_true(EVP_PKEY_CTX_set_dsa_paramgen_bits(paramgen_ctx, tst->L)) in dsa_paramgen_test()
608 tst->N))) in dsa_paramgen_test()
720 const struct dsa_pqver_st *tst = &dsa_pqver_data[id]; in dsa_pqver_test() local
723 || !TEST_true(dsa_create_pkey(¶m_key, tst->p, tst->p_len, in dsa_pqver_test()
724 tst->q, tst->q_len, NULL, 0, in dsa_pqver_test()
725 tst->seed, tst->seed_len, tst->counter, in dsa_pqver_test()
731 || !TEST_int_eq(EVP_PKEY_param_check(key_ctx), tst->pass)) in dsa_pqver_test()
789 const struct dsa_siggen_st *tst = &dsa_siggen_data[id]; in dsa_siggen_test() local
792 if (!TEST_ptr_null(pkey = dsa_keygen(tst->L, tst->N))) in dsa_siggen_test()
795 if (!TEST_ptr(pkey = dsa_keygen(tst->L, tst->N))) in dsa_siggen_test()
797 if (!TEST_true(sig_gen(pkey, NULL, tst->digest_alg, tst->msg, tst->msg_len, in dsa_siggen_test()
826 const struct dsa_sigver_st *tst = &dsa_sigver_data[id]; in dsa_sigver_test() local
829 || !TEST_true(dsa_create_pkey(&pkey, tst->p, tst->p_len, in dsa_sigver_test()
830 tst->q, tst->q_len, tst->g, tst->g_len, in dsa_sigver_test()
831 NULL, 0, 0, 0, 0, tst->pub, tst->pub_len, in dsa_sigver_test()
836 || !TEST_ptr(rbn = BN_bin2bn(tst->r, tst->r_len, NULL)) in dsa_sigver_test()
837 || !TEST_ptr(sbn = BN_bin2bn(tst->s, tst->s_len, NULL)) in dsa_sigver_test()
842 if (!TEST_ptr(md = EVP_MD_fetch(libctx, tst->digest_alg, "")) in dsa_sigver_test()
843 || !TEST_true(EVP_Digest(tst->msg, tst->msg_len, in dsa_sigver_test()
851 tst->pass)) in dsa_sigver_test()
901 const struct cipher_st *tst = &cipher_enc_data[id]; in cipher_enc_dec_test() local
904 return TEST_true(cipher_enc(tst->alg, tst->pt, tst->pt_len, in cipher_enc_dec_test()
905 tst->key, tst->key_len, in cipher_enc_dec_test()
906 tst->iv, tst->iv_len, in cipher_enc_dec_test()
907 tst->ct, tst->ct_len, enc)) in cipher_enc_dec_test()
908 && TEST_true(cipher_enc(tst->alg, tst->ct, tst->ct_len, in cipher_enc_dec_test()
909 tst->key, tst->key_len, in cipher_enc_dec_test()
910 tst->iv, tst->iv_len, in cipher_enc_dec_test()
911 tst->pt, tst->pt_len, !enc)); in cipher_enc_dec_test()
973 const struct cipher_ccm_st *tst = &aes_ccm_enc_data[id]; in aes_ccm_enc_dec_test() local
976 const size_t tag_len = tst->ct_len - tst->pt_len; in aes_ccm_enc_dec_test()
977 const size_t ct_len = tst->ct_len - tag_len; in aes_ccm_enc_dec_test()
978 const unsigned char *tag = tst->ct + ct_len; in aes_ccm_enc_dec_test()
985 return aes_ccm_enc_dec(tst->alg, tst->pt, tst->pt_len, in aes_ccm_enc_dec_test()
986 tst->key, tst->key_len, in aes_ccm_enc_dec_test()
987 tst->iv, tst->iv_len, tst->aad, tst->aad_len, in aes_ccm_enc_dec_test()
988 tst->ct, ct_len, tag, tag_len, enc, pass) in aes_ccm_enc_dec_test()
989 && aes_ccm_enc_dec(tst->alg, tst->ct, ct_len, in aes_ccm_enc_dec_test()
990 tst->key, tst->key_len, in aes_ccm_enc_dec_test()
991 tst->iv, tst->iv_len, tst->aad, tst->aad_len, in aes_ccm_enc_dec_test()
992 tst->pt, tst->pt_len, tag, tag_len, !enc, pass) in aes_ccm_enc_dec_test()
994 && aes_ccm_enc_dec(tst->alg, tst->ct, ct_len, in aes_ccm_enc_dec_test()
995 tst->key, tst->key_len, in aes_ccm_enc_dec_test()
996 tst->iv, tst->iv_len, tst->aad, tst->aad_len, in aes_ccm_enc_dec_test()
997 tst->pt, tst->pt_len, in aes_ccm_enc_dec_test()
1093 const struct cipher_gcm_st *tst = &aes_gcm_enc_data[id]; in aes_gcm_enc_dec_test() local
1098 return aes_gcm_enc_dec(tst->alg, tst->pt, tst->pt_len, in aes_gcm_enc_dec_test()
1099 tst->key, tst->key_len, in aes_gcm_enc_dec_test()
1100 tst->iv, tst->iv_len, tst->aad, tst->aad_len, in aes_gcm_enc_dec_test()
1101 tst->ct, tst->ct_len, tst->tag, tst->tag_len, in aes_gcm_enc_dec_test()
1103 && aes_gcm_enc_dec(tst->alg, tst->ct, tst->ct_len, in aes_gcm_enc_dec_test()
1104 tst->key, tst->key_len, in aes_gcm_enc_dec_test()
1105 tst->iv, tst->iv_len, tst->aad, tst->aad_len, in aes_gcm_enc_dec_test()
1106 tst->pt, tst->pt_len, tst->tag, tst->tag_len, in aes_gcm_enc_dec_test()
1109 && aes_gcm_enc_dec(tst->alg, tst->ct, tst->ct_len, in aes_gcm_enc_dec_test()
1110 tst->key, tst->key_len, in aes_gcm_enc_dec_test()
1111 tst->iv, tst->iv_len, tst->aad, tst->aad_len, in aes_gcm_enc_dec_test()
1112 tst->pt, tst->pt_len, tst->aad, tst->tag_len, in aes_gcm_enc_dec_test()
1118 const struct cipher_gcm_st *tst = &aes_gcm_enc_data[0]; in aes_gcm_gen_iv_internal_test() local
1125 return aes_gcm_enc_dec(tst->alg, tst->pt, tst->pt_len, in aes_gcm_gen_iv_internal_test()
1126 tst->key, tst->key_len, in aes_gcm_gen_iv_internal_test()
1127 NULL, tst->iv_len, tst->aad, tst->aad_len, in aes_gcm_gen_iv_internal_test()
1128 NULL, tst->ct_len, NULL, tst->tag_len, in aes_gcm_gen_iv_internal_test()
1130 && aes_gcm_enc_dec(tst->alg, out, out_len, in aes_gcm_gen_iv_internal_test()
1131 tst->key, tst->key_len, in aes_gcm_gen_iv_internal_test()
1132 iv, tst->iv_len, tst->aad, tst->aad_len, in aes_gcm_gen_iv_internal_test()
1133 tst->pt, tst->pt_len, out + out_len, tst->tag_len, in aes_gcm_gen_iv_internal_test()
1195 const struct dh_safe_prime_keygen_st *tst = &dh_safe_prime_keygen_data[id]; in dh_safe_prime_keygen_test() local
1198 (char *)tst->group_name, 0); in dh_safe_prime_keygen_test()
1228 const struct dh_safe_prime_keyver_st *tst = &dh_safe_prime_keyver_data[id]; in dh_safe_prime_keyver_test() local
1231 || !TEST_true(dh_create_pkey(&pkey, tst->group_name, in dh_safe_prime_keyver_test()
1232 tst->pub, tst->pub_len, in dh_safe_prime_keyver_test()
1233 tst->priv, tst->priv_len, bn_ctx, 1)) in dh_safe_prime_keyver_test()
1235 || !TEST_int_eq(EVP_PKEY_check(key_ctx), tst->pass)) in dh_safe_prime_keyver_test()
1311 const struct rsa_keygen_st *tst = &rsa_keygen_data[id]; in rsa_keygen_test() local
1314 || !TEST_ptr(xp1_bn = BN_bin2bn(tst->xp1, tst->xp1_len, NULL)) in rsa_keygen_test()
1315 || !TEST_ptr(xp2_bn = BN_bin2bn(tst->xp2, tst->xp2_len, NULL)) in rsa_keygen_test()
1316 || !TEST_ptr(xp_bn = BN_bin2bn(tst->xp, tst->xp_len, NULL)) in rsa_keygen_test()
1317 || !TEST_ptr(xq1_bn = BN_bin2bn(tst->xq1, tst->xq1_len, NULL)) in rsa_keygen_test()
1318 || !TEST_ptr(xq2_bn = BN_bin2bn(tst->xq2, tst->xq2_len, NULL)) in rsa_keygen_test()
1319 || !TEST_ptr(xq_bn = BN_bin2bn(tst->xq, tst->xq_len, NULL)) in rsa_keygen_test()
1336 || !TEST_ptr(e_bn = BN_bin2bn(tst->e, tst->e_len, NULL)) in rsa_keygen_test()
1339 || !TEST_int_gt(EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, tst->mod), 0) in rsa_keygen_test()
1360 if (!TEST_mem_eq(tst->p1, tst->p1_len, p1, p1_len) in rsa_keygen_test()
1361 || !TEST_mem_eq(tst->p2, tst->p2_len, p2, p2_len) in rsa_keygen_test()
1362 || !TEST_mem_eq(tst->p, tst->p_len, p, p_len) in rsa_keygen_test()
1363 || !TEST_mem_eq(tst->q1, tst->q1_len, q1, q1_len) in rsa_keygen_test()
1364 || !TEST_mem_eq(tst->q2, tst->q2_len, q2, q2_len) in rsa_keygen_test()
1365 || !TEST_mem_eq(tst->q, tst->q_len, q, q_len) in rsa_keygen_test()
1366 || !TEST_mem_eq(tst->n, tst->n_len, n, n_len) in rsa_keygen_test()
1367 || !TEST_mem_eq(tst->d, tst->d_len, d, d_len)) in rsa_keygen_test()
1409 const struct rsa_siggen_st *tst = &rsa_siggen_data[id]; in rsa_siggen_test() local
1410 int salt_len = tst->pss_salt_len; in rsa_siggen_test()
1413 && (strcmp(tst->sig_pad_mode, OSSL_PKEY_RSA_PAD_MODE_X931) == 0)) in rsa_siggen_test()
1416 TEST_note("RSA %s signature generation", tst->sig_pad_mode); in rsa_siggen_test()
1420 (char *)tst->sig_pad_mode, 0); in rsa_siggen_test()
1422 (char *)tst->digest_alg, 0); in rsa_siggen_test()
1428 if (!TEST_ptr(pkey = EVP_PKEY_Q_keygen(libctx, NULL, "RSA", tst->mod)) in rsa_siggen_test()
1431 || !TEST_true(sig_gen(pkey, params, tst->digest_alg, in rsa_siggen_test()
1432 tst->msg, tst->msg_len, in rsa_siggen_test()
1455 const struct rsa_sigver_st *tst = &rsa_sigver_data[id]; in rsa_sigver_test() local
1456 int salt_len = tst->pss_salt_len; in rsa_sigver_test()
1458 TEST_note("RSA %s Signature Verify : expected to %s ", tst->sig_pad_mode, in rsa_sigver_test()
1459 tst->pass == PASS ? "pass" : "fail"); in rsa_sigver_test()
1463 (char *)tst->sig_pad_mode, 0); in rsa_sigver_test()
1465 (char *)tst->digest_alg, 0); in rsa_sigver_test()
1472 || !TEST_true(rsa_create_pkey(&pkey, tst->n, tst->n_len, in rsa_sigver_test()
1473 tst->e, tst->e_len, NULL, 0, bn_ctx)) in rsa_sigver_test()
1476 tst->digest_alg, libctx, NULL, in rsa_sigver_test()
1480 || !TEST_int_eq(EVP_DigestVerify(md_ctx, tst->sig, tst->sig_len, in rsa_sigver_test()
1481 tst->msg, tst->msg_len), tst->pass) in rsa_sigver_test()
1505 const struct rsa_decrypt_prim_st *tst = &rsa_decrypt_prim_data[id]; in rsa_decryption_primitive_test() local
1517 if (EVP_PKEY_decrypt(ctx, pt, &pt_len, tst->ct, tst->ct_len) <= 0) in rsa_decryption_primitive_test()
1571 const struct drbg_st *tst = &drbg_data[id]; in drbg_test() local
1587 if (!TEST_ptr(rand = EVP_RAND_fetch(libctx, tst->drbg_name, "")) in drbg_test()
1593 (int *)&tst->use_df); in drbg_test()
1595 (char *)tst->cipher, 0); in drbg_test()
1602 (void *)tst->entropy_input, in drbg_test()
1603 tst->entropy_input_len); in drbg_test()
1605 (void *)tst->nonce, in drbg_test()
1606 tst->nonce_len); in drbg_test()
1632 tst->returned_bits, tst->returned_bits_len)) in drbg_test()