Lines Matching refs:tfm
212 generate_subkey(struct crypto_cipher *tfm, uint8_t *k1, uint8_t *k2) in generate_subkey() argument
224 crypto_cipher_encrypt_one(tfm, l, const_zero); in generate_subkey()
324 struct crypto_cipher *tfm; in qdf_crypto_aes_128_cmac() local
330 tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); in qdf_crypto_aes_128_cmac()
331 if (IS_ERR(tfm)) { in qdf_crypto_aes_128_cmac()
332 ret = PTR_ERR(tfm); in qdf_crypto_aes_128_cmac()
337 ret = crypto_cipher_setkey(tfm, key, AES_KEYSIZE_128); in qdf_crypto_aes_128_cmac()
340 crypto_free_cipher(tfm); in qdf_crypto_aes_128_cmac()
344 generate_subkey(tfm, k1, k2); in qdf_crypto_aes_128_cmac()
370 crypto_cipher_encrypt_one(tfm, x, y); in qdf_crypto_aes_128_cmac()
374 crypto_cipher_encrypt_one(tfm, x, y); in qdf_crypto_aes_128_cmac()
376 crypto_free_cipher(tfm); in qdf_crypto_aes_128_cmac()
395 static void set_desc_flags(struct shash_desc *desc, struct crypto_shash *tfm) in set_desc_flags() argument
397 desc->flags = crypto_shash_get_flags(tfm); in set_desc_flags()
400 static void set_desc_flags(struct shash_desc *desc, struct crypto_shash *tfm) in set_desc_flags() argument
409 struct crypto_shash *tfm; in qdf_get_keyed_hash() local
413 tfm = crypto_alloc_shash(alg, 0, CRYPTO_ALG_ASYNC); in qdf_get_keyed_hash()
414 if (IS_ERR(tfm)) { in qdf_get_keyed_hash()
417 alg, PTR_ERR(tfm)); in qdf_get_keyed_hash()
422 ret = crypto_shash_setkey(tfm, key, key_len); in qdf_get_keyed_hash()
432 SHASH_DESC_ON_STACK(desc, tfm); in qdf_get_keyed_hash()
433 desc->tfm = tfm; in qdf_get_keyed_hash()
434 set_desc_flags(desc, tfm); in qdf_get_keyed_hash()
463 crypto_free_shash(tfm); in qdf_get_keyed_hash()
544 struct crypto_skcipher *tfm; in qdf_aes_ctr() local
555 tfm = crypto_alloc_skcipher("ctr(aes)", 0, CRYPTO_ALG_ASYNC); in qdf_aes_ctr()
556 if (IS_ERR(tfm)) { in qdf_aes_ctr()
559 PTR_ERR(tfm)); in qdf_aes_ctr()
563 req = skcipher_request_alloc(tfm, GFP_KERNEL); in qdf_aes_ctr()
567 crypto_free_skcipher(tfm); in qdf_aes_ctr()
571 ret = crypto_skcipher_setkey(tfm, key, key_len); in qdf_aes_ctr()
576 crypto_free_skcipher(tfm); in qdf_aes_ctr()
596 crypto_free_skcipher(tfm); in qdf_aes_ctr()
603 struct crypto_ablkcipher *tfm; in qdf_aes_ctr() local
614 tfm = crypto_alloc_ablkcipher("ctr(aes)", 0, CRYPTO_ALG_ASYNC); in qdf_aes_ctr()
615 if (IS_ERR(tfm)) { in qdf_aes_ctr()
618 PTR_ERR(tfm)); in qdf_aes_ctr()
622 req = ablkcipher_request_alloc(tfm, GFP_KERNEL); in qdf_aes_ctr()
626 crypto_free_ablkcipher(tfm); in qdf_aes_ctr()
630 ret = crypto_ablkcipher_setkey(tfm, key, key_len); in qdf_aes_ctr()
635 crypto_free_ablkcipher(tfm); in qdf_aes_ctr()
655 crypto_free_ablkcipher(tfm); in qdf_aes_ctr()
672 struct crypto_aead *tfm; in qdf_crypto_aes_gmac() local
679 tfm = crypto_alloc_aead("gcm(aes)", 0, CRYPTO_ALG_ASYNC); in qdf_crypto_aes_gmac()
680 if (IS_ERR(tfm)) { in qdf_crypto_aes_gmac()
681 ret = PTR_ERR(tfm); in qdf_crypto_aes_gmac()
682 tfm = NULL; in qdf_crypto_aes_gmac()
688 ret = crypto_aead_setkey(tfm, key, key_length); in qdf_crypto_aes_gmac()
695 ret = crypto_aead_setauthsize(tfm, IEEE80211_MMIE_GMAC_MICLEN); in qdf_crypto_aes_gmac()
703 req_size = sizeof(*req) + crypto_aead_reqsize(tfm) + in qdf_crypto_aes_gmac()
711 input = (uint8_t *)req + sizeof(*req) + crypto_aead_reqsize(tfm); in qdf_crypto_aes_gmac()
722 aead_request_set_tfm(req, tfm); in qdf_crypto_aes_gmac()
729 if (tfm) in qdf_crypto_aes_gmac()
730 crypto_free_aead(tfm); in qdf_crypto_aes_gmac()