diff options
author | Eric Biggers <ebiggers@google.com> | 2020-05-01 22:31:03 -0700 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2020-05-08 15:32:12 +1000 |
commit | b4a1df65c246c9fb92c724dd9aecd14663a3bd50 (patch) | |
tree | c3df6ea5e884e50db8b63eed0c28000942f03816 /crypto/cmac.c | |
parent | 46b70c03401ad07b74a56b6773b33b9b1907daad (diff) | |
download | linux-crypto-b4a1df65c246c9fb92c724dd9aecd14663a3bd50.tar.gz linux-crypto-b4a1df65c246c9fb92c724dd9aecd14663a3bd50.zip |
crypto: hash - introduce crypto_shash_tfm_digest()
Currently the simplest use of the shash API is to use
crypto_shash_digest() to digest a whole buffer. However, this still
requires allocating a hash descriptor (struct shash_desc). Many users
don't really want to preallocate one and instead just use a one-off
descriptor on the stack like the following:
{
SHASH_DESC_ON_STACK(desc, tfm);
int err;
desc->tfm = tfm;
err = crypto_shash_digest(desc, data, len, out);
shash_desc_zero(desc);
}
Wrap this in a new helper function crypto_shash_tfm_digest() that can be
used instead of the above.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/cmac.c')
0 files changed, 0 insertions, 0 deletions