Lines Matching refs:tfm
46 struct crypto_shash *tfm; in fsverity_get_hash_alg() local
57 if (likely(smp_load_acquire(&alg->tfm) != NULL)) in fsverity_get_hash_alg()
62 if (alg->tfm != NULL) in fsverity_get_hash_alg()
65 tfm = crypto_alloc_shash(alg->name, 0, 0); in fsverity_get_hash_alg()
66 if (IS_ERR(tfm)) { in fsverity_get_hash_alg()
67 if (PTR_ERR(tfm) == -ENOENT) { in fsverity_get_hash_alg()
76 alg->name, PTR_ERR(tfm)); in fsverity_get_hash_alg()
77 alg = ERR_CAST(tfm); in fsverity_get_hash_alg()
82 if (WARN_ON_ONCE(alg->digest_size != crypto_shash_digestsize(tfm))) in fsverity_get_hash_alg()
84 if (WARN_ON_ONCE(alg->block_size != crypto_shash_blocksize(tfm))) in fsverity_get_hash_alg()
88 alg->name, crypto_shash_driver_name(tfm)); in fsverity_get_hash_alg()
91 smp_store_release(&alg->tfm, tfm); in fsverity_get_hash_alg()
95 crypto_free_shash(tfm); in fsverity_get_hash_alg()
115 SHASH_DESC_ON_STACK(desc, alg->tfm); in fsverity_prepare_hash_state()
120 desc->tfm = alg->tfm; in fsverity_prepare_hash_state()
125 hashstate = kmalloc(crypto_shash_statesize(alg->tfm), GFP_KERNEL); in fsverity_prepare_hash_state()
179 SHASH_DESC_ON_STACK(desc, params->hash_alg->tfm); in fsverity_hash_block()
182 desc->tfm = params->hash_alg->tfm; in fsverity_hash_block()
212 return crypto_shash_tfm_digest(alg->tfm, data, size, out); in fsverity_hash_buffer()