Lines Matching refs:ecx
289 ECX_KEY *ecx = key; in ecx_get_params() local
302 && (ecx->type == ECX_KEY_TYPE_X25519 in ecx_get_params()
303 || ecx->type == ECX_KEY_TYPE_X448)) { in ecx_get_params()
304 if (!OSSL_PARAM_set_octet_string(p, ecx->pubkey, ecx->keylen)) in ecx_get_params()
318 return key_to_params(ecx, NULL, params, 1); in ecx_get_params()
621 static int ecd_fips140_pairwise_test(const ECX_KEY *ecx, int type, int self_test) in ecd_fips140_pairwise_test() argument
640 OSSL_SELF_TEST_get_callback(ecx->libctx, &cb, &cbarg); in ecd_fips140_pairwise_test()
651 operation_result = ossl_ed25519_sign(sig, msg, msg_len, ecx->pubkey, in ecd_fips140_pairwise_test()
652 ecx->privkey, 0, 0, 0, NULL, 0, in ecd_fips140_pairwise_test()
653 ecx->libctx, ecx->propq); in ecd_fips140_pairwise_test()
655 operation_result = ossl_ed448_sign(ecx->libctx, sig, msg, msg_len, in ecd_fips140_pairwise_test()
656 ecx->pubkey, ecx->privkey, NULL, 0, in ecd_fips140_pairwise_test()
657 0, ecx->propq); in ecd_fips140_pairwise_test()
664 operation_result = ossl_ed25519_verify(msg, msg_len, sig, ecx->pubkey, in ecd_fips140_pairwise_test()
665 0, 0, 0, NULL, 0, ecx->libctx, in ecd_fips140_pairwise_test()
666 ecx->propq); in ecd_fips140_pairwise_test()
668 operation_result = ossl_ed448_verify(ecx->libctx, msg, msg_len, sig, in ecd_fips140_pairwise_test()
669 ecx->pubkey, NULL, 0, 0, ecx->propq); in ecd_fips140_pairwise_test()
872 static int ecx_key_pairwise_check(const ECX_KEY *ecx, int type) in ecx_key_pairwise_check() argument
878 ossl_x25519_public_from_private(pub, ecx->privkey); in ecx_key_pairwise_check()
881 ossl_x448_public_from_private(pub, ecx->privkey); in ecx_key_pairwise_check()
886 return CRYPTO_memcmp(ecx->pubkey, pub, ecx->keylen) == 0; in ecx_key_pairwise_check()
895 static int ecd_key_pub_check(const ECX_KEY *ecx, int type) in ecd_key_pub_check() argument
899 return ossl_ed25519_pubkey_verify(ecx->pubkey, ecx->keylen); in ecd_key_pub_check()
901 return ossl_ed448_pubkey_verify(ecx->pubkey, ecx->keylen); in ecd_key_pub_check()
909 static int ecd_key_pairwise_check(const ECX_KEY *ecx, int type) in ecd_key_pairwise_check() argument
911 return ecd_fips140_pairwise_test(ecx, type, 0); in ecd_key_pairwise_check()
914 static int ecd_key_pairwise_check(const ECX_KEY *ecx, int type) in ecd_key_pairwise_check() argument
920 if (!ossl_ed25519_public_from_private(ecx->libctx, pub, ecx->privkey, in ecd_key_pairwise_check()
921 ecx->propq)) in ecd_key_pairwise_check()
925 if (!ossl_ed448_public_from_private(ecx->libctx, pub, ecx->privkey, in ecd_key_pairwise_check()
926 ecx->propq)) in ecd_key_pairwise_check()
932 return CRYPTO_memcmp(ecx->pubkey, pub, ecx->keylen) == 0; in ecd_key_pairwise_check()
939 const ECX_KEY *ecx = keydata; in ecx_validate() local
940 int ok = keylen == ecx->keylen; in ecx_validate()
954 ok = ok && ecx->haspubkey; in ecx_validate()
956 ok = ok && ecd_key_pub_check(ecx, type); in ecx_validate()
961 ok = ok && ecx->privkey != NULL; in ecx_validate()
967 ok = ok && ecd_key_pairwise_check(ecx, type); in ecx_validate()
969 ok = ok && ecx_key_pairwise_check(ecx, type); in ecx_validate()