Lines Matching refs:tfm_cmac
92 struct crypto_shash *tfm_cmac; member
130 struct crypto_shash *tfm_cmac; member
213 static int smp_f4(struct crypto_shash *tfm_cmac, const u8 u[32], in smp_f4() argument
227 err = aes_cmac(tfm_cmac, x, m, sizeof(m), res); in smp_f4()
236 static int smp_f5(struct crypto_shash *tfm_cmac, const u8 w[32], in smp_f5() argument
257 err = aes_cmac(tfm_cmac, salt, w, 32, t); in smp_f5()
272 err = aes_cmac(tfm_cmac, t, m, sizeof(m), mackey); in smp_f5()
280 err = aes_cmac(tfm_cmac, t, m, sizeof(m), ltk); in smp_f5()
289 static int smp_f6(struct crypto_shash *tfm_cmac, const u8 w[16], in smp_f6() argument
308 err = aes_cmac(tfm_cmac, w, m, sizeof(m), res); in smp_f6()
317 static int smp_g2(struct crypto_shash *tfm_cmac, const u8 u[32], const u8 v[32], in smp_g2() argument
331 err = aes_cmac(tfm_cmac, x, m, sizeof(m), tmp); in smp_g2()
343 static int smp_h6(struct crypto_shash *tfm_cmac, const u8 w[16], in smp_h6() argument
350 err = aes_cmac(tfm_cmac, w, key_id, 4, res); in smp_h6()
359 static int smp_h7(struct crypto_shash *tfm_cmac, const u8 w[16], in smp_h7() argument
366 err = aes_cmac(tfm_cmac, salt, w, 16, res); in smp_h7()
587 err = smp_f4(smp->tfm_cmac, smp->local_pk, smp->local_pk, in smp_generate_oob()
766 crypto_free_shash(smp->tfm_cmac); in smp_chan_destroy()
1157 if (smp_h7(smp->tfm_cmac, smp->tk, salt, smp->link_key)) { in sc_generate_link_key()
1166 if (smp_h6(smp->tfm_cmac, smp->tk, tmp1, smp->link_key)) { in sc_generate_link_key()
1173 if (smp_h6(smp->tfm_cmac, smp->link_key, lebr, smp->link_key)) { in sc_generate_link_key()
1215 if (smp_h7(smp->tfm_cmac, key->val, salt, smp->tk)) in sc_generate_ltk()
1221 if (smp_h6(smp->tfm_cmac, key->val, tmp2, smp->tk)) in sc_generate_ltk()
1225 if (smp_h6(smp->tfm_cmac, smp->tk, brle, smp->tk)) in sc_generate_ltk()
1383 smp->tfm_cmac = crypto_alloc_shash("cmac(aes)", 0, 0); in smp_chan_create()
1384 if (IS_ERR(smp->tfm_cmac)) { in smp_chan_create()
1407 crypto_free_shash(smp->tfm_cmac); in smp_chan_create()
1431 return smp_f5(smp->tfm_cmac, smp->dhkey, na, nb, a, b, mackey, ltk); in sc_mackey_and_ltk()
1464 smp_f6(smp->tfm_cmac, smp->mackey, smp->prnd, smp->rrnd, r, io_cap, in sc_dhkey_check()
1482 if (smp_f4(smp->tfm_cmac, smp->local_pk, smp->remote_pk, smp->prnd, r, in sc_passkey_send_confirm()
1507 if (smp_f4(smp->tfm_cmac, smp->remote_pk, smp->local_pk, in sc_passkey_round()
2166 err = smp_f4(smp->tfm_cmac, smp->remote_pk, smp->local_pk, in smp_cmd_pairing_random()
2193 err = smp_g2(smp->tfm_cmac, pkax, pkbx, na, nb, &passkey); in smp_cmd_pairing_random()
2691 err = smp_f4(smp->tfm_cmac, smp->remote_pk, smp->remote_pk, in smp_cmd_public_key()
2792 err = smp_f4(smp->tfm_cmac, smp->local_pk, smp->remote_pk, smp->prnd, in smp_cmd_public_key()
2840 err = smp_f6(smp->tfm_cmac, smp->mackey, smp->rrnd, smp->prnd, r, in smp_cmd_dhkey_check()
3218 struct crypto_shash *tfm_cmac; in smp_add_cid() local
3230 tfm_cmac = crypto_alloc_shash("cmac(aes)", 0, 0); in smp_add_cid()
3231 if (IS_ERR(tfm_cmac)) { in smp_add_cid()
3234 return ERR_CAST(tfm_cmac); in smp_add_cid()
3240 crypto_free_shash(tfm_cmac); in smp_add_cid()
3246 smp->tfm_cmac = tfm_cmac; in smp_add_cid()
3253 crypto_free_shash(smp->tfm_cmac); in smp_add_cid()
3300 crypto_free_shash(smp->tfm_cmac); in smp_del_chan()
3630 static int __init test_f4(struct crypto_shash *tfm_cmac) in test_f4() argument
3652 err = smp_f4(tfm_cmac, u, v, x, z, res); in test_f4()
3662 static int __init test_f5(struct crypto_shash *tfm_cmac) in test_f5() argument
3686 err = smp_f5(tfm_cmac, w, n1, n2, a1, a2, mackey, ltk); in test_f5()
3699 static int __init test_f6(struct crypto_shash *tfm_cmac) in test_f6() argument
3722 err = smp_f6(tfm_cmac, w, n1, n2, r, io_cap, a1, a2, res); in test_f6()
3732 static int __init test_g2(struct crypto_shash *tfm_cmac) in test_g2() argument
3754 err = smp_g2(tfm_cmac, u, v, x, y, &val); in test_g2()
3764 static int __init test_h6(struct crypto_shash *tfm_cmac) in test_h6() argument
3776 err = smp_h6(tfm_cmac, w, key_id, res); in test_h6()
3801 static int __init run_selftests(struct crypto_shash *tfm_cmac, in run_selftests() argument
3834 err = test_f4(tfm_cmac); in run_selftests()
3840 err = test_f5(tfm_cmac); in run_selftests()
3846 err = test_f6(tfm_cmac); in run_selftests()
3852 err = test_g2(tfm_cmac); in run_selftests()
3858 err = test_h6(tfm_cmac); in run_selftests()
3885 struct crypto_shash *tfm_cmac; in bt_selftest_smp() local
3889 tfm_cmac = crypto_alloc_shash("cmac(aes)", 0, 0); in bt_selftest_smp()
3890 if (IS_ERR(tfm_cmac)) { in bt_selftest_smp()
3892 return PTR_ERR(tfm_cmac); in bt_selftest_smp()
3898 crypto_free_shash(tfm_cmac); in bt_selftest_smp()
3902 err = run_selftests(tfm_cmac, tfm_ecdh); in bt_selftest_smp()
3904 crypto_free_shash(tfm_cmac); in bt_selftest_smp()