Lines Matching defs:alg
383 static struct sdesc_hash *init_sdesc(struct crypto_shash *alg)
388 size = sizeof(struct shash_desc) + crypto_shash_descsize(alg);
392 sdesc->shash.tfm = alg;
396 static int calc_hash(struct crypto_shash *alg,
402 sdesc = init_sdesc(alg);
417 struct crypto_shash *alg;
424 alg = crypto_alloc_shash(hash_alg_name, 0, 0);
425 if(IS_ERR_OR_NULL(alg)) {
426 tloge("can't alloc alg %s, PTR_ERR alg is %ld\n", hash_alg_name, PTR_ERR(alg));
427 return PTR_ERR(alg);
429 ret = calc_hash(alg, data, datalen, out_digest);
432 crypto_free_shash(alg);
433 alg = NULL;
436 crypto_free_shash(alg);
437 alg = NULL;