Lines Matching refs:tfm_cmac

85 	struct crypto_hash	*tfm_cmac;  member
124 struct crypto_hash *tfm_cmac; member
217 static int smp_f4(struct crypto_hash *tfm_cmac, const u8 u[32], const u8 v[32], in smp_f4() argument
231 err = aes_cmac(tfm_cmac, x, m, sizeof(m), res); in smp_f4()
240 static int smp_f5(struct crypto_hash *tfm_cmac, const u8 w[32], in smp_f5() argument
261 err = aes_cmac(tfm_cmac, salt, w, 32, t); in smp_f5()
276 err = aes_cmac(tfm_cmac, t, m, sizeof(m), mackey); in smp_f5()
284 err = aes_cmac(tfm_cmac, t, m, sizeof(m), ltk); in smp_f5()
293 static int smp_f6(struct crypto_hash *tfm_cmac, const u8 w[16], in smp_f6() argument
312 err = aes_cmac(tfm_cmac, w, m, sizeof(m), res); in smp_f6()
321 static int smp_g2(struct crypto_hash *tfm_cmac, const u8 u[32], const u8 v[32], in smp_g2() argument
335 err = aes_cmac(tfm_cmac, x, m, sizeof(m), tmp); in smp_g2()
347 static int smp_h6(struct crypto_hash *tfm_cmac, const u8 w[16], in smp_h6() argument
354 err = aes_cmac(tfm_cmac, w, key_id, 4, res); in smp_h6()
574 err = smp_f4(smp->tfm_cmac, smp->local_pk, smp->local_pk, in smp_generate_oob()
751 crypto_free_hash(smp->tfm_cmac); in smp_chan_destroy()
1167 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()
1214 if (smp_h6(smp->tfm_cmac, key->val, tmp2, smp->tk)) in sc_generate_ltk()
1217 if (smp_h6(smp->tfm_cmac, smp->tk, brle, smp->tk)) in sc_generate_ltk()
1375 smp->tfm_cmac = crypto_alloc_hash("cmac(aes)", 0, CRYPTO_ALG_ASYNC); in smp_chan_create()
1376 if (IS_ERR(smp->tfm_cmac)) { in smp_chan_create()
1413 return smp_f5(smp->tfm_cmac, smp->dhkey, na, nb, a, b, mackey, ltk); in sc_mackey_and_ltk()
1446 smp_f6(smp->tfm_cmac, smp->mackey, smp->prnd, smp->rrnd, r, io_cap, in sc_dhkey_check()
1464 if (smp_f4(smp->tfm_cmac, smp->local_pk, smp->remote_pk, smp->prnd, r, in sc_passkey_send_confirm()
1489 if (smp_f4(smp->tfm_cmac, smp->remote_pk, smp->local_pk, in sc_passkey_round()
2137 err = smp_f4(smp->tfm_cmac, smp->remote_pk, smp->local_pk, in smp_cmd_pairing_random()
2164 err = smp_g2(smp->tfm_cmac, pkax, pkbx, na, nb, &passkey); in smp_cmd_pairing_random()
2592 err = smp_f4(smp->tfm_cmac, smp->remote_pk, smp->remote_pk, in smp_cmd_public_key()
2676 err = smp_f4(smp->tfm_cmac, smp->local_pk, smp->remote_pk, smp->prnd, in smp_cmd_public_key()
2724 err = smp_f6(smp->tfm_cmac, smp->mackey, smp->rrnd, smp->prnd, r, in smp_cmd_dhkey_check()
3099 struct crypto_hash *tfm_cmac; in smp_add_cid() local
3117 tfm_cmac = crypto_alloc_hash("cmac(aes)", 0, CRYPTO_ALG_ASYNC); in smp_add_cid()
3118 if (IS_ERR(tfm_cmac)) { in smp_add_cid()
3122 return ERR_CAST(tfm_cmac); in smp_add_cid()
3126 smp->tfm_cmac = tfm_cmac; in smp_add_cid()
3133 crypto_free_hash(smp->tfm_cmac); in smp_add_cid()
3181 if (smp->tfm_cmac) in smp_del_chan()
3182 crypto_free_hash(smp->tfm_cmac); in smp_del_chan()
3400 static int __init test_f4(struct crypto_hash *tfm_cmac) in test_f4() argument
3422 err = smp_f4(tfm_cmac, u, v, x, z, res); in test_f4()
3432 static int __init test_f5(struct crypto_hash *tfm_cmac) in test_f5() argument
3456 err = smp_f5(tfm_cmac, w, n1, n2, a1, a2, mackey, ltk); in test_f5()
3469 static int __init test_f6(struct crypto_hash *tfm_cmac) in test_f6() argument
3492 err = smp_f6(tfm_cmac, w, n1, n2, r, io_cap, a1, a2, res); in test_f6()
3502 static int __init test_g2(struct crypto_hash *tfm_cmac) in test_g2() argument
3524 err = smp_g2(tfm_cmac, u, v, x, y, &val); in test_g2()
3534 static int __init test_h6(struct crypto_hash *tfm_cmac) in test_h6() argument
3546 err = smp_h6(tfm_cmac, w, key_id, res); in test_h6()
3572 struct crypto_hash *tfm_cmac) in run_selftests() argument
3598 err = test_f4(tfm_cmac); in run_selftests()
3604 err = test_f5(tfm_cmac); in run_selftests()
3610 err = test_f6(tfm_cmac); in run_selftests()
3616 err = test_g2(tfm_cmac); in run_selftests()
3622 err = test_h6(tfm_cmac); in run_selftests()
3650 struct crypto_hash *tfm_cmac; in bt_selftest_smp() local
3659 tfm_cmac = crypto_alloc_hash("cmac(aes)", 0, CRYPTO_ALG_ASYNC); in bt_selftest_smp()
3660 if (IS_ERR(tfm_cmac)) { in bt_selftest_smp()
3663 return PTR_ERR(tfm_cmac); in bt_selftest_smp()
3666 err = run_selftests(tfm_aes, tfm_cmac); in bt_selftest_smp()
3668 crypto_free_hash(tfm_cmac); in bt_selftest_smp()