Home
last modified time | relevance | path

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

12

/net/mac80211/
Daes_cmac.c24 void ieee80211_aes_cmac(struct crypto_shash *tfm, const u8 *aad, in ieee80211_aes_cmac() argument
27 SHASH_DESC_ON_STACK(desc, tfm); in ieee80211_aes_cmac()
30 desc->tfm = tfm; in ieee80211_aes_cmac()
40 void ieee80211_aes_cmac_256(struct crypto_shash *tfm, const u8 *aad, in ieee80211_aes_cmac_256() argument
43 SHASH_DESC_ON_STACK(desc, tfm); in ieee80211_aes_cmac_256()
45 desc->tfm = tfm; in ieee80211_aes_cmac_256()
56 struct crypto_shash *tfm; in ieee80211_aes_cmac_key_setup() local
58 tfm = crypto_alloc_shash("cmac(aes)", 0, 0); in ieee80211_aes_cmac_key_setup()
59 if (!IS_ERR(tfm)) in ieee80211_aes_cmac_key_setup()
60 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()
39 aead_request_set_tfm(aead_req, tfm); in aead_encrypt()
49 int aead_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, size_t aad_len, in aead_decrypt() argument
52 size_t mic_len = crypto_aead_authsize(tfm); in aead_decrypt()
55 int reqsize = sizeof(*aead_req) + crypto_aead_reqsize(tfm); in aead_decrypt()
74 aead_request_set_tfm(aead_req, tfm); in aead_decrypt()
88 struct crypto_aead *tfm; in aead_key_setup_encrypt() local
91 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()
46 aead_request_set_tfm(aead_req, tfm); in ieee80211_aes_gmac()
59 struct crypto_aead *tfm; in ieee80211_aes_gmac_key_setup() local
62 tfm = crypto_alloc_aead("gcm(aes)", 0, CRYPTO_ALG_ASYNC); in ieee80211_aes_gmac_key_setup()
63 if (IS_ERR(tfm)) in ieee80211_aes_gmac_key_setup()
64 return tfm; in ieee80211_aes_gmac_key_setup()
66 err = crypto_aead_setkey(tfm, key, key_len); in ieee80211_aes_gmac_key_setup()
68 err = crypto_aead_setauthsize(tfm, GMAC_MIC_LEN); in ieee80211_aes_gmac_key_setup()
70 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_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_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_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);
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);
Dkey.h91 struct crypto_aead *tfm; member
96 struct crypto_shash *tfm; member
102 struct crypto_aead *tfm; member
113 struct crypto_aead *tfm; member
Dkey.c556 key->u.ccmp.tfm = ieee80211_aes_key_setup_encrypt( in ieee80211_key_alloc()
558 if (IS_ERR(key->u.ccmp.tfm)) { in ieee80211_key_alloc()
559 err = PTR_ERR(key->u.ccmp.tfm); in ieee80211_key_alloc()
574 key->u.ccmp.tfm = ieee80211_aes_key_setup_encrypt( in ieee80211_key_alloc()
576 if (IS_ERR(key->u.ccmp.tfm)) { in ieee80211_key_alloc()
577 err = PTR_ERR(key->u.ccmp.tfm); in ieee80211_key_alloc()
597 key->u.aes_cmac.tfm = in ieee80211_key_alloc()
599 if (IS_ERR(key->u.aes_cmac.tfm)) { in ieee80211_key_alloc()
600 err = PTR_ERR(key->u.aes_cmac.tfm); in ieee80211_key_alloc()
616 key->u.aes_gmac.tfm = in ieee80211_key_alloc()
[all …]
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/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", CRYPTO_ALG_INTERNAL, 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
151 err = crypto_kpp_set_secret(tfm, buf, buf_len); in set_ecdh_privkey()
168 int generate_ecdh_public_key(struct crypto_kpp *tfm, u8 public_key[64]) in generate_ecdh_public_key() argument
180 req = kpp_request_alloc(tfm, GFP_KERNEL); in generate_ecdh_public_key()
221 int generate_ecdh_keys(struct crypto_kpp *tfm, u8 public_key[64]) in generate_ecdh_keys() argument
225 err = set_ecdh_privkey(tfm, NULL); in generate_ecdh_keys()
229 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/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/ipv6/
Dseg6_hmac.c124 struct crypto_shash *tfm; in __do_hmac() local
132 tfm = *this_cpu_ptr(algo->tfms); in __do_hmac()
134 dgsize = crypto_shash_digestsize(tfm); in __do_hmac()
141 ret = crypto_shash_setkey(tfm, hinfo->secret, hinfo->slen); in __do_hmac()
148 shash->tfm = tfm; in __do_hmac()
356 struct crypto_shash *tfm; in seg6_hmac_init_algo() local
372 tfm = crypto_alloc_shash(algo->name, 0, 0); in seg6_hmac_init_algo()
373 if (IS_ERR(tfm)) in seg6_hmac_init_algo()
374 return PTR_ERR(tfm); in seg6_hmac_init_algo()
376 *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.c46 struct crypto_comp *tfm = *per_cpu_ptr(ipcd->tfms, cpu); in ipcomp_decompress() local
47 int err = crypto_comp_decompress(tfm, start, plen, scratch, &dlen); in ipcomp_decompress()
140 struct crypto_comp *tfm; in ipcomp_compress() local
146 tfm = *this_cpu_ptr(ipcd->tfms); in ipcomp_compress()
147 err = crypto_comp_compress(tfm, start, plen, scratch, &dlen); in ipcomp_compress()
266 struct crypto_comp *tfm = *per_cpu_ptr(tfms, cpu); in ipcomp_free_tfms() local
267 crypto_free_comp(tfm); in ipcomp_free_tfms()
280 struct crypto_comp *tfm; in ipcomp_alloc_tfms() local
283 tfm = this_cpu_read(*pos->tfms); in ipcomp_alloc_tfms()
285 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()
139 if (key->tfm) { in ceph_crypto_key_destroy()
140 crypto_free_sync_skcipher(key->tfm); in ceph_crypto_key_destroy()
141 key->tfm = NULL; in ceph_crypto_key_destroy()
221 SYNC_SKCIPHER_REQUEST_ON_STACK(req, key->tfm); in ceph_aes_crypt()
[all …]
Dcrypto.h16 struct crypto_sync_skcipher *tfm; member
/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()
746 SHASH_DESC_ON_STACK(desc, tfm); in sctp_auth_calculate_hmac()
748 desc->tfm = tfm; in sctp_auth_calculate_hmac()
/net/rxrpc/
Drxkad.c152 struct crypto_skcipher *tfm = &call->conn->cipher->base; in rxkad_get_call_crypto() local
156 cipher_req = skcipher_request_alloc(tfm, GFP_NOFS); in rxkad_get_call_crypto()
1258 struct crypto_sync_skcipher *tfm; in rxkad_init() local
1263 tfm = crypto_alloc_sync_skcipher("pcbc(fcrypt)", 0, 0); in rxkad_init()
1264 if (IS_ERR(tfm)) in rxkad_init()
1265 return PTR_ERR(tfm); in rxkad_init()
1267 req = skcipher_request_alloc(&tfm->base, GFP_KERNEL); in rxkad_init()
1272 rxkad_ci = tfm; in rxkad_init()
1276 crypto_free_sync_skcipher(tfm); in rxkad_init()

12