Lines Matching refs:tfm
141 static int __init test_ecdh_sample(struct crypto_kpp *tfm, const u8 priv_a[32], in test_ecdh_sample() argument
155 ret = set_ecdh_privkey(tfm, priv_a); in test_ecdh_sample()
159 ret = compute_ecdh_secret(tfm, pub_b, dhkey_a); in test_ecdh_sample()
168 ret = set_ecdh_privkey(tfm, priv_b); in test_ecdh_sample()
172 ret = compute_ecdh_secret(tfm, pub_a, dhkey_b); in test_ecdh_sample()
201 struct crypto_kpp *tfm; in test_ecdh() local
208 tfm = crypto_alloc_kpp("ecdh-nist-p256", 0, 0); in test_ecdh()
209 if (IS_ERR(tfm)) { in test_ecdh()
211 err = PTR_ERR(tfm); in test_ecdh()
215 err = test_ecdh_sample(tfm, priv_a_1, priv_b_1, pub_a_1, pub_b_1, in test_ecdh()
222 err = test_ecdh_sample(tfm, priv_a_2, priv_b_2, pub_a_2, pub_b_2, in test_ecdh()
229 err = test_ecdh_sample(tfm, priv_a_3, priv_a_3, pub_a_3, pub_a_3, in test_ecdh()
236 crypto_free_kpp(tfm); in test_ecdh()