crypto: sha - split sha.h into sha1.h and sha2.h
authorEric Biggers <ebiggers@google.com>
Fri, 13 Nov 2020 05:20:21 +0000 (21:20 -0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 20 Nov 2020 03:45:33 +0000 (14:45 +1100)
commita24d22b225ce158651378869a6b88105c4bdb887
tree810994e166c5472a341136b3140ac9a2ae56440c
parent5bdad829c31a09069fd508534f03c2ea1576ac75
crypto: sha - split sha.h into sha1.h and sha2.h

Currently <crypto/sha.h> contains declarations for both SHA-1 and SHA-2,
and <crypto/sha3.h> contains declarations for SHA-3.

This organization is inconsistent, but more importantly SHA-1 is no
longer considered to be cryptographically secure.  So to the extent
possible, SHA-1 shouldn't be grouped together with any of the other SHA
versions, and usage of it should be phased out.

Therefore, split <crypto/sha.h> into two headers <crypto/sha1.h> and
<crypto/sha2.h>, and make everyone explicitly specify whether they want
the declarations for SHA-1, SHA-2, or both.

This avoids making the SHA-1 declarations visible to files that don't
want anything to do with SHA-1.  It also prepares for potentially moving
sha1.h into a new insecure/ or dangerous/ directory.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
120 files changed:
arch/arm/crypto/sha1-ce-glue.c
arch/arm/crypto/sha1.h
arch/arm/crypto/sha1_glue.c
arch/arm/crypto/sha1_neon_glue.c
arch/arm/crypto/sha2-ce-glue.c
arch/arm/crypto/sha256_glue.c
arch/arm/crypto/sha256_neon_glue.c
arch/arm/crypto/sha512-glue.c
arch/arm/crypto/sha512-neon-glue.c
arch/arm64/crypto/aes-glue.c
arch/arm64/crypto/sha1-ce-glue.c
arch/arm64/crypto/sha2-ce-glue.c
arch/arm64/crypto/sha256-glue.c
arch/arm64/crypto/sha512-ce-glue.c
arch/arm64/crypto/sha512-glue.c
arch/mips/cavium-octeon/crypto/octeon-sha1.c
arch/mips/cavium-octeon/crypto/octeon-sha256.c
arch/mips/cavium-octeon/crypto/octeon-sha512.c
arch/powerpc/crypto/sha1-spe-glue.c
arch/powerpc/crypto/sha1.c
arch/powerpc/crypto/sha256-spe-glue.c
arch/s390/crypto/sha.h
arch/s390/crypto/sha1_s390.c
arch/s390/crypto/sha256_s390.c
arch/s390/crypto/sha3_256_s390.c
arch/s390/crypto/sha3_512_s390.c
arch/s390/crypto/sha512_s390.c
arch/s390/purgatory/purgatory.c
arch/sparc/crypto/sha1_glue.c
arch/sparc/crypto/sha256_glue.c
arch/sparc/crypto/sha512_glue.c
arch/x86/crypto/sha1_ssse3_glue.c
arch/x86/crypto/sha256_ssse3_glue.c
arch/x86/crypto/sha512_ssse3_glue.c
arch/x86/purgatory/purgatory.c
crypto/asymmetric_keys/asym_tpm.c
crypto/sha1_generic.c
crypto/sha256_generic.c
crypto/sha512_generic.c
drivers/char/random.c
drivers/crypto/allwinner/sun4i-ss/sun4i-ss.h
drivers/crypto/allwinner/sun8i-ce/sun8i-ce-hash.c
drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h
drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c
drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h
drivers/crypto/amcc/crypto4xx_alg.c
drivers/crypto/amcc/crypto4xx_core.c
drivers/crypto/atmel-authenc.h
drivers/crypto/atmel-sha.c
drivers/crypto/axis/artpec6_crypto.c
drivers/crypto/bcm/cipher.c
drivers/crypto/bcm/cipher.h
drivers/crypto/bcm/spu.h
drivers/crypto/caam/compat.h
drivers/crypto/cavium/nitrox/nitrox_aead.c
drivers/crypto/ccp/ccp-crypto-sha.c
drivers/crypto/ccp/ccp-crypto.h
drivers/crypto/ccree/cc_driver.h
drivers/crypto/chelsio/chcr_algo.c
drivers/crypto/hisilicon/sec2/sec_crypto.c
drivers/crypto/img-hash.c
drivers/crypto/inside-secure/safexcel.h
drivers/crypto/inside-secure/safexcel_cipher.c
drivers/crypto/inside-secure/safexcel_hash.c
drivers/crypto/ixp4xx_crypto.c
drivers/crypto/marvell/cesa/hash.c
drivers/crypto/marvell/octeontx/otx_cptvf_algs.c
drivers/crypto/mediatek/mtk-sha.c
drivers/crypto/mxs-dcp.c
drivers/crypto/n2_core.c
drivers/crypto/nx/nx-sha256.c
drivers/crypto/nx/nx-sha512.c
drivers/crypto/nx/nx.c
drivers/crypto/omap-sham.c
drivers/crypto/padlock-sha.c
drivers/crypto/picoxcell_crypto.c
drivers/crypto/qat/qat_common/qat_algs.c
drivers/crypto/qce/common.c
drivers/crypto/qce/core.c
drivers/crypto/qce/sha.h
drivers/crypto/rockchip/rk3288_crypto.h
drivers/crypto/s5p-sss.c
drivers/crypto/sa2ul.c
drivers/crypto/sa2ul.h
drivers/crypto/sahara.c
drivers/crypto/stm32/stm32-hash.c
drivers/crypto/talitos.c
drivers/crypto/ux500/hash/hash_core.c
drivers/firmware/efi/embedded-firmware.c
drivers/net/ethernet/chelsio/inline_crypto/ch_ipsec/chcr_ipsec.c
drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls.h
drivers/nfc/s3fwrn5/firmware.c
drivers/tee/tee_core.c
fs/crypto/fname.c
fs/crypto/hkdf.c
fs/ubifs/auth.c
fs/verity/fsverity_private.h
include/crypto/hash_info.h
include/crypto/sha1.h [new file with mode: 0644]
include/crypto/sha1_base.h
include/crypto/sha2.h [moved from include/crypto/sha.h with 77% similarity]
include/crypto/sha256_base.h
include/crypto/sha512_base.h
include/linux/ccp.h
include/linux/filter.h
include/linux/purgatory.h
kernel/crash_core.c
kernel/kexec_core.c
kernel/kexec_file.c
lib/crypto/sha256.c
lib/digsig.c
lib/sha1.c
net/ipv6/seg6_hmac.c
net/mptcp/crypto.c
net/mptcp/options.c
net/mptcp/subflow.c
security/integrity/integrity.h
security/keys/encrypted-keys/encrypted.c
security/keys/trusted-keys/trusted_tpm1.c
sound/soc/codecs/cros_ec_codec.c