crypto: skcipher - remove the "blkcipher" algorithm type
Now that all "blkcipher" algorithms have been converted to "skcipher",
remove the blkcipher algorithm type.
The skcipher (symmetric key cipher) algorithm type was introduced a few
years ago to replace both blkcipher and ablkcipher (synchronous and
asynchronous block cipher). The advantages of skcipher include:
- A much less confusing name, since none of these algorithm types have
ever actually been for raw block ciphers, but rather for all
length-preserving encryption modes including block cipher modes of
operation, stream ciphers, and other length-preserving modes.
- It unified blkcipher and ablkcipher into a single algorithm type
which supports both synchronous and asynchronous implementations.
Note, blkcipher already operated only on scatterlists, so the fact
that skcipher does too isn't a regression in functionality.
- Better type safety by using struct skcipher_alg, struct
crypto_skcipher, etc. instead of crypto_alg, crypto_tfm, etc.
- It sometimes simplifies the implementations of algorithms.
Also, the blkcipher API was no longer being tested.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
@@ -182,10 +182,6 @@ static inline u32 skcipher_request_flags(struct skcipher_request *req)
|
||||
static inline unsigned int crypto_skcipher_alg_min_keysize(
|
||||
struct skcipher_alg *alg)
|
||||
{
|
||||
if ((alg->base.cra_flags & CRYPTO_ALG_TYPE_MASK) ==
|
||||
CRYPTO_ALG_TYPE_BLKCIPHER)
|
||||
return alg->base.cra_blkcipher.min_keysize;
|
||||
|
||||
if (alg->base.cra_ablkcipher.encrypt)
|
||||
return alg->base.cra_ablkcipher.min_keysize;
|
||||
|
||||
@@ -195,10 +191,6 @@ static inline unsigned int crypto_skcipher_alg_min_keysize(
|
||||
static inline unsigned int crypto_skcipher_alg_max_keysize(
|
||||
struct skcipher_alg *alg)
|
||||
{
|
||||
if ((alg->base.cra_flags & CRYPTO_ALG_TYPE_MASK) ==
|
||||
CRYPTO_ALG_TYPE_BLKCIPHER)
|
||||
return alg->base.cra_blkcipher.max_keysize;
|
||||
|
||||
if (alg->base.cra_ablkcipher.encrypt)
|
||||
return alg->base.cra_ablkcipher.max_keysize;
|
||||
|
||||
@@ -208,10 +200,6 @@ static inline unsigned int crypto_skcipher_alg_max_keysize(
|
||||
static inline unsigned int crypto_skcipher_alg_walksize(
|
||||
struct skcipher_alg *alg)
|
||||
{
|
||||
if ((alg->base.cra_flags & CRYPTO_ALG_TYPE_MASK) ==
|
||||
CRYPTO_ALG_TYPE_BLKCIPHER)
|
||||
return alg->base.cra_blocksize;
|
||||
|
||||
if (alg->base.cra_ablkcipher.encrypt)
|
||||
return alg->base.cra_blocksize;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user