Lines Matching refs:desc
79 struct shash_desc *desc; in init_desc() local
121 desc = kmalloc(sizeof(*desc) + crypto_shash_descsize(*tfm), in init_desc()
123 if (!desc) in init_desc()
126 desc->tfm = *tfm; in init_desc()
128 rc = crypto_shash_init(desc); in init_desc()
130 kfree(desc); in init_desc()
133 return desc; in init_desc()
142 static void hmac_add_misc(struct shash_desc *desc, struct inode *inode, in hmac_add_misc() argument
172 crypto_shash_update(desc, (const u8 *)&hmac_misc, sizeof(hmac_misc)); in hmac_add_misc()
175 crypto_shash_update(desc, (u8 *)&inode->i_sb->s_uuid, UUID_SIZE); in hmac_add_misc()
176 crypto_shash_final(desc, digest); in hmac_add_misc()
194 struct shash_desc *desc; in evm_calc_hmac_or_hash() local
205 desc = init_desc(type, data->hdr.algo); in evm_calc_hmac_or_hash()
206 if (IS_ERR(desc)) in evm_calc_hmac_or_hash()
207 return PTR_ERR(desc); in evm_calc_hmac_or_hash()
209 data->hdr.length = crypto_shash_digestsize(desc->tfm); in evm_calc_hmac_or_hash()
221 crypto_shash_update(desc, (const u8 *)req_xattr_value, in evm_calc_hmac_or_hash()
238 crypto_shash_update(desc, (const u8 *)xattr_value, xattr_size); in evm_calc_hmac_or_hash()
242 hmac_add_misc(desc, inode, type, data->digest); in evm_calc_hmac_or_hash()
249 kfree(desc); in evm_calc_hmac_or_hash()
336 struct shash_desc *desc; in evm_init_hmac() local
338 desc = init_desc(EVM_XATTR_HMAC, HASH_ALGO_SHA1); in evm_init_hmac()
339 if (IS_ERR(desc)) { in evm_init_hmac()
341 return PTR_ERR(desc); in evm_init_hmac()
344 crypto_shash_update(desc, lsm_xattr->value, lsm_xattr->value_len); in evm_init_hmac()
345 hmac_add_misc(desc, inode, EVM_XATTR_HMAC, hmac_val); in evm_init_hmac()
346 kfree(desc); in evm_init_hmac()