Re: [PATCH 5/6] crypto: skcipher - remove useless setting of type flags

2018-06-30 Thread Gilad Ben-Yossef
On Sun, Jul 1, 2018 at 1:16 AM, Eric Biggers wrote: > From: Eric Biggers > > Some skcipher algorithms set .cra_flags = CRYPTO_ALG_TYPE_SKCIPHER. But > this is redundant with the C structure type ('struct skcipher_alg'), and > crypto_register_skcipher() already sets the type flag automatically,

Re: [PATCH 3/6] crypto: ahash - remove useless setting of cra_type

2018-06-30 Thread Gilad Ben-Yossef
On Sun, Jul 1, 2018 at 1:16 AM, Eric Biggers wrote: > From: Eric Biggers > > Some ahash algorithms set .cra_type = _ahash_type. But this is > redundant with the C structure type ('struct ahash_alg'), and > crypto_register_ahash() already sets the .cra_type automatically. > Apparently the

Re: [PATCH 2/6] crypto: ahash - remove useless setting of type flags

2018-06-30 Thread Gilad Ben-Yossef
On Sun, Jul 1, 2018 at 1:16 AM, Eric Biggers wrote: > From: Eric Biggers > > Many ahash algorithms set .cra_flags = CRYPTO_ALG_TYPE_AHASH. But this > is redundant with the C structure type ('struct ahash_alg'), and > crypto_register_ahash() already sets the type flag automatically, > clearing

[PATCH 6/6] crypto: remove redundant type flags from tfm allocation

2018-06-30 Thread Eric Biggers
From: Eric Biggers Some crypto API users allocating a tfm with crypto_alloc_$FOO() are also specifying the type flags for $FOO, e.g. crypto_alloc_shash() with CRYPTO_ALG_TYPE_SHASH. But, that's redundant since the crypto API will override any specified type flag/mask with the correct ones. So,

[PATCH 1/6] crypto: shash - remove useless setting of type flags

2018-06-30 Thread Eric Biggers
From: Eric Biggers Many shash algorithms set .cra_flags = CRYPTO_ALG_TYPE_SHASH. But this is redundant with the C structure type ('struct shash_alg'), and crypto_register_shash() already sets the type flag automatically, clearing any type flag that was already there. Apparently the useless

[PATCH 3/6] crypto: ahash - remove useless setting of cra_type

2018-06-30 Thread Eric Biggers
From: Eric Biggers Some ahash algorithms set .cra_type = _ahash_type. But this is redundant with the C structure type ('struct ahash_alg'), and crypto_register_ahash() already sets the .cra_type automatically. Apparently the useless assignment has just been copy+pasted around. So, remove the

[PATCH 0/6] crypto: remove redundant type specifications

2018-06-30 Thread Eric Biggers
Originally, algorithms had to declare their type in .cra_flags as a CRYPTO_ALG_TYPE_* value. Some types of algorithms such as "cipher" still have to do this. But now most algorithm types use different top-level C data structures, and different registration and allocation functions. And for

[PATCH 5/6] crypto: skcipher - remove useless setting of type flags

2018-06-30 Thread Eric Biggers
From: Eric Biggers Some skcipher algorithms set .cra_flags = CRYPTO_ALG_TYPE_SKCIPHER. But this is redundant with the C structure type ('struct skcipher_alg'), and crypto_register_skcipher() already sets the type flag automatically, clearing any type flag that was already there. Apparently the

[PATCH 4/6] crypto: aead - remove useless setting of type flags

2018-06-30 Thread Eric Biggers
From: Eric Biggers Some aead algorithms set .cra_flags = CRYPTO_ALG_TYPE_AEAD. But this is redundant with the C structure type ('struct aead_alg'), and crypto_register_aead() already sets the type flag automatically, clearing any type flag that was already there. Apparently the useless

[PATCH 2/6] crypto: ahash - remove useless setting of type flags

2018-06-30 Thread Eric Biggers
From: Eric Biggers Many ahash algorithms set .cra_flags = CRYPTO_ALG_TYPE_AHASH. But this is redundant with the C structure type ('struct ahash_alg'), and crypto_register_ahash() already sets the type flag automatically, clearing any type flag that was already there. Apparently the useless