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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 these, the core crypto API automatically sets the
.cra_flags type as well as .cra_type, mainly for its own use (users
shouldn't care about these).

Yet, many algorithms are still explicitly setting their .cra_flags type
and sometimes even .cra_type, which is confusing as this actually does
nothing.  Apparently, people are just copy-and-pasting this from
existing code without understanding it.

Therefore, this patchset removes the useless initializations, as well as
useless type flags passed to the strongly-typed tfm allocators.

This doesn't change any actual behavior, AFAIK.

For now I didn't bother with 'blkcipher' and 'ablkcipher' algorithms,
since those should eventually be migrated to 'skcipher' anyway.

Eric Biggers (6):
  crypto: shash - remove useless setting of type flags
  crypto: ahash - remove useless setting of type flags
  crypto: ahash - remove useless setting of cra_type
  crypto: aead - remove useless setting of type flags
  crypto: skcipher - remove useless setting of type flags
  crypto: remove redundant type flags from tfm allocation

 Documentation/crypto/api-samples.rst          |  2 +-
 arch/arm/crypto/ghash-ce-glue.c               |  5 +--
 arch/arm/crypto/sha1-ce-glue.c                |  1 -
 arch/arm/crypto/sha1_glue.c                   |  1 -
 arch/arm/crypto/sha1_neon_glue.c              |  1 -
 arch/arm/crypto/sha2-ce-glue.c                |  2 -
 arch/arm/crypto/sha256_glue.c                 |  2 -
 arch/arm/crypto/sha256_neon_glue.c            |  2 -
 arch/arm/crypto/sha512-glue.c                 |  2 -
 arch/arm/crypto/sha512-neon-glue.c            |  2 -
 arch/arm64/crypto/aes-glue.c                  |  3 --
 arch/arm64/crypto/ghash-ce-glue.c             |  1 -
 arch/arm64/crypto/sha1-ce-glue.c              |  1 -
 arch/arm64/crypto/sha2-ce-glue.c              |  2 -
 arch/arm64/crypto/sha256-glue.c               |  4 --
 arch/arm64/crypto/sha3-ce-glue.c              |  4 --
 arch/arm64/crypto/sha512-ce-glue.c            |  2 -
 arch/arm64/crypto/sha512-glue.c               |  2 -
 arch/arm64/crypto/sm3-ce-glue.c               |  1 -
 arch/mips/cavium-octeon/crypto/octeon-md5.c   |  1 -
 arch/mips/cavium-octeon/crypto/octeon-sha1.c  |  1 -
 .../mips/cavium-octeon/crypto/octeon-sha256.c |  2 -
 .../mips/cavium-octeon/crypto/octeon-sha512.c |  2 -
 arch/powerpc/crypto/md5-glue.c                |  1 -
 arch/powerpc/crypto/sha1-spe-glue.c           |  1 -
 arch/powerpc/crypto/sha1.c                    |  1 -
 arch/powerpc/crypto/sha256-spe-glue.c         |  2 -
 arch/s390/crypto/aes_s390.c                   |  1 -
 arch/s390/crypto/ghash_s390.c                 |  1 -
 arch/s390/crypto/sha1_s390.c                  |  1 -
 arch/s390/crypto/sha256_s390.c                |  2 -
 arch/s390/crypto/sha512_s390.c                |  2 -
 arch/sparc/crypto/md5_glue.c                  |  1 -
 arch/sparc/crypto/sha1_glue.c                 |  1 -
 arch/sparc/crypto/sha256_glue.c               |  2 -
 arch/sparc/crypto/sha512_glue.c               |  2 -
 arch/x86/crypto/ghash-clmulni-intel_glue.c    |  6 +--
 arch/x86/crypto/poly1305_glue.c               |  1 -
 arch/x86/crypto/sha1-mb/sha1_mb.c             |  8 ++--
 arch/x86/crypto/sha1_ssse3_glue.c             |  4 --
 arch/x86/crypto/sha256-mb/sha256_mb.c         |  9 ++---
 arch/x86/crypto/sha256_ssse3_glue.c           |  8 ----
 arch/x86/crypto/sha512-mb/sha512_mb.c         |  9 ++---
 arch/x86/crypto/sha512_ssse3_glue.c           |  6 ---
 crypto/aegis128.c                             |  1 -
 crypto/aegis128l.c                            |  1 -
 crypto/aegis256.c                             |  1 -
 crypto/crypto_null.c                          |  1 -
 crypto/ghash-generic.c                        |  1 -
 crypto/md4.c                                  |  1 -
 crypto/md5.c                                  |  1 -
 crypto/morus1280.c                            |  1 -
 crypto/morus640.c                             |  1 -
 crypto/poly1305_generic.c                     |  1 -
 crypto/rmd128.c                               |  1 -
 crypto/rmd160.c                               |  1 -
 crypto/rmd256.c                               |  1 -
 crypto/rmd320.c                               |  1 -
 crypto/sha1_generic.c                         |  1 -
 crypto/sha256_generic.c                       |  2 -
 crypto/sha3_generic.c                         |  4 --
 crypto/sha512_generic.c                       |  2 -
 crypto/sm3_generic.c                          |  1 -
 crypto/tgr192.c                               |  3 --
 crypto/wp512.c                                |  3 --
 drivers/crypto/amcc/crypto4xx_core.c          | 18 +++------
 drivers/crypto/atmel-sha.c                    |  4 +-
 drivers/crypto/axis/artpec6_crypto.c          | 28 ++++++--------
 drivers/crypto/bcm/cipher.c                   |  8 ++--
 drivers/crypto/caam/caamhash.c                |  3 +-
 drivers/crypto/ccp/ccp-crypto-aes-cmac.c      |  3 +-
 drivers/crypto/ccp/ccp-crypto-sha.c           |  3 +-
 drivers/crypto/ccree/cc_cipher.c              |  3 +-
 drivers/crypto/ccree/cc_hash.c                |  4 +-
 drivers/crypto/chelsio/chcr_algo.c            |  7 +---
 .../crypto/inside-secure/safexcel_cipher.c    | 14 +++----
 drivers/crypto/inside-secure/safexcel_hash.c  |  3 +-
 drivers/crypto/marvell/hash.c                 |  3 +-
 drivers/crypto/n2_core.c                      |  3 +-
 drivers/crypto/nx/nx-aes-xcbc.c               |  1 -
 drivers/crypto/nx/nx-sha256.c                 |  1 -
 drivers/crypto/nx/nx-sha512.c                 |  1 -
 drivers/crypto/omap-sham.c                    | 36 ++++++------------
 drivers/crypto/padlock-sha.c                  |  8 +---
 drivers/crypto/qce/sha.c                      |  3 +-
 drivers/crypto/s5p-sss.c                      |  9 ++---
 drivers/crypto/sahara.c                       |  6 +--
 drivers/crypto/stm32/stm32-hash.c             | 24 ++++--------
 drivers/crypto/sunxi-ss/sun4i-ss-core.c       | 20 +++-------
 drivers/crypto/talitos.c                      | 37 ++++++-------------
 drivers/crypto/ux500/hash/hash_core.c         | 15 ++------
 drivers/crypto/vmx/ghash.c                    |  2 +-
 drivers/staging/skein/skein_generic.c         |  3 --
 security/keys/dh.c                            |  2 +-
 94 files changed, 104 insertions(+), 313 deletions(-)

-- 
2.18.0




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux