• Home
  • Raw
  • Download

Lines Matching refs:tst

122     const struct ecdsa_keygen_st *tst = &ecdsa_keygen_data[id];  in ecdsa_keygen_test()  local
126 if (!TEST_ptr(pkey = EVP_PKEY_Q_keygen(libctx, NULL, "EC", tst->curve_name)) in ecdsa_keygen_test()
183 const struct ecdsa_pub_verify_st *tst = &ecdsa_pv_data[id]; in ecdsa_pub_verify_test() local
189 if (!TEST_true(ecdsa_create_pkey(&pkey, tst->curve_name, in ecdsa_pub_verify_test()
190 tst->pub, tst->pub_len, tst->pass))) in ecdsa_pub_verify_test()
193 if (tst->pass) { in ecdsa_pub_verify_test()
195 || !TEST_int_eq(EVP_PKEY_public_check(key_ctx), tst->pass)) in ecdsa_pub_verify_test()
254 const struct ecdsa_siggen_st *tst = &ecdsa_siggen_data[id]; in ecdsa_siggen_test() local
256 if (!TEST_ptr(pkey = EVP_PKEY_Q_keygen(libctx, NULL, "EC", tst->curve_name))) in ecdsa_siggen_test()
259 if (!TEST_true(sig_gen(pkey, NULL, tst->digest_alg, tst->msg, tst->msg_len, in ecdsa_siggen_test()
283 const struct ecdsa_sigver_st *tst = &ecdsa_sigver_data[id]; in ecdsa_sigver_test() local
285 if (!TEST_true(ecdsa_create_pkey(&pkey, tst->curve_name, in ecdsa_sigver_test()
286 tst->pub, tst->pub_len, 1))) in ecdsa_sigver_test()
290 || !TEST_ptr(rbn = BN_bin2bn(tst->r, tst->r_len, NULL)) in ecdsa_sigver_test()
291 || !TEST_ptr(sbn = BN_bin2bn(tst->s, tst->s_len, NULL)) in ecdsa_sigver_test()
298 && TEST_true(EVP_DigestVerifyInit_ex(md_ctx, NULL, tst->digest_alg, in ecdsa_sigver_test()
301 tst->msg, tst->msg_len), tst->pass)); in ecdsa_sigver_test()
376 const struct dsa_paramgen_st *tst = &dsa_keygen_data[id]; in dsa_keygen_test() local
378 if (!TEST_ptr(param_key = dsa_paramgen(tst->L, tst->N)) in dsa_keygen_test()
416 const struct dsa_paramgen_st *tst = &dsa_paramgen_data[id]; in dsa_paramgen_test() local
420 || !TEST_true(EVP_PKEY_CTX_set_dsa_paramgen_bits(paramgen_ctx, tst->L)) in dsa_paramgen_test()
421 || !TEST_true(EVP_PKEY_CTX_set_dsa_paramgen_q_bits(paramgen_ctx, tst->N)) in dsa_paramgen_test()
526 const struct dsa_pqver_st *tst = &dsa_pqver_data[id]; in dsa_pqver_test() local
529 || !TEST_true(dsa_create_pkey(&param_key, tst->p, tst->p_len, in dsa_pqver_test()
530 tst->q, tst->q_len, NULL, 0, in dsa_pqver_test()
531 tst->seed, tst->seed_len, tst->counter, in dsa_pqver_test()
537 || !TEST_int_eq(EVP_PKEY_param_check(key_ctx), tst->pass)) in dsa_pqver_test()
595 const struct dsa_siggen_st *tst = &dsa_siggen_data[id]; in dsa_siggen_test() local
597 if (!TEST_ptr(pkey = dsa_keygen(tst->L, tst->N))) in dsa_siggen_test()
600 if (!TEST_true(sig_gen(pkey, NULL, tst->digest_alg, tst->msg, tst->msg_len, in dsa_siggen_test()
628 const struct dsa_sigver_st *tst = &dsa_sigver_data[id]; in dsa_sigver_test() local
631 || !TEST_true(dsa_create_pkey(&pkey, tst->p, tst->p_len, in dsa_sigver_test()
632 tst->q, tst->q_len, tst->g, tst->g_len, in dsa_sigver_test()
633 NULL, 0, 0, 0, 0, tst->pub, tst->pub_len, in dsa_sigver_test()
638 || !TEST_ptr(rbn = BN_bin2bn(tst->r, tst->r_len, NULL)) in dsa_sigver_test()
639 || !TEST_ptr(sbn = BN_bin2bn(tst->s, tst->s_len, NULL)) in dsa_sigver_test()
644 if (!TEST_ptr(md = EVP_MD_fetch(libctx, tst->digest_alg, "")) in dsa_sigver_test()
645 || !TEST_true(EVP_Digest(tst->msg, tst->msg_len, in dsa_sigver_test()
653 tst->pass)) in dsa_sigver_test()
703 const struct cipher_st *tst = &cipher_enc_data[id]; in cipher_enc_dec_test() local
706 return TEST_true(cipher_enc(tst->alg, tst->pt, tst->pt_len, in cipher_enc_dec_test()
707 tst->key, tst->key_len, in cipher_enc_dec_test()
708 tst->iv, tst->iv_len, in cipher_enc_dec_test()
709 tst->ct, tst->ct_len, enc)) in cipher_enc_dec_test()
710 && TEST_true(cipher_enc(tst->alg, tst->ct, tst->ct_len, in cipher_enc_dec_test()
711 tst->key, tst->key_len, in cipher_enc_dec_test()
712 tst->iv, tst->iv_len, in cipher_enc_dec_test()
713 tst->pt, tst->pt_len, !enc)); in cipher_enc_dec_test()
775 const struct cipher_ccm_st *tst = &aes_ccm_enc_data[id]; in aes_ccm_enc_dec_test() local
778 const size_t tag_len = tst->ct_len - tst->pt_len; in aes_ccm_enc_dec_test()
779 const size_t ct_len = tst->ct_len - tag_len; in aes_ccm_enc_dec_test()
780 const unsigned char *tag = tst->ct + ct_len; in aes_ccm_enc_dec_test()
787 return aes_ccm_enc_dec(tst->alg, tst->pt, tst->pt_len, in aes_ccm_enc_dec_test()
788 tst->key, tst->key_len, in aes_ccm_enc_dec_test()
789 tst->iv, tst->iv_len, tst->aad, tst->aad_len, in aes_ccm_enc_dec_test()
790 tst->ct, ct_len, tag, tag_len, enc, pass) in aes_ccm_enc_dec_test()
791 && aes_ccm_enc_dec(tst->alg, tst->ct, ct_len, in aes_ccm_enc_dec_test()
792 tst->key, tst->key_len, in aes_ccm_enc_dec_test()
793 tst->iv, tst->iv_len, tst->aad, tst->aad_len, in aes_ccm_enc_dec_test()
794 tst->pt, tst->pt_len, tag, tag_len, !enc, pass) in aes_ccm_enc_dec_test()
796 && aes_ccm_enc_dec(tst->alg, tst->ct, ct_len, in aes_ccm_enc_dec_test()
797 tst->key, tst->key_len, in aes_ccm_enc_dec_test()
798 tst->iv, tst->iv_len, tst->aad, tst->aad_len, in aes_ccm_enc_dec_test()
799 tst->pt, tst->pt_len, in aes_ccm_enc_dec_test()
871 const struct cipher_gcm_st *tst = &aes_gcm_enc_data[id]; in aes_gcm_enc_dec_test() local
875 return aes_gcm_enc_dec(tst->alg, tst->pt, tst->pt_len, in aes_gcm_enc_dec_test()
876 tst->key, tst->key_len, in aes_gcm_enc_dec_test()
877 tst->iv, tst->iv_len, tst->aad, tst->aad_len, in aes_gcm_enc_dec_test()
878 tst->ct, tst->ct_len, tst->tag, tst->tag_len, in aes_gcm_enc_dec_test()
880 && aes_gcm_enc_dec(tst->alg, tst->ct, tst->ct_len, in aes_gcm_enc_dec_test()
881 tst->key, tst->key_len, in aes_gcm_enc_dec_test()
882 tst->iv, tst->iv_len, tst->aad, tst->aad_len, in aes_gcm_enc_dec_test()
883 tst->pt, tst->pt_len, tst->tag, tst->tag_len, in aes_gcm_enc_dec_test()
886 && aes_gcm_enc_dec(tst->alg, tst->ct, tst->ct_len, in aes_gcm_enc_dec_test()
887 tst->key, tst->key_len, in aes_gcm_enc_dec_test()
888 tst->iv, tst->iv_len, tst->aad, tst->aad_len, in aes_gcm_enc_dec_test()
889 tst->pt, tst->pt_len, tst->aad, tst->tag_len, in aes_gcm_enc_dec_test()
951 const struct dh_safe_prime_keygen_st *tst = &dh_safe_prime_keygen_data[id]; in dh_safe_prime_keygen_test() local
954 (char *)tst->group_name, 0); in dh_safe_prime_keygen_test()
984 const struct dh_safe_prime_keyver_st *tst = &dh_safe_prime_keyver_data[id]; in dh_safe_prime_keyver_test() local
987 || !TEST_true(dh_create_pkey(&pkey, tst->group_name, in dh_safe_prime_keyver_test()
988 tst->pub, tst->pub_len, in dh_safe_prime_keyver_test()
989 tst->priv, tst->priv_len, bn_ctx, 1)) in dh_safe_prime_keyver_test()
991 || !TEST_int_eq(EVP_PKEY_check(key_ctx), tst->pass)) in dh_safe_prime_keyver_test()
1067 const struct rsa_keygen_st *tst = &rsa_keygen_data[id]; in rsa_keygen_test() local
1070 || !TEST_ptr(xp1_bn = BN_bin2bn(tst->xp1, tst->xp1_len, NULL)) in rsa_keygen_test()
1071 || !TEST_ptr(xp2_bn = BN_bin2bn(tst->xp2, tst->xp2_len, NULL)) in rsa_keygen_test()
1072 || !TEST_ptr(xp_bn = BN_bin2bn(tst->xp, tst->xp_len, NULL)) in rsa_keygen_test()
1073 || !TEST_ptr(xq1_bn = BN_bin2bn(tst->xq1, tst->xq1_len, NULL)) in rsa_keygen_test()
1074 || !TEST_ptr(xq2_bn = BN_bin2bn(tst->xq2, tst->xq2_len, NULL)) in rsa_keygen_test()
1075 || !TEST_ptr(xq_bn = BN_bin2bn(tst->xq, tst->xq_len, NULL)) in rsa_keygen_test()
1092 || !TEST_ptr(e_bn = BN_bin2bn(tst->e, tst->e_len, NULL)) in rsa_keygen_test()
1095 || !TEST_int_gt(EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, tst->mod), 0) in rsa_keygen_test()
1116 if (!TEST_mem_eq(tst->p1, tst->p1_len, p1, p1_len) in rsa_keygen_test()
1117 || !TEST_mem_eq(tst->p2, tst->p2_len, p2, p2_len) in rsa_keygen_test()
1118 || !TEST_mem_eq(tst->p, tst->p_len, p, p_len) in rsa_keygen_test()
1119 || !TEST_mem_eq(tst->q1, tst->q1_len, q1, q1_len) in rsa_keygen_test()
1120 || !TEST_mem_eq(tst->q2, tst->q2_len, q2, q2_len) in rsa_keygen_test()
1121 || !TEST_mem_eq(tst->q, tst->q_len, q, q_len) in rsa_keygen_test()
1122 || !TEST_mem_eq(tst->n, tst->n_len, n, n_len) in rsa_keygen_test()
1123 || !TEST_mem_eq(tst->d, tst->d_len, d, d_len)) in rsa_keygen_test()
1165 const struct rsa_siggen_st *tst = &rsa_siggen_data[id]; in rsa_siggen_test() local
1166 int salt_len = tst->pss_salt_len; in rsa_siggen_test()
1168 TEST_note("RSA %s signature generation", tst->sig_pad_mode); in rsa_siggen_test()
1172 (char *)tst->sig_pad_mode, 0); in rsa_siggen_test()
1174 (char *)tst->digest_alg, 0); in rsa_siggen_test()
1180 if (!TEST_ptr(pkey = EVP_PKEY_Q_keygen(libctx, NULL, "RSA", tst->mod)) in rsa_siggen_test()
1183 || !TEST_true(sig_gen(pkey, params, tst->digest_alg, in rsa_siggen_test()
1184 tst->msg, tst->msg_len, in rsa_siggen_test()
1207 const struct rsa_sigver_st *tst = &rsa_sigver_data[id]; in rsa_sigver_test() local
1208 int salt_len = tst->pss_salt_len; in rsa_sigver_test()
1210 TEST_note("RSA %s Signature Verify : expected to %s ", tst->sig_pad_mode, in rsa_sigver_test()
1211 tst->pass == PASS ? "pass" : "fail"); in rsa_sigver_test()
1215 (char *)tst->sig_pad_mode, 0); in rsa_sigver_test()
1217 (char *)tst->digest_alg, 0); in rsa_sigver_test()
1224 || !TEST_true(rsa_create_pkey(&pkey, tst->n, tst->n_len, in rsa_sigver_test()
1225 tst->e, tst->e_len, NULL, 0, bn_ctx)) in rsa_sigver_test()
1228 tst->digest_alg, libctx, NULL, in rsa_sigver_test()
1231 || !TEST_int_eq(EVP_DigestVerify(md_ctx, tst->sig, tst->sig_len, in rsa_sigver_test()
1232 tst->msg, tst->msg_len), tst->pass)) in rsa_sigver_test()
1252 const struct rsa_decrypt_prim_st *tst = &rsa_decrypt_prim_data[id]; in rsa_decryption_primitive_test() local
1264 if (EVP_PKEY_decrypt(ctx, pt, &pt_len, tst->ct, tst->ct_len) <= 0) in rsa_decryption_primitive_test()
1318 const struct drbg_st *tst = &drbg_data[id]; in drbg_test() local
1334 if (!TEST_ptr(rand = EVP_RAND_fetch(libctx, tst->drbg_name, "")) in drbg_test()
1340 (int *)&tst->use_df); in drbg_test()
1342 (char *)tst->cipher, 0); in drbg_test()
1349 (void *)tst->entropy_input, in drbg_test()
1350 tst->entropy_input_len); in drbg_test()
1352 (void *)tst->nonce, in drbg_test()
1353 tst->nonce_len); in drbg_test()
1379 tst->returned_bits, tst->returned_bits_len)) in drbg_test()