[dm-devel] [PATCH] dm: switch dm-verity to async hash crypto API

Ondrej Mosnáček omosnacek+linux-crypto at gmail.com
Thu Jan 26 11:34:13 UTC 2017


Hi Gilad,

2017-01-24 15:38 GMT+01:00 Gilad Ben-Yossef <gilad at benyossef.com>:
> -       v->tfm = crypto_alloc_shash(v->alg_name, 0, 0);
> +       v->tfm = crypto_alloc_ahash(v->alg_name, 0, CRYPTO_ALG_ASYNC);

I believe you should pass zero as the mask here. When flags == 0 and
mask == CRYPTO_ALG_ASYNC, you are basically saying "I want only algs
that have flags & CRYPTO_ALG_ASYNC == 0", which means you should only
get ahash tfms that are always synchronous (see [1]). However, since
you set a non-NULL callback in verity_hash_init, I don't think this
was your intention. By setting the mask to zero, you should be able to
get also an actual async tfm.

Thanks,
Ondrej

[1] https://lkml.org/lkml/2016/12/13/904




More information about the dm-devel mailing list