Lines Matching refs:hmac_tfm
48 static int hkdf_extract(struct crypto_shash *hmac_tfm, const u8 *ikm, in hkdf_extract() argument
54 err = crypto_shash_setkey(hmac_tfm, default_salt, HKDF_HASHLEN); in hkdf_extract()
58 return crypto_shash_tfm_digest(hmac_tfm, ikm, ikmlen, prk); in hkdf_extract()
71 struct crypto_shash *hmac_tfm; in fscrypt_init_hkdf() local
75 hmac_tfm = crypto_alloc_shash(HKDF_HMAC_ALG, 0, 0); in fscrypt_init_hkdf()
76 if (IS_ERR(hmac_tfm)) { in fscrypt_init_hkdf()
78 PTR_ERR(hmac_tfm)); in fscrypt_init_hkdf()
79 return PTR_ERR(hmac_tfm); in fscrypt_init_hkdf()
82 if (WARN_ON_ONCE(crypto_shash_digestsize(hmac_tfm) != sizeof(prk))) { in fscrypt_init_hkdf()
87 err = hkdf_extract(hmac_tfm, master_key, master_key_size, prk); in fscrypt_init_hkdf()
91 err = crypto_shash_setkey(hmac_tfm, prk, sizeof(prk)); in fscrypt_init_hkdf()
95 hkdf->hmac_tfm = hmac_tfm; in fscrypt_init_hkdf()
99 crypto_free_shash(hmac_tfm); in fscrypt_init_hkdf()
120 SHASH_DESC_ON_STACK(desc, hkdf->hmac_tfm); in fscrypt_hkdf_expand()
131 desc->tfm = hkdf->hmac_tfm; in fscrypt_hkdf_expand()
181 crypto_free_shash(hkdf->hmac_tfm); in fscrypt_destroy_hkdf()