crypto: skcipher - add helper for simple block cipher modes
authorEric Biggers <ebiggers@google.com>
Fri, 4 Jan 2019 04:16:14 +0000 (20:16 -0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 11 Jan 2019 06:16:57 +0000 (14:16 +0800)
commit0872da16dd632e5d1d3f80388f7ae6fbeb17ad53
treecf221e111a2cfe505066d0f793ddd38fedd11379
parent251b7aea34ba3c4d4fdfa9447695642eb8b8b098
crypto: skcipher - add helper for simple block cipher modes

The majority of skcipher templates (including both the existing ones and
the ones remaining to be converted from the "blkcipher" API) just wrap a
single block cipher algorithm.  This includes cbc, cfb, ctr, ecb, kw,
ofb, and pcbc.  Add a helper function skcipher_alloc_instance_simple()
that handles allocating an skcipher instance for this common case.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/skcipher.c
include/crypto/internal/skcipher.h