Lines Matching refs:tfm_cmac
91 struct crypto_hash *tfm_cmac; member
130 struct crypto_hash *tfm_cmac; member
223 static int smp_f4(struct crypto_hash *tfm_cmac, const u8 u[32], const u8 v[32], in smp_f4() argument
237 err = aes_cmac(tfm_cmac, x, m, sizeof(m), res); in smp_f4()
246 static int smp_f5(struct crypto_hash *tfm_cmac, const u8 w[32], in smp_f5() argument
267 err = aes_cmac(tfm_cmac, salt, w, 32, t); in smp_f5()
282 err = aes_cmac(tfm_cmac, t, m, sizeof(m), mackey); in smp_f5()
290 err = aes_cmac(tfm_cmac, t, m, sizeof(m), ltk); in smp_f5()
299 static int smp_f6(struct crypto_hash *tfm_cmac, const u8 w[16], in smp_f6() argument
318 err = aes_cmac(tfm_cmac, w, m, sizeof(m), res); in smp_f6()
327 static int smp_g2(struct crypto_hash *tfm_cmac, const u8 u[32], const u8 v[32], in smp_g2() argument
341 err = aes_cmac(tfm_cmac, x, m, sizeof(m), tmp); in smp_g2()
353 static int smp_h6(struct crypto_hash *tfm_cmac, const u8 w[16], in smp_h6() argument
360 err = aes_cmac(tfm_cmac, w, key_id, 4, res); in smp_h6()
592 err = smp_f4(smp->tfm_cmac, smp->local_pk, smp->local_pk, in smp_generate_oob()
770 crypto_free_hash(smp->tfm_cmac); in smp_chan_destroy()
1161 if (smp_h6(smp->tfm_cmac, smp->tk, tmp1, smp->link_key)) { in sc_generate_link_key()
1167 if (smp_h6(smp->tfm_cmac, smp->link_key, lebr, smp->link_key)) { in sc_generate_link_key()
1208 if (smp_h6(smp->tfm_cmac, key->val, tmp2, smp->tk)) in sc_generate_ltk()
1211 if (smp_h6(smp->tfm_cmac, smp->tk, brle, smp->tk)) in sc_generate_ltk()
1376 smp->tfm_cmac = crypto_alloc_hash("cmac(aes)", 0, CRYPTO_ALG_ASYNC); in smp_chan_create()
1377 if (IS_ERR(smp->tfm_cmac)) { in smp_chan_create()
1414 return smp_f5(smp->tfm_cmac, smp->dhkey, na, nb, a, b, mackey, ltk); in sc_mackey_and_ltk()
1447 smp_f6(smp->tfm_cmac, smp->mackey, smp->prnd, smp->rrnd, r, io_cap, in sc_dhkey_check()
1465 if (smp_f4(smp->tfm_cmac, smp->local_pk, smp->remote_pk, smp->prnd, r, in sc_passkey_send_confirm()
1490 if (smp_f4(smp->tfm_cmac, smp->remote_pk, smp->local_pk, in sc_passkey_round()
2138 err = smp_f4(smp->tfm_cmac, smp->remote_pk, smp->local_pk, in smp_cmd_pairing_random()
2165 err = smp_g2(smp->tfm_cmac, pkax, pkbx, na, nb, &passkey); in smp_cmd_pairing_random()
2619 err = smp_f4(smp->tfm_cmac, smp->remote_pk, smp->remote_pk, in smp_cmd_public_key()
2703 err = smp_f4(smp->tfm_cmac, smp->local_pk, smp->remote_pk, smp->prnd, in smp_cmd_public_key()
2751 err = smp_f6(smp->tfm_cmac, smp->mackey, smp->rrnd, smp->prnd, r, in smp_cmd_dhkey_check()
3131 struct crypto_hash *tfm_cmac; in smp_add_cid() local
3149 tfm_cmac = crypto_alloc_hash("cmac(aes)", 0, CRYPTO_ALG_ASYNC); in smp_add_cid()
3150 if (IS_ERR(tfm_cmac)) { in smp_add_cid()
3154 return ERR_CAST(tfm_cmac); in smp_add_cid()
3158 smp->tfm_cmac = tfm_cmac; in smp_add_cid()
3167 crypto_free_hash(smp->tfm_cmac); in smp_add_cid()
3215 if (smp->tfm_cmac) in smp_del_chan()
3216 crypto_free_hash(smp->tfm_cmac); in smp_del_chan()
3527 static int __init test_f4(struct crypto_hash *tfm_cmac) in test_f4() argument
3549 err = smp_f4(tfm_cmac, u, v, x, z, res); in test_f4()
3559 static int __init test_f5(struct crypto_hash *tfm_cmac) in test_f5() argument
3583 err = smp_f5(tfm_cmac, w, n1, n2, a1, a2, mackey, ltk); in test_f5()
3596 static int __init test_f6(struct crypto_hash *tfm_cmac) in test_f6() argument
3619 err = smp_f6(tfm_cmac, w, n1, n2, r, io_cap, a1, a2, res); in test_f6()
3629 static int __init test_g2(struct crypto_hash *tfm_cmac) in test_g2() argument
3651 err = smp_g2(tfm_cmac, u, v, x, y, &val); in test_g2()
3661 static int __init test_h6(struct crypto_hash *tfm_cmac) in test_h6() argument
3673 err = smp_h6(tfm_cmac, w, key_id, res); in test_h6()
3699 struct crypto_hash *tfm_cmac) in run_selftests() argument
3725 err = test_f4(tfm_cmac); in run_selftests()
3731 err = test_f5(tfm_cmac); in run_selftests()
3737 err = test_f6(tfm_cmac); in run_selftests()
3743 err = test_g2(tfm_cmac); in run_selftests()
3749 err = test_h6(tfm_cmac); in run_selftests()
3777 struct crypto_hash *tfm_cmac; in bt_selftest_smp() local
3786 tfm_cmac = crypto_alloc_hash("cmac(aes)", 0, CRYPTO_ALG_ASYNC); in bt_selftest_smp()
3787 if (IS_ERR(tfm_cmac)) { in bt_selftest_smp()
3790 return PTR_ERR(tfm_cmac); in bt_selftest_smp()
3793 err = run_selftests(tfm_aes, tfm_cmac); in bt_selftest_smp()
3795 crypto_free_hash(tfm_cmac); in bt_selftest_smp()