/* File: ima_crypto.c Calculates md5/sha1 file hash, template hash, boot-aggreate hash  */
static int init_desc(struct hash_desc *desc)
/* File: ima_crypto.c Calculates md5/sha1 file hash, template hash, boot-aggreate hash  */
static int init_desc(struct hash_desc *desc)
{
	int rc;
	desc->tfm = crypto_alloc_hash(ima_hash, 0, CRYPTO_ALG_ASYNC);
	if (IS_ERR(desc->tfm)) {
		pr_info("failed to load %s transform: %ld\n",
			ima_hash, PTR_ERR(desc->tfm));
		rc = PTR_ERR(desc->tfm);
		return rc;
	}
	desc->flags = 0;
	rc = crypto_hash_init(desc);
	if (rc)
		crypto_free_hash(desc->tfm);
	return rc;
}