Lines Matching refs:tfm_cmac
92 struct crypto_shash *tfm_cmac; member
130 struct crypto_shash *tfm_cmac; member
209 static int smp_f4(struct crypto_shash *tfm_cmac, const u8 u[32], in smp_f4() argument
223 err = aes_cmac(tfm_cmac, x, m, sizeof(m), res); in smp_f4()
232 static int smp_f5(struct crypto_shash *tfm_cmac, const u8 w[32], in smp_f5() argument
253 err = aes_cmac(tfm_cmac, salt, w, 32, t); in smp_f5()
268 err = aes_cmac(tfm_cmac, t, m, sizeof(m), mackey); in smp_f5()
276 err = aes_cmac(tfm_cmac, t, m, sizeof(m), ltk); in smp_f5()
285 static int smp_f6(struct crypto_shash *tfm_cmac, const u8 w[16], in smp_f6() argument
304 err = aes_cmac(tfm_cmac, w, m, sizeof(m), res); in smp_f6()
313 static int smp_g2(struct crypto_shash *tfm_cmac, const u8 u[32], const u8 v[32], in smp_g2() argument
327 err = aes_cmac(tfm_cmac, x, m, sizeof(m), tmp); in smp_g2()
339 static int smp_h6(struct crypto_shash *tfm_cmac, const u8 w[16], in smp_h6() argument
346 err = aes_cmac(tfm_cmac, w, key_id, 4, res); in smp_h6()
355 static int smp_h7(struct crypto_shash *tfm_cmac, const u8 w[16], in smp_h7() argument
362 err = aes_cmac(tfm_cmac, salt, w, 16, res); in smp_h7()
577 err = smp_f4(smp->tfm_cmac, smp->local_pk, smp->local_pk, in smp_generate_oob()
760 crypto_free_shash(smp->tfm_cmac); in smp_chan_destroy()
1158 if (smp_h7(smp->tfm_cmac, smp->tk, salt, smp->link_key)) { in sc_generate_link_key()
1167 if (smp_h6(smp->tfm_cmac, smp->tk, tmp1, smp->link_key)) { in sc_generate_link_key()
1174 if (smp_h6(smp->tfm_cmac, smp->link_key, lebr, smp->link_key)) { in sc_generate_link_key()
1216 if (smp_h7(smp->tfm_cmac, key->val, salt, smp->tk)) in sc_generate_ltk()
1222 if (smp_h6(smp->tfm_cmac, key->val, tmp2, smp->tk)) in sc_generate_ltk()
1226 if (smp_h6(smp->tfm_cmac, smp->tk, brle, smp->tk)) in sc_generate_ltk()
1384 smp->tfm_cmac = crypto_alloc_shash("cmac(aes)", 0, 0); in smp_chan_create()
1385 if (IS_ERR(smp->tfm_cmac)) { in smp_chan_create()
1408 crypto_free_shash(smp->tfm_cmac); in smp_chan_create()
1432 return smp_f5(smp->tfm_cmac, smp->dhkey, na, nb, a, b, mackey, ltk); in sc_mackey_and_ltk()
1465 smp_f6(smp->tfm_cmac, smp->mackey, smp->prnd, smp->rrnd, r, io_cap, in sc_dhkey_check()
1483 if (smp_f4(smp->tfm_cmac, smp->local_pk, smp->remote_pk, smp->prnd, r, in sc_passkey_send_confirm()
1508 if (smp_f4(smp->tfm_cmac, smp->remote_pk, smp->local_pk, in sc_passkey_round()
2167 err = smp_f4(smp->tfm_cmac, smp->remote_pk, smp->local_pk, in smp_cmd_pairing_random()
2212 err = smp_g2(smp->tfm_cmac, pkax, pkbx, na, nb, &passkey); in smp_cmd_pairing_random()
2748 err = smp_f4(smp->tfm_cmac, smp->remote_pk, smp->remote_pk, in smp_cmd_public_key()
2849 err = smp_f4(smp->tfm_cmac, smp->local_pk, smp->remote_pk, smp->prnd, in smp_cmd_public_key()
2897 err = smp_f6(smp->tfm_cmac, smp->mackey, smp->rrnd, smp->prnd, r, in smp_cmd_dhkey_check()
3275 struct crypto_shash *tfm_cmac; in smp_add_cid() local
3287 tfm_cmac = crypto_alloc_shash("cmac(aes)", 0, 0); in smp_add_cid()
3288 if (IS_ERR(tfm_cmac)) { in smp_add_cid()
3291 return ERR_CAST(tfm_cmac); in smp_add_cid()
3297 crypto_free_shash(tfm_cmac); in smp_add_cid()
3303 smp->tfm_cmac = tfm_cmac; in smp_add_cid()
3310 crypto_free_shash(smp->tfm_cmac); in smp_add_cid()
3357 crypto_free_shash(smp->tfm_cmac); in smp_del_chan()
3594 static int __init test_f4(struct crypto_shash *tfm_cmac) in test_f4() argument
3616 err = smp_f4(tfm_cmac, u, v, x, z, res); in test_f4()
3626 static int __init test_f5(struct crypto_shash *tfm_cmac) in test_f5() argument
3650 err = smp_f5(tfm_cmac, w, n1, n2, a1, a2, mackey, ltk); in test_f5()
3663 static int __init test_f6(struct crypto_shash *tfm_cmac) in test_f6() argument
3686 err = smp_f6(tfm_cmac, w, n1, n2, r, io_cap, a1, a2, res); in test_f6()
3696 static int __init test_g2(struct crypto_shash *tfm_cmac) in test_g2() argument
3718 err = smp_g2(tfm_cmac, u, v, x, y, &val); in test_g2()
3728 static int __init test_h6(struct crypto_shash *tfm_cmac) in test_h6() argument
3740 err = smp_h6(tfm_cmac, w, key_id, res); in test_h6()
3765 static int __init run_selftests(struct crypto_shash *tfm_cmac, in run_selftests() argument
3798 err = test_f4(tfm_cmac); in run_selftests()
3804 err = test_f5(tfm_cmac); in run_selftests()
3810 err = test_f6(tfm_cmac); in run_selftests()
3816 err = test_g2(tfm_cmac); in run_selftests()
3822 err = test_h6(tfm_cmac); in run_selftests()
3849 struct crypto_shash *tfm_cmac; in bt_selftest_smp() local
3853 tfm_cmac = crypto_alloc_shash("cmac(aes)", 0, 0); in bt_selftest_smp()
3854 if (IS_ERR(tfm_cmac)) { in bt_selftest_smp()
3856 return PTR_ERR(tfm_cmac); in bt_selftest_smp()
3862 crypto_free_shash(tfm_cmac); in bt_selftest_smp()
3866 err = run_selftests(tfm_cmac, tfm_ecdh); in bt_selftest_smp()
3868 crypto_free_shash(tfm_cmac); in bt_selftest_smp()