Lines Matching refs:tfm_cmac
92 struct crypto_shash *tfm_cmac;
130 struct crypto_shash *tfm_cmac;
209 static int smp_f4(struct crypto_shash *tfm_cmac, const u8 u[32],
223 err = aes_cmac(tfm_cmac, x, m, sizeof(m), res);
232 static int smp_f5(struct crypto_shash *tfm_cmac, const u8 w[32],
253 err = aes_cmac(tfm_cmac, salt, w, 32, t);
268 err = aes_cmac(tfm_cmac, t, m, sizeof(m), mackey);
276 err = aes_cmac(tfm_cmac, t, m, sizeof(m), ltk);
285 static int smp_f6(struct crypto_shash *tfm_cmac, const u8 w[16],
304 err = aes_cmac(tfm_cmac, w, m, sizeof(m), res);
313 static int smp_g2(struct crypto_shash *tfm_cmac, const u8 u[32], const u8 v[32],
327 err = aes_cmac(tfm_cmac, x, m, sizeof(m), tmp);
339 static int smp_h6(struct crypto_shash *tfm_cmac, const u8 w[16],
346 err = aes_cmac(tfm_cmac, w, key_id, 4, res);
355 static int smp_h7(struct crypto_shash *tfm_cmac, const u8 w[16],
362 err = aes_cmac(tfm_cmac, salt, w, 16, res);
577 err = smp_f4(smp->tfm_cmac, smp->local_pk, smp->local_pk,
760 crypto_free_shash(smp->tfm_cmac);
1167 if (smp_h7(smp->tfm_cmac, smp->tk, salt, smp->link_key)) {
1176 if (smp_h6(smp->tfm_cmac, smp->tk, tmp1, smp->link_key)) {
1183 if (smp_h6(smp->tfm_cmac, smp->link_key, lebr, smp->link_key)) {
1225 if (smp_h7(smp->tfm_cmac, key->val, salt, smp->tk))
1231 if (smp_h6(smp->tfm_cmac, key->val, tmp2, smp->tk))
1235 if (smp_h6(smp->tfm_cmac, smp->tk, brle, smp->tk))
1395 smp->tfm_cmac = crypto_alloc_shash("cmac(aes)", 0, 0);
1396 if (IS_ERR(smp->tfm_cmac)) {
1419 crypto_free_shash(smp->tfm_cmac);
1443 return smp_f5(smp->tfm_cmac, smp->dhkey, na, nb, a, b, mackey, ltk);
1476 smp_f6(smp->tfm_cmac, smp->mackey, smp->prnd, smp->rrnd, r, io_cap,
1494 if (smp_f4(smp->tfm_cmac, smp->local_pk, smp->remote_pk, smp->prnd, r,
1519 if (smp_f4(smp->tfm_cmac, smp->remote_pk, smp->local_pk,
2181 err = smp_f4(smp->tfm_cmac, smp->remote_pk, smp->local_pk,
2226 err = smp_g2(smp->tfm_cmac, pkax, pkbx, na, nb, &passkey);
2763 err = smp_f4(smp->tfm_cmac, smp->remote_pk, smp->remote_pk,
2864 err = smp_f4(smp->tfm_cmac, smp->local_pk, smp->remote_pk, smp->prnd,
2912 err = smp_f6(smp->tfm_cmac, smp->mackey, smp->rrnd, smp->prnd, r,
3290 struct crypto_shash *tfm_cmac;
3302 tfm_cmac = crypto_alloc_shash("cmac(aes)", 0, 0);
3303 if (IS_ERR(tfm_cmac)) {
3306 return ERR_CAST(tfm_cmac);
3312 crypto_free_shash(tfm_cmac);
3318 smp->tfm_cmac = tfm_cmac;
3325 crypto_free_shash(smp->tfm_cmac);
3372 crypto_free_shash(smp->tfm_cmac);
3609 static int __init test_f4(struct crypto_shash *tfm_cmac)
3631 err = smp_f4(tfm_cmac, u, v, x, z, res);
3641 static int __init test_f5(struct crypto_shash *tfm_cmac)
3665 err = smp_f5(tfm_cmac, w, n1, n2, a1, a2, mackey, ltk);
3678 static int __init test_f6(struct crypto_shash *tfm_cmac)
3701 err = smp_f6(tfm_cmac, w, n1, n2, r, io_cap, a1, a2, res);
3711 static int __init test_g2(struct crypto_shash *tfm_cmac)
3733 err = smp_g2(tfm_cmac, u, v, x, y, &val);
3743 static int __init test_h6(struct crypto_shash *tfm_cmac)
3755 err = smp_h6(tfm_cmac, w, key_id, res);
3780 static int __init run_selftests(struct crypto_shash *tfm_cmac,
3813 err = test_f4(tfm_cmac);
3819 err = test_f5(tfm_cmac);
3825 err = test_f6(tfm_cmac);
3831 err = test_g2(tfm_cmac);
3837 err = test_h6(tfm_cmac);
3864 struct crypto_shash *tfm_cmac;
3868 tfm_cmac = crypto_alloc_shash("cmac(aes)", 0, 0);
3869 if (IS_ERR(tfm_cmac)) {
3871 return PTR_ERR(tfm_cmac);
3877 crypto_free_shash(tfm_cmac);
3881 err = run_selftests(tfm_cmac, tfm_ecdh);
3883 crypto_free_shash(tfm_cmac);