Home
last modified time | relevance | path

Searched refs:tfm (Results 1 – 25 of 33) sorted by relevance

12

/net/mac80211/
Daes_cmac.c25 void ieee80211_aes_cmac(struct crypto_shash *tfm, const u8 *aad, in ieee80211_aes_cmac() argument
28 SHASH_DESC_ON_STACK(desc, tfm); in ieee80211_aes_cmac()
32 desc->tfm = tfm; in ieee80211_aes_cmac()
49 void ieee80211_aes_cmac_256(struct crypto_shash *tfm, const u8 *aad, in ieee80211_aes_cmac_256() argument
52 SHASH_DESC_ON_STACK(desc, tfm); in ieee80211_aes_cmac_256()
55 desc->tfm = tfm; in ieee80211_aes_cmac_256()
74 struct crypto_shash *tfm; in ieee80211_aes_cmac_key_setup() local
76 tfm = crypto_alloc_shash("cmac(aes)", 0, 0); in ieee80211_aes_cmac_key_setup()
77 if (!IS_ERR(tfm)) { in ieee80211_aes_cmac_key_setup()
78 int err = crypto_shash_setkey(tfm, key, key_len); in ieee80211_aes_cmac_key_setup()
[all …]
Daead_api.c18 int aead_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, size_t aad_len, in aead_encrypt() argument
21 size_t mic_len = crypto_aead_authsize(tfm); in aead_encrypt()
24 int reqsize = sizeof(*aead_req) + crypto_aead_reqsize(tfm); in aead_encrypt()
40 aead_request_set_tfm(aead_req, tfm); in aead_encrypt()
50 int aead_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, size_t aad_len, in aead_decrypt() argument
53 size_t mic_len = crypto_aead_authsize(tfm); in aead_decrypt()
56 int reqsize = sizeof(*aead_req) + crypto_aead_reqsize(tfm); in aead_decrypt()
75 aead_request_set_tfm(aead_req, tfm); in aead_decrypt()
89 struct crypto_aead *tfm; in aead_key_setup_encrypt() local
92 tfm = crypto_alloc_aead(alg, 0, CRYPTO_ALG_ASYNC); in aead_key_setup_encrypt()
[all …]
Daes_gmac.c17 int ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce, in ieee80211_aes_gmac() argument
23 int reqsize = sizeof(*aead_req) + crypto_aead_reqsize(tfm); in ieee80211_aes_gmac()
59 aead_request_set_tfm(aead_req, tfm); in ieee80211_aes_gmac()
72 struct crypto_aead *tfm; in ieee80211_aes_gmac_key_setup() local
75 tfm = crypto_alloc_aead("gcm(aes)", 0, CRYPTO_ALG_ASYNC); in ieee80211_aes_gmac_key_setup()
76 if (IS_ERR(tfm)) in ieee80211_aes_gmac_key_setup()
77 return tfm; in ieee80211_aes_gmac_key_setup()
79 err = crypto_aead_setkey(tfm, key, key_len); in ieee80211_aes_gmac_key_setup()
81 err = crypto_aead_setauthsize(tfm, GMAC_MIC_LEN); in ieee80211_aes_gmac_key_setup()
83 return tfm; in ieee80211_aes_gmac_key_setup()
[all …]
Dfils_aead.c25 static int aes_s2v(struct crypto_shash *tfm, in aes_s2v() argument
29 SHASH_DESC_ON_STACK(desc, tfm); in aes_s2v()
32 desc->tfm = tfm; in aes_s2v()
72 struct crypto_shash *tfm; in aes_siv_encrypt() local
87 tfm = crypto_alloc_shash("cmac(aes)", 0, 0); in aes_siv_encrypt()
88 if (IS_ERR(tfm)) in aes_siv_encrypt()
89 return PTR_ERR(tfm); in aes_siv_encrypt()
91 res = crypto_shash_setkey(tfm, key, key_len); in aes_siv_encrypt()
93 res = aes_s2v(tfm, num_elem, addr, len, v); in aes_siv_encrypt()
94 crypto_free_shash(tfm); in aes_siv_encrypt()
[all …]
Daes_ccm.h21 ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, in ieee80211_aes_ccm_encrypt() argument
25 return aead_encrypt(tfm, b_0, aad + 2, in ieee80211_aes_ccm_encrypt()
31 ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, in ieee80211_aes_ccm_decrypt() argument
35 return aead_decrypt(tfm, b_0, aad + 2, in ieee80211_aes_ccm_decrypt()
40 static inline void ieee80211_aes_key_free(struct crypto_aead *tfm) in ieee80211_aes_key_free() argument
42 return aead_key_free(tfm); in ieee80211_aes_key_free()
Daes_gcm.h13 static inline int ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, in ieee80211_aes_gcm_encrypt() argument
17 return aead_encrypt(tfm, j_0, aad + 2, in ieee80211_aes_gcm_encrypt()
22 static inline int ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, in ieee80211_aes_gcm_decrypt() argument
26 return aead_decrypt(tfm, j_0, aad + 2, in ieee80211_aes_gcm_decrypt()
38 static inline void ieee80211_aes_gcm_key_free(struct crypto_aead *tfm) in ieee80211_aes_gcm_key_free() argument
40 return aead_key_free(tfm); in ieee80211_aes_gcm_key_free()
Daes_cmac.h14 void ieee80211_aes_cmac(struct crypto_shash *tfm, const u8 *aad,
16 void ieee80211_aes_cmac_256(struct crypto_shash *tfm, const u8 *aad,
18 void ieee80211_aes_cmac_key_free(struct crypto_shash *tfm);
Dkey.c591 key->u.ccmp.tfm = ieee80211_aes_key_setup_encrypt( in ieee80211_key_alloc()
593 if (IS_ERR(key->u.ccmp.tfm)) { in ieee80211_key_alloc()
594 err = PTR_ERR(key->u.ccmp.tfm); in ieee80211_key_alloc()
609 key->u.ccmp.tfm = ieee80211_aes_key_setup_encrypt( in ieee80211_key_alloc()
611 if (IS_ERR(key->u.ccmp.tfm)) { in ieee80211_key_alloc()
612 err = PTR_ERR(key->u.ccmp.tfm); in ieee80211_key_alloc()
632 key->u.aes_cmac.tfm = in ieee80211_key_alloc()
634 if (IS_ERR(key->u.aes_cmac.tfm)) { in ieee80211_key_alloc()
635 err = PTR_ERR(key->u.aes_cmac.tfm); in ieee80211_key_alloc()
651 key->u.aes_gmac.tfm = in ieee80211_key_alloc()
[all …]
Dkey.h92 struct crypto_aead *tfm; member
97 struct crypto_shash *tfm; member
103 struct crypto_aead *tfm; member
114 struct crypto_aead *tfm; member
Daead_api.h13 int aead_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad,
17 int aead_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad,
21 void aead_key_free(struct crypto_aead *tfm);
Daes_gmac.h17 int ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce,
19 void ieee80211_aes_gmac_key_free(struct crypto_aead *tfm);
Dwpa.c472 return ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, b_0, aad, pos, len, in ccmp_encrypt_skb()
552 key->u.ccmp.tfm, b_0, aad, in ieee80211_crypto_ccmp_decrypt()
709 return ieee80211_aes_gcm_encrypt(key->u.gcmp.tfm, j_0, aad, pos, len, in gcmp_encrypt_skb()
784 key->u.gcmp.tfm, j_0, aad, in ieee80211_crypto_gcmp_decrypt()
985 ieee80211_aes_cmac(key->u.aes_cmac.tfm, aad, in ieee80211_crypto_aes_cmac_encrypt()
1028 ieee80211_aes_cmac_256(key->u.aes_cmac.tfm, aad, in ieee80211_crypto_aes_cmac_256_encrypt()
1068 ieee80211_aes_cmac(key->u.aes_cmac.tfm, aad, in ieee80211_crypto_aes_cmac_decrypt()
1118 ieee80211_aes_cmac_256(key->u.aes_cmac.tfm, aad, in ieee80211_crypto_aes_cmac_256_decrypt()
1176 if (ieee80211_aes_gmac(key->u.aes_gmac.tfm, aad, nonce, in ieee80211_crypto_aes_gmac_encrypt()
1224 if (ieee80211_aes_gmac(key->u.aes_gmac.tfm, aad, nonce, in ieee80211_crypto_aes_gmac_decrypt()
/net/sunrpc/auth_gss/
Dgss_krb5_crypto.c56 struct crypto_sync_skcipher *tfm, in krb5_encrypt() argument
65 SYNC_SKCIPHER_REQUEST_ON_STACK(req, tfm); in krb5_encrypt()
67 if (length % crypto_sync_skcipher_blocksize(tfm) != 0) in krb5_encrypt()
70 if (crypto_sync_skcipher_ivsize(tfm) > GSS_KRB5_MAX_BLOCKSIZE) { in krb5_encrypt()
72 crypto_sync_skcipher_ivsize(tfm)); in krb5_encrypt()
77 memcpy(local_iv, iv, crypto_sync_skcipher_ivsize(tfm)); in krb5_encrypt()
82 skcipher_request_set_sync_tfm(req, tfm); in krb5_encrypt()
95 struct crypto_sync_skcipher *tfm, in krb5_decrypt() argument
104 SYNC_SKCIPHER_REQUEST_ON_STACK(req, tfm); in krb5_decrypt()
106 if (length % crypto_sync_skcipher_blocksize(tfm) != 0) in krb5_decrypt()
[all …]
/net/bluetooth/
Dselftest.c141 static int __init test_ecdh_sample(struct crypto_kpp *tfm, const u8 priv_a[32], in test_ecdh_sample() argument
155 ret = set_ecdh_privkey(tfm, priv_a); in test_ecdh_sample()
159 ret = compute_ecdh_secret(tfm, pub_b, dhkey_a); in test_ecdh_sample()
168 ret = set_ecdh_privkey(tfm, priv_b); in test_ecdh_sample()
172 ret = compute_ecdh_secret(tfm, pub_a, dhkey_b); in test_ecdh_sample()
201 struct crypto_kpp *tfm; in test_ecdh() local
208 tfm = crypto_alloc_kpp("ecdh-nist-p256", 0, 0); in test_ecdh()
209 if (IS_ERR(tfm)) { in test_ecdh()
211 err = PTR_ERR(tfm); in test_ecdh()
215 err = test_ecdh_sample(tfm, priv_a_1, priv_b_1, pub_a_1, pub_b_1, in test_ecdh()
[all …]
Decdh_helper.c60 int compute_ecdh_secret(struct crypto_kpp *tfm, const u8 public_key[64], in compute_ecdh_secret() argument
73 req = kpp_request_alloc(tfm, GFP_KERNEL); in compute_ecdh_secret()
122 int set_ecdh_privkey(struct crypto_kpp *tfm, const u8 private_key[32]) in set_ecdh_privkey() argument
149 err = crypto_kpp_set_secret(tfm, buf, buf_len); in set_ecdh_privkey()
166 int generate_ecdh_public_key(struct crypto_kpp *tfm, u8 public_key[64]) in generate_ecdh_public_key() argument
178 req = kpp_request_alloc(tfm, GFP_KERNEL); in generate_ecdh_public_key()
219 int generate_ecdh_keys(struct crypto_kpp *tfm, u8 public_key[64]) in generate_ecdh_keys() argument
223 err = set_ecdh_privkey(tfm, NULL); in generate_ecdh_keys()
227 return generate_ecdh_public_key(tfm, public_key); in generate_ecdh_keys()
Decdh_helper.h26 int compute_ecdh_secret(struct crypto_kpp *tfm, const u8 pair_public_key[64],
28 int set_ecdh_privkey(struct crypto_kpp *tfm, const u8 private_key[32]);
29 int generate_ecdh_public_key(struct crypto_kpp *tfm, u8 public_key[64]);
30 int generate_ecdh_keys(struct crypto_kpp *tfm, u8 public_key[64]);
Damp.c130 struct crypto_shash *tfm; in hmac_sha256() local
137 tfm = crypto_alloc_shash("hmac(sha256)", 0, 0); in hmac_sha256()
138 if (IS_ERR(tfm)) { in hmac_sha256()
139 BT_DBG("crypto_alloc_ahash failed: err %ld", PTR_ERR(tfm)); in hmac_sha256()
140 return PTR_ERR(tfm); in hmac_sha256()
143 ret = crypto_shash_setkey(tfm, key, ksize); in hmac_sha256()
149 shash = kzalloc(sizeof(*shash) + crypto_shash_descsize(tfm), in hmac_sha256()
156 shash->tfm = tfm; in hmac_sha256()
163 crypto_free_shash(tfm); in hmac_sha256()
/net/ipv6/
Dseg6_hmac.c122 struct crypto_shash *tfm; in __do_hmac() local
130 tfm = *this_cpu_ptr(algo->tfms); in __do_hmac()
132 dgsize = crypto_shash_digestsize(tfm); in __do_hmac()
139 ret = crypto_shash_setkey(tfm, hinfo->secret, hinfo->slen); in __do_hmac()
146 shash->tfm = tfm; in __do_hmac()
354 struct crypto_shash *tfm; in seg6_hmac_init_algo() local
370 tfm = crypto_alloc_shash(algo->name, 0, 0); in seg6_hmac_init_algo()
371 if (IS_ERR(tfm)) in seg6_hmac_init_algo()
372 return PTR_ERR(tfm); in seg6_hmac_init_algo()
374 *p_tfm = tfm; in seg6_hmac_init_algo()
[all …]
/net/wireless/
Dlib80211_crypt_ccmp.c52 struct crypto_aead *tfm; member
68 priv->tfm = crypto_alloc_aead("ccm(aes)", 0, CRYPTO_ALG_ASYNC); in lib80211_ccmp_init()
69 if (IS_ERR(priv->tfm)) { in lib80211_ccmp_init()
70 priv->tfm = NULL; in lib80211_ccmp_init()
78 if (priv->tfm) in lib80211_ccmp_init()
79 crypto_free_aead(priv->tfm); in lib80211_ccmp_init()
89 if (_priv && _priv->tfm) in lib80211_ccmp_deinit()
90 crypto_free_aead(_priv->tfm); in lib80211_ccmp_deinit()
209 req = aead_request_alloc(key->tfm, GFP_ATOMIC); in lib80211_ccmp_encrypt()
313 req = aead_request_alloc(key->tfm, GFP_ATOMIC); in lib80211_ccmp_decrypt()
[all …]
/net/xfrm/
Dxfrm_ipcomp.c45 struct crypto_comp *tfm = *this_cpu_ptr(ipcd->tfms); in ipcomp_decompress() local
46 int err = crypto_comp_decompress(tfm, start, plen, scratch, &dlen); in ipcomp_decompress()
131 struct crypto_comp *tfm; in ipcomp_compress() local
137 tfm = *this_cpu_ptr(ipcd->tfms); in ipcomp_compress()
138 err = crypto_comp_compress(tfm, start, plen, scratch, &dlen); in ipcomp_compress()
257 struct crypto_comp *tfm = *per_cpu_ptr(tfms, cpu); in ipcomp_free_tfms() local
258 crypto_free_comp(tfm); in ipcomp_free_tfms()
271 struct crypto_comp *tfm; in ipcomp_alloc_tfms() local
274 tfm = this_cpu_read(*pos->tfms); in ipcomp_alloc_tfms()
276 if (!strcmp(crypto_comp_name(tfm), alg_name)) { in ipcomp_alloc_tfms()
[all …]
/net/ceph/
Dcrypto.c29 key->tfm = NULL; in set_secret()
51 key->tfm = crypto_alloc_sync_skcipher("cbc(aes)", 0, 0); in set_secret()
53 if (IS_ERR(key->tfm)) { in set_secret()
54 ret = PTR_ERR(key->tfm); in set_secret()
55 key->tfm = NULL; in set_secret()
59 ret = crypto_sync_skcipher_setkey(key->tfm, key->key, key->len); in set_secret()
140 if (key->tfm) { in ceph_crypto_key_destroy()
141 crypto_free_sync_skcipher(key->tfm); in ceph_crypto_key_destroy()
142 key->tfm = NULL; in ceph_crypto_key_destroy()
222 SYNC_SKCIPHER_REQUEST_ON_STACK(req, key->tfm); in ceph_aes_crypt()
[all …]
/net/tipc/
Dcrypto.c130 struct crypto_aead *tfm; member
262 static void *tipc_aead_mem_alloc(struct crypto_aead *tfm,
417 crypto_free_aead(tfm_entry->tfm); in tipc_aead_free()
422 crypto_free_aead(head->tfm); in tipc_aead_free()
491 struct crypto_aead *tfm; in tipc_aead_tfm_next() local
495 tfm = (*tfm_entry)->tfm; in tipc_aead_tfm_next()
498 return tfm; in tipc_aead_tfm_next()
518 struct crypto_aead *tfm; in tipc_aead_init() local
543 tfm = crypto_alloc_aead(ukey->alg_name, 0, 0); in tipc_aead_init()
544 if (IS_ERR(tfm)) { in tipc_aead_init()
[all …]
/net/mac802154/
Dllsec.c127 BUILD_BUG_ON(ARRAY_SIZE(authsizes) != ARRAY_SIZE(key->tfm)); in llsec_key_alloc()
129 for (i = 0; i < ARRAY_SIZE(key->tfm); i++) { in llsec_key_alloc()
130 key->tfm[i] = crypto_alloc_aead("ccm(aes)", 0, in llsec_key_alloc()
132 if (IS_ERR(key->tfm[i])) in llsec_key_alloc()
134 if (crypto_aead_setkey(key->tfm[i], template->key, in llsec_key_alloc()
137 if (crypto_aead_setauthsize(key->tfm[i], authsizes[i])) in llsec_key_alloc()
154 for (i = 0; i < ARRAY_SIZE(key->tfm); i++) in llsec_key_alloc()
155 if (!IS_ERR_OR_NULL(key->tfm[i])) in llsec_key_alloc()
156 crypto_free_aead(key->tfm[i]); in llsec_key_alloc()
169 for (i = 0; i < ARRAY_SIZE(key->tfm); i++) in llsec_key_release()
[all …]
/net/sctp/
Dauth.c456 struct crypto_shash *tfm = NULL; in sctp_auth_init_hmacs() local
485 tfm = crypto_alloc_shash(sctp_hmac_list[id].hmac_name, 0, 0); in sctp_auth_init_hmacs()
486 if (IS_ERR(tfm)) in sctp_auth_init_hmacs()
489 ep->auth_hmacs[id] = tfm; in sctp_auth_init_hmacs()
712 struct crypto_shash *tfm; in sctp_auth_calculate_hmac() local
739 tfm = asoc->ep->auth_hmacs[hmac_id]; in sctp_auth_calculate_hmac()
742 if (crypto_shash_setkey(tfm, &asoc_key->data[0], asoc_key->len)) in sctp_auth_calculate_hmac()
745 crypto_shash_tfm_digest(tfm, (u8 *)auth, end - (unsigned char *)auth, in sctp_auth_calculate_hmac()
/net/rxrpc/
Drxkad.c235 struct crypto_skcipher *tfm = &call->conn->rxkad.cipher->base; in rxkad_get_call_crypto() local
239 cipher_req = skcipher_request_alloc(tfm, GFP_NOFS); in rxkad_get_call_crypto()
1352 struct crypto_sync_skcipher *tfm; in rxkad_init() local
1357 tfm = crypto_alloc_sync_skcipher("pcbc(fcrypt)", 0, 0); in rxkad_init()
1358 if (IS_ERR(tfm)) in rxkad_init()
1359 return PTR_ERR(tfm); in rxkad_init()
1361 req = skcipher_request_alloc(&tfm->base, GFP_KERNEL); in rxkad_init()
1366 rxkad_ci = tfm; in rxkad_init()
1370 crypto_free_sync_skcipher(tfm); in rxkad_init()

12