crypto: sha - split sha.h into sha1.h and sha2.h
Subsystems (58)
Eric Biggers
maintainerPATCH 1/1 crypto: sha - split sha.h into sha1.h and sha2.h
From: Eric Biggers <[email protected]>
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.
---
This is a follow-up from
https://lkml.kernel.org/linux-crypto/[email protected].
This could be split into multiple patches if sha.h were to be kept around temporarily. However, the end state is the same, and the updates to #includes are pretty straightforward. Let me know if multiple patches are preferred.
arch/arm/crypto/sha1-ce-glue.c | 2 +-
arch/arm/crypto/sha1.h | 2 +-
arch/arm/crypto/sha1_glue.c | 2 +-
arch/arm/crypto/sha1_neon_glue.c | 2 +-
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 | 2 +-
arch/arm64/crypto/sha1-ce-glue.c | 2 +-
arch/arm64/crypto/sha2-ce-glue.c | 2 +-
arch/arm64/crypto/sha256-glue.c | 2 +-
arch/arm64/crypto/sha512-ce-glue.c | 2 +-
arch/arm64/crypto/sha512-glue.c | 2 +-
arch/mips/cavium-octeon/crypto/octeon-sha1.c | 2 +-
.../mips/cavium-octeon/crypto/octeon-sha256.c | 2 +-
.../mips/cavium-octeon/crypto/octeon-sha512.c | 2 +-
arch/powerpc/crypto/sha1-spe-glue.c | 2 +-
arch/powerpc/crypto/sha1.c | 2 +-
arch/powerpc/crypto/sha256-spe-glue.c | 2 +-
arch/s390/crypto/sha.h | 3 +-
arch/s390/crypto/sha1_s390.c | 2 +-
arch/s390/crypto/sha256_s390.c | 2 +-
arch/s390/crypto/sha3_256_s390.c | 1 -
arch/s390/crypto/sha3_512_s390.c | 1 -
arch/s390/crypto/sha512_s390.c | 2 +-
arch/s390/purgatory/purgatory.c | 2 +-
arch/sparc/crypto/sha1_glue.c | 2 +-
arch/sparc/crypto/sha256_glue.c | 2 +-
arch/sparc/crypto/sha512_glue.c | 2 +-
arch/x86/crypto/sha1_ssse3_glue.c | 2 +-
arch/x86/crypto/sha256_ssse3_glue.c | 2 +-
arch/x86/crypto/sha512_ssse3_glue.c | 2 +-
arch/x86/purgatory/purgatory.c | 2 +-
crypto/asymmetric_keys/asym_tpm.c | 2 +-
crypto/sha1_generic.c | 2 +-
crypto/sha256_generic.c | 2 +-
crypto/sha512_generic.c | 2 +-
drivers/char/random.c | 2 +-
drivers/crypto/allwinner/sun4i-ss/sun4i-ss.h | 2 +-
.../crypto/allwinner/sun8i-ce/sun8i-ce-hash.c | 3 +-
drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h | 3 +-
.../crypto/allwinner/sun8i-ss/sun8i-ss-hash.c | 3 +-
drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h | 3 +-
drivers/crypto/amcc/crypto4xx_alg.c | 2 +-
drivers/crypto/amcc/crypto4xx_core.c | 2 +-
drivers/crypto/atmel-authenc.h | 3 +-
drivers/crypto/atmel-sha.c | 3 +-
drivers/crypto/axis/artpec6_crypto.c | 3 +-
drivers/crypto/bcm/cipher.c | 3 +-
drivers/crypto/bcm/cipher.h | 3 +-
drivers/crypto/bcm/spu.h | 3 +-
drivers/crypto/caam/compat.h | 3 +-
drivers/crypto/cavium/nitrox/nitrox_aead.c | 1 -
drivers/crypto/ccp/ccp-crypto-sha.c | 3 +-
drivers/crypto/ccp/ccp-crypto.h | 3 +-
drivers/crypto/ccree/cc_driver.h | 3 +-
drivers/crypto/chelsio/chcr_algo.c | 3 +-
drivers/crypto/hisilicon/sec2/sec_crypto.c | 3 +-
drivers/crypto/img-hash.c | 3 +-
drivers/crypto/inside-secure/safexcel.h | 3 +-
.../crypto/inside-secure/safexcel_cipher.c | 3 +-
drivers/crypto/inside-secure/safexcel_hash.c | 3 +-
drivers/crypto/ixp4xx_crypto.c | 2 +-
drivers/crypto/marvell/cesa/hash.c | 3 +-
.../crypto/marvell/octeontx/otx_cptvf_algs.c | 3 +-
drivers/crypto/mediatek/mtk-sha.c | 3 +-
drivers/crypto/mxs-dcp.c | 3 +-
drivers/crypto/n2_core.c | 3 +-
drivers/crypto/nx/nx-sha256.c | 2 +-
drivers/crypto/nx/nx-sha512.c | 2 +-
drivers/crypto/nx/nx.c | 2 +-
drivers/crypto/omap-sham.c | 3 +-
drivers/crypto/padlock-sha.c | 3 +-
drivers/crypto/picoxcell_crypto.c | 3 +-
drivers/crypto/qat/qat_common/qat_algs.c | 3 +-
drivers/crypto/qce/common.c | 3 +-
drivers/crypto/qce/core.c | 1 -
drivers/crypto/qce/sha.h | 3 +-
drivers/crypto/rockchip/rk3288_crypto.h | 3 +-
drivers/crypto/s5p-sss.c | 3 +-
drivers/crypto/sa2ul.c | 3 +-
drivers/crypto/sa2ul.h | 3 +-
drivers/crypto/sahara.c | 3 +-
drivers/crypto/stm32/stm32-hash.c | 3 +-
drivers/crypto/talitos.c | 3 +-
drivers/crypto/ux500/hash/hash_core.c | 3 +-
drivers/firmware/efi/embedded-firmware.c | 2 +-
.../inline_crypto/ch_ipsec/chcr_ipsec.c | 3 +-
.../chelsio/inline_crypto/chtls/chtls.h | 3 +-
drivers/nfc/s3fwrn5/firmware.c | 2 +-
drivers/tee/tee_core.c | 2 +-
fs/crypto/fname.c | 2 +-
fs/crypto/hkdf.c | 2 +-
fs/ubifs/auth.c | 1 -
fs/verity/fsverity_private.h | 2 +-
include/crypto/hash_info.h | 3 +-
include/crypto/sha1.h | 46 +++++++++++++++++++
include/crypto/sha1_base.h | 2 +-
include/crypto/{sha.h => sha2.h} | 41 ++---------------
include/crypto/sha256_base.h | 2 +-
include/crypto/sha512_base.h | 2 +-
include/linux/ccp.h | 3 +-
include/linux/filter.h | 2 +-
include/linux/purgatory.h | 2 +-
kernel/crash_core.c | 2 +-
kernel/kexec_core.c | 1 -
kernel/kexec_file.c | 2 +-
lib/crypto/sha256.c | 2 +-
lib/digsig.c | 2 +-
lib/sha1.c | 2 +-
net/ipv6/seg6_hmac.c | 1 -
net/mptcp/crypto.c | 2 +-
net/mptcp/options.c | 2 +-
net/mptcp/subflow.c | 2 +-
security/integrity/integrity.h | 2 +-
security/keys/encrypted-keys/encrypted.c | 2 +-
security/keys/trusted-keys/trusted_tpm1.c | 2 +-
sound/soc/codecs/cros_ec_codec.c | 2 +-
120 files changed, 205 insertions(+), 155 deletions(-)
create mode 100644 include/crypto/sha1.h
rename include/crypto/{sha.h => sha2.h} (77%)arch/arm/crypto/sha1-ce-glue.c +1 -1
@@ -7,7 +7,7 @@#include <crypto/internal/hash.h> #include <crypto/internal/simd.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <crypto/sha1_base.h> #include <linux/cpufeature.h> #include <linux/crypto.h>
arch/arm/crypto/sha1.h +1 -1
@@ -3,7 +3,7 @@#define ASM_ARM_CRYPTO_SHA1_H #include <linux/crypto.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> extern int sha1_update_arm (struct shash_desc *desc,const u8 *data,unsigned int len);
arch/arm/crypto/sha1_glue.c +1 -1
@@ -15,7 +15,7 @@#include <linux/init.h> #include <linux/module.h> #include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <crypto/sha1_base.h> #include <asm/byteorder.h>
arch/arm/crypto/sha1_neon_glue.c +1 -1
@@ -19,7 +19,7 @@#include <linux/module.h> #include <linux/mm.h> #include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <crypto/sha1_base.h> #include <asm/neon.h> #include <asm/simd.h>
arch/arm/crypto/sha2-ce-glue.c +1 -1
@@ -7,7 +7,7 @@#include <crypto/internal/hash.h> #include <crypto/internal/simd.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/sha256_base.h> #include <linux/cpufeature.h> #include <linux/crypto.h>
arch/arm/crypto/sha256_glue.c +1 -1
@@ -17,7 +17,7 @@#include <linux/mm.h> #include <linux/types.h> #include <linux/string.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/sha256_base.h> #include <asm/simd.h> #include <asm/neon.h>
arch/arm/crypto/sha256_neon_glue.c +1 -1
@@ -13,7 +13,7 @@#include <crypto/internal/simd.h> #include <linux/types.h> #include <linux/string.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/sha256_base.h> #include <asm/byteorder.h> #include <asm/simd.h>
arch/arm/crypto/sha512-glue.c +1 -1
@@ -6,7 +6,7 @@*/ #include <crypto/internal/hash.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/sha512_base.h> #include <linux/crypto.h> #include <linux/module.h>
arch/arm/crypto/sha512-neon-glue.c +1 -1
@@ -7,7 +7,7 @@#include <crypto/internal/hash.h> #include <crypto/internal/simd.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/sha512_base.h> #include <linux/crypto.h> #include <linux/module.h>
arch/arm64/crypto/aes-glue.c +1 -1
@@ -10,7 +10,7 @@#include <asm/simd.h> #include <crypto/aes.h> #include <crypto/ctr.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/internal/hash.h> #include <crypto/internal/simd.h> #include <crypto/internal/skcipher.h>
arch/arm64/crypto/sha1-ce-glue.c +1 -1
@@ -10,7 +10,7 @@#include <asm/unaligned.h> #include <crypto/internal/hash.h> #include <crypto/internal/simd.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <crypto/sha1_base.h> #include <linux/cpufeature.h> #include <linux/crypto.h>
arch/arm64/crypto/sha2-ce-glue.c +1 -1
@@ -10,7 +10,7 @@#include <asm/unaligned.h> #include <crypto/internal/hash.h> #include <crypto/internal/simd.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/sha256_base.h> #include <linux/cpufeature.h> #include <linux/crypto.h>
arch/arm64/crypto/sha256-glue.c +1 -1
@@ -10,7 +10,7 @@#include <asm/simd.h> #include <crypto/internal/hash.h> #include <crypto/internal/simd.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/sha256_base.h> #include <linux/types.h> #include <linux/string.h>
arch/arm64/crypto/sha512-ce-glue.c +1 -1
@@ -14,7 +14,7 @@#include <asm/unaligned.h> #include <crypto/internal/hash.h> #include <crypto/internal/simd.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/sha512_base.h> #include <linux/cpufeature.h> #include <linux/crypto.h>
arch/arm64/crypto/sha512-glue.c +1 -1
@@ -8,7 +8,7 @@#include <crypto/internal/hash.h> #include <linux/types.h> #include <linux/string.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/sha512_base.h> #include <asm/neon.h>
arch/mips/cavium-octeon/crypto/octeon-sha1.c +1 -1
@@ -14,7 +14,7 @@*/ #include <linux/mm.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <linux/init.h> #include <linux/types.h> #include <linux/module.h>
arch/mips/cavium-octeon/crypto/octeon-sha256.c +1 -1
@@ -15,7 +15,7 @@*/ #include <linux/mm.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <linux/init.h> #include <linux/types.h> #include <linux/module.h>
arch/mips/cavium-octeon/crypto/octeon-sha512.c +1 -1
@@ -14,7 +14,7 @@*/ #include <linux/mm.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <linux/init.h> #include <linux/types.h> #include <linux/module.h>
arch/powerpc/crypto/sha1-spe-glue.c +1 -1
@@ -12,7 +12,7 @@#include <linux/module.h> #include <linux/mm.h> #include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <asm/byteorder.h> #include <asm/switch_to.h> #include <linux/hardirq.h>
arch/powerpc/crypto/sha1.c +1 -1
@@ -17,7 +17,7 @@#include <linux/module.h> #include <linux/mm.h> #include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <asm/byteorder.h> void powerpc_sha_transform (u32 *state,const u8 *src);
arch/powerpc/crypto/sha256-spe-glue.c +1 -1
@@ -13,7 +13,7 @@#include <linux/module.h> #include <linux/mm.h> #include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <asm/byteorder.h> #include <asm/switch_to.h> #include <linux/hardirq.h>
arch/s390/crypto/sha.h +2 -1
@@ -11,7 +11,8 @@#define _CRYPTO_ARCH_S390_SHA_H#include <linux/crypto.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/sha3.h> /* must be big enough for the largest SHA variant */
arch/s390/crypto/sha1_s390.c +1 -1
@@ -22,7 +22,7 @@#include <linux/init.h> #include <linux/module.h> #include <linux/cpufeature.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <asm/cpacf.h> #include "sha.h"
arch/s390/crypto/sha256_s390.c +1 -1
@@ -12,7 +12,7 @@#include <linux/init.h> #include <linux/module.h> #include <linux/cpufeature.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <asm/cpacf.h> #include "sha.h"
arch/s390/crypto/sha3_256_s390.c +0 -1
@@ -12,7 +12,6 @@#include <linux/init.h> #include <linux/module.h> #include <linux/cpufeature.h> -#include <crypto/sha.h> #include <crypto/sha3.h> #include <asm/cpacf.h>
arch/s390/crypto/sha3_512_s390.c +0 -1
@@ -11,7 +11,6 @@#include <linux/init.h> #include <linux/module.h> #include <linux/cpufeature.h> -#include <crypto/sha.h> #include <crypto/sha3.h> #include <asm/cpacf.h>
arch/s390/crypto/sha512_s390.c +1 -1
@@ -8,7 +8,7 @@* Author(s): Jan Glauber ([email protected]) */ #include <crypto/internal/hash.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <linux/errno.h> #include <linux/init.h> #include <linux/kernel.h>
arch/s390/purgatory/purgatory.c +1 -1
@@ -9,7 +9,7 @@#include <linux/kexec.h> #include <linux/string.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <asm/purgatory.h> int verify_sha256_digest (void )
arch/sparc/crypto/sha1_glue.c +1 -1
@@ -16,7 +16,7 @@#include <linux/module.h> #include <linux/mm.h> #include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <asm/pstate.h> #include <asm/elf.h>
arch/sparc/crypto/sha256_glue.c +1 -1
@@ -16,7 +16,7 @@#include <linux/module.h> #include <linux/mm.h> #include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <asm/pstate.h> #include <asm/elf.h>
arch/sparc/crypto/sha512_glue.c +1 -1
@@ -15,7 +15,7 @@#include <linux/module.h> #include <linux/mm.h> #include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <asm/pstate.h> #include <asm/elf.h>
arch/x86/crypto/sha1_ssse3_glue.c +1 -1
@@ -22,7 +22,7 @@#include <linux/module.h> #include <linux/mm.h> #include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <crypto/sha1_base.h> #include <asm/simd.h>
arch/x86/crypto/sha256_ssse3_glue.c +1 -1
@@ -35,7 +35,7 @@#include <linux/module.h> #include <linux/mm.h> #include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/sha256_base.h> #include <linux/string.h> #include <asm/simd.h>
arch/x86/crypto/sha512_ssse3_glue.c +1 -1
@@ -34,7 +34,7 @@#include <linux/mm.h> #include <linux/string.h> #include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/sha512_base.h> #include <asm/simd.h>
arch/x86/purgatory/purgatory.c +1 -1
@@ -9,7 +9,7 @@*/ #include <linux/bug.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <asm/purgatory.h> #include "../boot/string.h"
crypto/asymmetric_keys/asym_tpm.c +1 -1
@@ -10,7 +10,7 @@#include <linux/tpm_command.h> #include <crypto/akcipher.h> #include <crypto/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <asm/unaligned.h> #include <keys/asymmetric-subtype.h> #include <keys/trusted_tpm.h>
crypto/sha1_generic.c +1 -1
@@ -16,7 +16,7 @@#include <linux/module.h> #include <linux/mm.h> #include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <crypto/sha1_base.h> #include <asm/byteorder.h>
crypto/sha256_generic.c +1 -1
@@ -12,7 +12,7 @@#include <linux/module.h> #include <linux/mm.h> #include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/sha256_base.h> #include <asm/byteorder.h> #include <asm/unaligned.h>
crypto/sha512_generic.c +1 -1
@@ -12,7 +12,7 @@#include <linux/init.h> #include <linux/crypto.h> #include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/sha512_base.h> #include <linux/percpu.h> #include <asm/byteorder.h>
drivers/char/random.c +1 -1
@@ -336,7 +336,7 @@#include <linux/completion.h> #include <linux/uuid.h> #include <crypto/chacha.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <asm/processor.h> #include <linux/uaccess.h>
drivers/crypto/allwinner/sun4i-ss/sun4i-ss.h +1 -1
@@ -25,7 +25,7 @@#include <linux/pm_runtime.h> #include <crypto/md5.h> #include <crypto/skcipher.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <crypto/hash.h> #include <crypto/internal/hash.h> #include <crypto/internal/skcipher.h>
drivers/crypto/allwinner/sun8i-ce/sun8i-ce-hash.c +2 -1
@@ -13,7 +13,8 @@#include <linux/pm_runtime.h> #include <linux/scatterlist.h> #include <crypto/internal/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/md5.h> #include "sun8i-ce.h"
drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h +2 -1
@@ -16,7 +16,8 @@#include <crypto/internal/hash.h> #include <crypto/md5.h> #include <crypto/rng.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> /* CE Registers */ #define CE_TDQ 0x00
drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c +2 -1
@@ -13,7 +13,8 @@#include <linux/pm_runtime.h> #include <linux/scatterlist.h> #include <crypto/internal/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/md5.h> #include "sun8i-ss.h"
drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h +2 -1
@@ -15,7 +15,8 @@#include <linux/crypto.h> #include <crypto/internal/hash.h> #include <crypto/md5.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #define SS_START 1
drivers/crypto/amcc/crypto4xx_alg.c +1 -1
@@ -20,7 +20,7 @@#include <crypto/aead.h> #include <crypto/aes.h> #include <crypto/gcm.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <crypto/ctr.h> #include <crypto/skcipher.h> #include "crypto4xx_reg_def.h"
drivers/crypto/amcc/crypto4xx_core.c +1 -1
@@ -30,7 +30,7 @@#include <crypto/aes.h> #include <crypto/ctr.h> #include <crypto/gcm.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <crypto/rng.h> #include <crypto/scatterwalk.h> #include <crypto/skcipher.h>
drivers/crypto/atmel-authenc.h +2 -1
@@ -16,7 +16,8 @@#include <crypto/authenc.h> #include <crypto/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include "atmel-sha-regs.h" struct atmel_aes_dev ;
drivers/crypto/atmel-sha.c +2 -1
@@ -33,7 +33,8 @@#include <linux/crypto.h> #include <crypto/scatterwalk.h> #include <crypto/algapi.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/hash.h> #include <crypto/internal/hash.h> #include "atmel-sha-regs.h"
drivers/crypto/axis/artpec6_crypto.c +2 -1
@@ -28,7 +28,8 @@#include <crypto/internal/hash.h> #include <crypto/internal/skcipher.h> #include <crypto/scatterwalk.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/xts.h> /* Max length of a line in all cache levels for Artpec SoCs. */
drivers/crypto/bcm/cipher.c +2 -1
@@ -26,11 +26,12 @@#include <crypto/aes.h> #include <crypto/internal/des.h> #include <crypto/hmac.h> -#include <crypto/sha.h> #include <crypto/md5.h> #include <crypto/authenc.h> #include <crypto/skcipher.h> #include <crypto/hash.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/sha3.h> #include "util.h"
drivers/crypto/bcm/cipher.h +2 -1
@@ -16,7 +16,8 @@#include <crypto/aead.h> #include <crypto/arc4.h> #include <crypto/gcm.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/sha3.h> #include "spu.h"
drivers/crypto/bcm/spu.h +2 -1
@@ -17,7 +17,8 @@#include <linux/types.h> #include <linux/scatterlist.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> enum spu_cipher_alg {CIPHER_ALG_NONE =0x0 ,
drivers/crypto/caam/compat.h +2 -1
@@ -34,7 +34,8 @@#include <crypto/ctr.h> #include <crypto/internal/des.h> #include <crypto/gcm.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/md5.h> #include <crypto/chacha.h> #include <crypto/poly1305.h>
drivers/crypto/cavium/nitrox/nitrox_aead.c +0 -1
@@ -7,7 +7,6 @@#include <crypto/aead.h> #include <crypto/authenc.h> #include <crypto/des.h> -#include <crypto/sha.h> #include <crypto/internal/aead.h> #include <crypto/scatterwalk.h> #include <crypto/gcm.h>
drivers/crypto/ccp/ccp-crypto-sha.c +2 -1
@@ -17,7 +17,8 @@#include <crypto/hash.h> #include <crypto/hmac.h> #include <crypto/internal/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/scatterwalk.h> #include <linux/string.h>
drivers/crypto/ccp/ccp-crypto.h +2 -1
@@ -19,7 +19,8 @@#include <crypto/aead.h> #include <crypto/ctr.h> #include <crypto/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/akcipher.h> #include <crypto/skcipher.h> #include <crypto/internal/rsa.h>
drivers/crypto/ccree/cc_driver.h +2 -1
@@ -17,7 +17,8 @@#include <crypto/algapi.h> #include <crypto/internal/skcipher.h> #include <crypto/aes.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/aead.h> #include <crypto/authenc.h> #include <crypto/hash.h>
drivers/crypto/chelsio/chcr_algo.c +2 -1
@@ -53,7 +53,8 @@#include <crypto/algapi.h> #include <crypto/hash.h> #include <crypto/gcm.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/authenc.h> #include <crypto/ctr.h> #include <crypto/gf128mul.h>
drivers/crypto/hisilicon/sec2/sec_crypto.c +2 -1
@@ -7,7 +7,8 @@#include <crypto/des.h> #include <crypto/hash.h> #include <crypto/internal/aead.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/skcipher.h> #include <crypto/xts.h> #include <linux/crypto.h>
drivers/crypto/img-hash.c +2 -1
@@ -19,7 +19,8 @@#include <crypto/internal/hash.h> #include <crypto/md5.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #define CR_RESET 0#define CR_RESET_SET 1
drivers/crypto/inside-secure/safexcel.h +2 -1
@@ -11,7 +11,8 @@#include <crypto/aead.h> #include <crypto/algapi.h> #include <crypto/internal/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/sha3.h> #include <crypto/skcipher.h> #include <linux/types.h>
drivers/crypto/inside-secure/safexcel_cipher.c +2 -1
@@ -18,7 +18,8 @@#include <crypto/gcm.h> #include <crypto/ghash.h> #include <crypto/poly1305.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/sm3.h> #include <crypto/sm4.h> #include <crypto/xts.h>
drivers/crypto/inside-secure/safexcel_hash.c +2 -1
@@ -8,7 +8,8 @@#include <crypto/aes.h> #include <crypto/hmac.h> #include <crypto/md5.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/sha3.h> #include <crypto/skcipher.h> #include <crypto/sm3.h>
drivers/crypto/ixp4xx_crypto.c +1 -1
@@ -20,7 +20,7 @@#include <crypto/internal/des.h> #include <crypto/aes.h> #include <crypto/hmac.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <crypto/algapi.h> #include <crypto/internal/aead.h> #include <crypto/internal/skcipher.h>
drivers/crypto/marvell/cesa/hash.c +2 -1
@@ -11,7 +11,8 @@#include <crypto/hmac.h> #include <crypto/md5.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <linux/device.h> #include <linux/dma-mapping.h>
drivers/crypto/marvell/octeontx/otx_cptvf_algs.c +2 -1
@@ -13,7 +13,8 @@#include <crypto/cryptd.h> #include <crypto/des.h> #include <crypto/internal/aead.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/xts.h> #include <crypto/scatterwalk.h> #include <linux/rtnetlink.h>
drivers/crypto/mediatek/mtk-sha.c +2 -1
@@ -10,7 +10,8 @@*/ #include <crypto/hmac.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include "mtk-platform.h" #define SHA_ALIGN_MSK (sizeof(u32) - 1)
drivers/crypto/mxs-dcp.c +2 -1
@@ -17,7 +17,8 @@#include <linux/clk.h> #include <crypto/aes.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/internal/hash.h> #include <crypto/internal/skcipher.h> #include <crypto/scatterwalk.h>
drivers/crypto/n2_core.c +2 -1
@@ -15,7 +15,8 @@#include <linux/interrupt.h> #include <linux/crypto.h> #include <crypto/md5.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/aes.h> #include <crypto/internal/des.h> #include <linux/mutex.h>
drivers/crypto/nx/nx-sha256.c +1 -1
@@ -8,7 +8,7 @@*/ #include <crypto/internal/hash.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <linux/module.h> #include <asm/vio.h> #include <asm/byteorder.h>
drivers/crypto/nx/nx-sha512.c +1 -1
@@ -8,7 +8,7 @@*/ #include <crypto/internal/hash.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <linux/module.h> #include <asm/vio.h>
drivers/crypto/nx/nx.c +1 -1
@@ -10,7 +10,7 @@#include <crypto/internal/aead.h> #include <crypto/internal/hash.h> #include <crypto/aes.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/algapi.h> #include <crypto/scatterwalk.h> #include <linux/module.h>
drivers/crypto/omap-sham.c +2 -1
@@ -35,7 +35,8 @@#include <linux/crypto.h> #include <crypto/scatterwalk.h> #include <crypto/algapi.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/hash.h> #include <crypto/hmac.h> #include <crypto/internal/hash.h>
drivers/crypto/padlock-sha.c +2 -1
@@ -9,7 +9,8 @@#include <crypto/internal/hash.h> #include <crypto/padlock.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <linux/err.h> #include <linux/module.h> #include <linux/init.h>
drivers/crypto/picoxcell_crypto.c +2 -1
@@ -8,7 +8,8 @@#include <crypto/authenc.h> #include <crypto/internal/des.h> #include <crypto/md5.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/internal/skcipher.h> #include <linux/clk.h> #include <linux/crypto.h>
drivers/crypto/qat/qat_common/qat_algs.c +2 -1
@@ -6,7 +6,8 @@#include <crypto/internal/aead.h> #include <crypto/internal/skcipher.h> #include <crypto/aes.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/hash.h> #include <crypto/hmac.h> #include <crypto/algapi.h>
drivers/crypto/qce/common.c +2 -1
@@ -7,7 +7,8 @@#include <linux/interrupt.h> #include <linux/types.h> #include <crypto/scatterwalk.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include "cipher.h" #include "common.h"
drivers/crypto/qce/core.c +0 -1
@@ -13,7 +13,6 @@#include <linux/types.h> #include <crypto/algapi.h> #include <crypto/internal/hash.h> -#include <crypto/sha.h> #include "core.h" #include "cipher.h"
drivers/crypto/qce/sha.h +2 -1
@@ -7,7 +7,8 @@#define _SHA_H_#include <crypto/scatterwalk.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include "common.h" #include "core.h"
drivers/crypto/rockchip/rk3288_crypto.h +2 -1
@@ -12,7 +12,8 @@#include <crypto/internal/skcipher.h> #include <crypto/md5.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #define _SBF (v, f) ((v) << (f))
drivers/crypto/s5p-sss.c +2 -1
@@ -30,7 +30,8 @@#include <crypto/hash.h> #include <crypto/md5.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/internal/hash.h> #define _SBF (s, v) ((v) << (s))
drivers/crypto/sa2ul.c +2 -1
@@ -25,7 +25,8 @@#include <crypto/internal/hash.h> #include <crypto/internal/skcipher.h> #include <crypto/scatterwalk.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include "sa2ul.h"
drivers/crypto/sa2ul.h +2 -1
@@ -13,7 +13,8 @@#define _K3_SA2UL_#include <crypto/aes.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #define SA_ENGINE_ENABLE_CONTROL 0x1000
drivers/crypto/sahara.c +2 -1
@@ -15,7 +15,8 @@#include <crypto/internal/hash.h> #include <crypto/internal/skcipher.h> #include <crypto/scatterwalk.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <linux/clk.h> #include <linux/dma-mapping.h>
drivers/crypto/stm32/stm32-hash.c +2 -1
@@ -25,7 +25,8 @@#include <crypto/hash.h> #include <crypto/md5.h> #include <crypto/scatterwalk.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/internal/hash.h> #define HASH_CR 0x00
drivers/crypto/talitos.c +2 -1
@@ -31,7 +31,8 @@#include <crypto/algapi.h> #include <crypto/aes.h> #include <crypto/internal/des.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/md5.h> #include <crypto/internal/aead.h> #include <crypto/authenc.h>
drivers/crypto/ux500/hash/hash_core.c +2 -1
@@ -31,7 +31,8 @@#include <linux/bitops.h> #include <crypto/internal/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/scatterwalk.h> #include <crypto/algapi.h>
drivers/firmware/efi/embedded-firmware.c +1 -1
@@ -12,7 +12,7 @@#include <linux/slab.h> #include <linux/types.h> #include <linux/vmalloc.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> /* Exported for use by lib/test_firmware.c only */ LIST_HEAD (efi_embedded_fw_list);
drivers/net/ethernet/chelsio/inline_crypto/ch_ipsec/chcr_ipsec.c +2 -1
@@ -51,7 +51,8 @@#include <crypto/aes.h> #include <crypto/algapi.h> #include <crypto/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/authenc.h> #include <crypto/internal/aead.h> #include <crypto/null.h>
drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls.h +2 -1
@@ -9,7 +9,8 @@#include <crypto/aes.h> #include <crypto/algapi.h> #include <crypto/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/authenc.h> #include <crypto/ctr.h> #include <crypto/gf128mul.h>
drivers/nfc/s3fwrn5/firmware.c +1 -1
@@ -9,7 +9,7 @@#include <linux/completion.h> #include <linux/firmware.h> #include <crypto/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include "s3fwrn5.h" #include "firmware.h"
drivers/tee/tee_core.c +1 -1
@@ -14,7 +14,7 @@#include <linux/tee_drv.h> #include <linux/uaccess.h> #include <crypto/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include "tee_private.h" #define TEE_NUM_DEVICES 32
fs/crypto/fname.c +1 -1
@@ -14,7 +14,7 @@#include <linux/namei.h> #include <linux/scatterlist.h> #include <crypto/hash.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/skcipher.h> #include "fscrypt_private.h"
fs/crypto/hkdf.c +1 -1
@@ -10,7 +10,7 @@*/ #include <crypto/hash.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include "fscrypt_private.h"
fs/ubifs/auth.c +0 -1
@@ -12,7 +12,6 @@#include <linux/crypto.h> #include <linux/verification.h> #include <crypto/hash.h> -#include <crypto/sha.h> #include <crypto/algapi.h> #include <keys/user-type.h> #include <keys/asymmetric-type.h>
fs/verity/fsverity_private.h +1 -1
@@ -14,7 +14,7 @@#define pr_fmt (fmt) "fs-verity: " fmt -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <linux/fsverity.h> #include <linux/mempool.h>
include/crypto/hash_info.h +2 -1
@@ -8,7 +8,8 @@#ifndef _CRYPTO_HASH_INFO_H#define _CRYPTO_HASH_INFO_H -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/md5.h> #include <crypto/streebog.h>
include/crypto/sha1.h new file +46 -0
46 lines not on this page · raw message
include/crypto/sha1_base.h +1 -1
@@ -9,7 +9,7 @@#define _CRYPTO_SHA1_BASE_H#include <crypto/internal/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <linux/crypto.h> #include <linux/module.h> #include <linux/string.h>
include/crypto/sha2.h renamed from include/crypto/sha.h +4 -37
84 lines not on this page · raw message
include/crypto/sha256_base.h +1 -1
@@ -9,7 +9,7 @@#define _CRYPTO_SHA256_BASE_H#include <crypto/internal/hash.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <linux/crypto.h> #include <linux/module.h> #include <linux/string.h>
include/crypto/sha512_base.h +1 -1
@@ -9,7 +9,7 @@#define _CRYPTO_SHA512_BASE_H#include <crypto/internal/hash.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <linux/crypto.h> #include <linux/module.h> #include <linux/string.h>
include/linux/ccp.h +2 -1
@@ -15,7 +15,8 @@#include <linux/workqueue.h> #include <linux/list.h> #include <crypto/aes.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> struct ccp_device ;struct ccp_cmd ;
include/linux/filter.h +1 -1
@@ -21,7 +21,7 @@#include <linux/if_vlan.h> #include <linux/vmalloc.h> #include <linux/sockptr.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <net/sch_generic.h>
include/linux/purgatory.h +1 -1
@@ -3,7 +3,7 @@#define _LINUX_PURGATORY_H#include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <uapi/linux/kexec.h> struct kexec_sha_region {
kernel/crash_core.c +1 -1
@@ -11,7 +11,7 @@#include <asm/page.h> #include <asm/sections.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> /* vmcoreinfo stuff */ unsigned char *vmcoreinfo_data;
kernel/kexec_core.c +0 -1
@@ -42,7 +42,6 @@#include <asm/sections.h> #include <crypto/hash.h> -#include <crypto/sha.h> #include "kexec_internal.h" DEFINE_MUTEX (kexec_mutex);
kernel/kexec_file.c +1 -1
@@ -20,7 +20,7 @@#include <linux/fs.h> #include <linux/ima.h> #include <crypto/hash.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <linux/elf.h> #include <linux/elfcore.h> #include <linux/kernel.h>
lib/crypto/sha256.c +1 -1
@@ -15,7 +15,7 @@#include <linux/export.h> #include <linux/module.h> #include <linux/string.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <asm/unaligned.h> static const u32 SHA256_K [] = {
lib/digsig.c +1 -1
@@ -20,7 +20,7 @@#include <linux/key.h> #include <linux/crypto.h> #include <crypto/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <keys/user-type.h> #include <linux/mpi.h> #include <linux/digsig.h>
lib/sha1.c +1 -1
@@ -9,7 +9,7 @@#include <linux/kernel.h> #include <linux/export.h> #include <linux/bitops.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <asm/unaligned.h> /*
net/ipv6/seg6_hmac.c +0 -1
@@ -35,7 +35,6 @@#include <net/xfrm.h> #include <crypto/hash.h> -#include <crypto/sha.h> #include <net/seg6.h> #include <net/genetlink.h> #include <net/seg6_hmac.h>
net/mptcp/crypto.c +1 -1
@@ -21,7 +21,7 @@*/ #include <linux/kernel.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <asm/unaligned.h> #include "protocol.h"
net/mptcp/options.c +1 -1
@@ -7,7 +7,7 @@#define pr_fmt (fmt) "MPTCP: " fmt#include <linux/kernel.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <net/tcp.h> #include <net/mptcp.h> #include "protocol.h"
net/mptcp/subflow.c +1 -1
@@ -10,7 +10,7 @@#include <linux/module.h> #include <linux/netdevice.h> #include <crypto/algapi.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <net/sock.h> #include <net/inet_common.h> #include <net/inet_hashtables.h>
security/integrity/integrity.h +1 -1
@@ -14,7 +14,7 @@#include <linux/types.h> #include <linux/integrity.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <linux/key.h> #include <linux/audit.h>
security/keys/encrypted-keys/encrypted.c +1 -1
@@ -29,7 +29,7 @@#include <crypto/aes.h> #include <crypto/algapi.h> #include <crypto/hash.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/skcipher.h> #include "encrypted.h"
security/keys/trusted-keys/trusted_tpm1.c +1 -1
@@ -22,7 +22,7 @@#include <linux/rcupdate.h> #include <linux/crypto.h> #include <crypto/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <linux/capability.h> #include <linux/tpm.h> #include <linux/tpm_command.h>
sound/soc/codecs/cros_ec_codec.c +1 -1
@@ -8,7 +8,7 @@* EC for audio function. */ -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <linux/acpi.h> #include <linux/delay.h> #include <linux/device.h>
Signature · 1 line
2.29.2
Quoted 22 lines · Eric Biggers
From: Eric Biggers <[email protected]>
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.hinto a new insecure/ or dangerous/ directory.Signed-off-by Eric Biggers <[email protected]>---
Quoted 8 lines
This is a follow-up from
https://lkml.kernel.org/linux-crypto/[email protected].This could be split into multiple patches if
sha.hwere to be kept around temporarily. However, the end state is the same, and the updates to #includes are pretty straightforward. Let me know if multiple patches are preferred.
Fine as is, IMHO.
Quoted 1,852 lines
arch/arm/crypto/sha1-ce-glue.c | 2 +- arch/arm/crypto/sha1.h | 2 +- arch/arm/crypto/sha1_glue.c | 2 +- arch/arm/crypto/sha1_neon_glue.c | 2 +- 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 | 2 +- arch/arm64/crypto/sha1-ce-glue.c | 2 +- arch/arm64/crypto/sha2-ce-glue.c | 2 +- arch/arm64/crypto/sha256-glue.c | 2 +- arch/arm64/crypto/sha512-ce-glue.c | 2 +- arch/arm64/crypto/sha512-glue.c | 2 +- arch/mips/cavium-octeon/crypto/octeon-sha1.c | 2 +- .../mips/cavium-octeon/crypto/octeon-sha256.c | 2 +- .../mips/cavium-octeon/crypto/octeon-sha512.c | 2 +- arch/powerpc/crypto/sha1-spe-glue.c | 2 +- arch/powerpc/crypto/sha1.c | 2 +- arch/powerpc/crypto/sha256-spe-glue.c | 2 +- arch/s390/crypto/sha.h | 3 +- arch/s390/crypto/sha1_s390.c | 2 +- arch/s390/crypto/sha256_s390.c | 2 +- arch/s390/crypto/sha3_256_s390.c | 1 - arch/s390/crypto/sha3_512_s390.c | 1 - arch/s390/crypto/sha512_s390.c | 2 +- arch/s390/purgatory/purgatory.c | 2 +- arch/sparc/crypto/sha1_glue.c | 2 +- arch/sparc/crypto/sha256_glue.c | 2 +- arch/sparc/crypto/sha512_glue.c | 2 +- arch/x86/crypto/sha1_ssse3_glue.c | 2 +- arch/x86/crypto/sha256_ssse3_glue.c | 2 +- arch/x86/crypto/sha512_ssse3_glue.c | 2 +- arch/x86/purgatory/purgatory.c | 2 +- crypto/asymmetric_keys/asym_tpm.c | 2 +- crypto/sha1_generic.c | 2 +- crypto/sha256_generic.c | 2 +- crypto/sha512_generic.c | 2 +- drivers/char/random.c | 2 +- drivers/crypto/allwinner/sun4i-ss/sun4i-ss.h | 2 +- .../crypto/allwinner/sun8i-ce/sun8i-ce-hash.c | 3 +- drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h | 3 +- .../crypto/allwinner/sun8i-ss/sun8i-ss-hash.c | 3 +- drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h | 3 +- drivers/crypto/amcc/crypto4xx_alg.c | 2 +- drivers/crypto/amcc/crypto4xx_core.c | 2 +- drivers/crypto/atmel-authenc.h | 3 +- drivers/crypto/atmel-sha.c | 3 +- drivers/crypto/axis/artpec6_crypto.c | 3 +- drivers/crypto/bcm/cipher.c | 3 +- drivers/crypto/bcm/cipher.h | 3 +- drivers/crypto/bcm/spu.h | 3 +- drivers/crypto/caam/compat.h | 3 +- drivers/crypto/cavium/nitrox/nitrox_aead.c | 1 - drivers/crypto/ccp/ccp-crypto-sha.c | 3 +- drivers/crypto/ccp/ccp-crypto.h | 3 +- drivers/crypto/ccree/cc_driver.h | 3 +- drivers/crypto/chelsio/chcr_algo.c | 3 +- drivers/crypto/hisilicon/sec2/sec_crypto.c | 3 +- drivers/crypto/img-hash.c | 3 +- drivers/crypto/inside-secure/safexcel.h | 3 +- .../crypto/inside-secure/safexcel_cipher.c | 3 +- drivers/crypto/inside-secure/safexcel_hash.c | 3 +- drivers/crypto/ixp4xx_crypto.c | 2 +- drivers/crypto/marvell/cesa/hash.c | 3 +- .../crypto/marvell/octeontx/otx_cptvf_algs.c | 3 +- drivers/crypto/mediatek/mtk-sha.c | 3 +- drivers/crypto/mxs-dcp.c | 3 +- drivers/crypto/n2_core.c | 3 +- drivers/crypto/nx/nx-sha256.c | 2 +- drivers/crypto/nx/nx-sha512.c | 2 +- drivers/crypto/nx/nx.c | 2 +- drivers/crypto/omap-sham.c | 3 +- drivers/crypto/padlock-sha.c | 3 +- drivers/crypto/picoxcell_crypto.c | 3 +- drivers/crypto/qat/qat_common/qat_algs.c | 3 +- drivers/crypto/qce/common.c | 3 +- drivers/crypto/qce/core.c | 1 - drivers/crypto/qce/sha.h | 3 +- drivers/crypto/rockchip/rk3288_crypto.h | 3 +- drivers/crypto/s5p-sss.c | 3 +- drivers/crypto/sa2ul.c | 3 +- drivers/crypto/sa2ul.h | 3 +- drivers/crypto/sahara.c | 3 +- drivers/crypto/stm32/stm32-hash.c | 3 +- drivers/crypto/talitos.c | 3 +- drivers/crypto/ux500/hash/hash_core.c | 3 +- drivers/firmware/efi/embedded-firmware.c | 2 +- .../inline_crypto/ch_ipsec/chcr_ipsec.c | 3 +- .../chelsio/inline_crypto/chtls/chtls.h | 3 +- drivers/nfc/s3fwrn5/firmware.c | 2 +- drivers/tee/tee_core.c | 2 +- fs/crypto/fname.c | 2 +- fs/crypto/hkdf.c | 2 +- fs/ubifs/auth.c | 1 - fs/verity/fsverity_private.h | 2 +- include/crypto/hash_info.h | 3 +- include/crypto/sha1.h | 46 +++++++++++++++++++ include/crypto/sha1_base.h | 2 +- include/crypto/{sha.h => sha2.h} | 41 ++--------------- include/crypto/sha256_base.h | 2 +- include/crypto/sha512_base.h | 2 +- include/linux/ccp.h | 3 +- include/linux/filter.h | 2 +- include/linux/purgatory.h | 2 +- kernel/crash_core.c | 2 +- kernel/kexec_core.c | 1 - kernel/kexec_file.c | 2 +- lib/crypto/sha256.c | 2 +- lib/digsig.c | 2 +- lib/sha1.c | 2 +- net/ipv6/seg6_hmac.c | 1 - net/mptcp/crypto.c | 2 +- net/mptcp/options.c | 2 +- net/mptcp/subflow.c | 2 +- security/integrity/integrity.h | 2 +- security/keys/encrypted-keys/encrypted.c | 2 +- security/keys/trusted-keys/trusted_tpm1.c | 2 +- sound/soc/codecs/cros_ec_codec.c | 2 +- 120 files changed, 205 insertions(+), 155 deletions(-) create mode 100644 include/crypto/sha1.h rename include/crypto/{sha.h => sha2.h} (77%)arch/arm/crypto/sha1-ce-glue.c +1
-1@@ -7,7 +7,7 @@#include <crypto/internal/hash.h> #include <crypto/internal/simd.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <crypto/sha1_base.h> #include <linux/cpufeature.h> #include <linux/crypto.h> arch/arm/crypto/sha1.h +1
-1@@ -3,7 +3,7 @@#define ASM_ARM_CRYPTO_SHA1_H #include <linux/crypto.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> extern int sha1_update_arm (struct shash_desc *desc,const u8 *data,unsigned int len);arch/arm/crypto/sha1_glue.c +1
-1@@ -15,7 +15,7 @@#include <linux/init.h> #include <linux/module.h> #include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <crypto/sha1_base.h> #include <asm/byteorder.h> arch/arm/crypto/sha1_neon_glue.c +1
-1@@ -19,7 +19,7 @@#include <linux/module.h> #include <linux/mm.h> #include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <crypto/sha1_base.h> #include <asm/neon.h> #include <asm/simd.h> arch/arm/crypto/sha2-ce-glue.c +1
-1@@ -7,7 +7,7 @@#include <crypto/internal/hash.h> #include <crypto/internal/simd.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/sha256_base.h> #include <linux/cpufeature.h> #include <linux/crypto.h> arch/arm/crypto/sha256_glue.c +1
-1@@ -17,7 +17,7 @@#include <linux/mm.h> #include <linux/types.h> #include <linux/string.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/sha256_base.h> #include <asm/simd.h> #include <asm/neon.h> arch/arm/crypto/sha256_neon_glue.c +1
-1@@ -13,7 +13,7 @@#include <crypto/internal/simd.h> #include <linux/types.h> #include <linux/string.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/sha256_base.h> #include <asm/byteorder.h> #include <asm/simd.h> arch/arm/crypto/sha512-glue.c +1
-1@@ -6,7 +6,7 @@*/ #include <crypto/internal/hash.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/sha512_base.h> #include <linux/crypto.h> #include <linux/module.h> arch/arm/crypto/sha512-neon-glue.c +1
-1@@ -7,7 +7,7 @@#include <crypto/internal/hash.h> #include <crypto/internal/simd.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/sha512_base.h> #include <linux/crypto.h> #include <linux/module.h> arch/arm64/crypto/aes-glue.c +1
-1@@ -10,7 +10,7 @@#include <asm/simd.h> #include <crypto/aes.h> #include <crypto/ctr.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/internal/hash.h> #include <crypto/internal/simd.h> #include <crypto/internal/skcipher.h> arch/arm64/crypto/sha1-ce-glue.c +1
-1@@ -10,7 +10,7 @@#include <asm/unaligned.h> #include <crypto/internal/hash.h> #include <crypto/internal/simd.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <crypto/sha1_base.h> #include <linux/cpufeature.h> #include <linux/crypto.h> arch/arm64/crypto/sha2-ce-glue.c +1
-1@@ -10,7 +10,7 @@#include <asm/unaligned.h> #include <crypto/internal/hash.h> #include <crypto/internal/simd.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/sha256_base.h> #include <linux/cpufeature.h> #include <linux/crypto.h> arch/arm64/crypto/sha256-glue.c +1
-1@@ -10,7 +10,7 @@#include <asm/simd.h> #include <crypto/internal/hash.h> #include <crypto/internal/simd.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/sha256_base.h> #include <linux/types.h> #include <linux/string.h> arch/arm64/crypto/sha512-ce-glue.c +1
-1@@ -14,7 +14,7 @@#include <asm/unaligned.h> #include <crypto/internal/hash.h> #include <crypto/internal/simd.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/sha512_base.h> #include <linux/cpufeature.h> #include <linux/crypto.h> arch/arm64/crypto/sha512-glue.c +1
-1@@ -8,7 +8,7 @@#include <crypto/internal/hash.h> #include <linux/types.h> #include <linux/string.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/sha512_base.h> #include <asm/neon.h> arch/mips/cavium-octeon/crypto/octeon-sha1.c +1
-1@@ -14,7 +14,7 @@*/ #include <linux/mm.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <linux/init.h> #include <linux/types.h> #include <linux/module.h> arch/mips/cavium-octeon/crypto/octeon-sha256.c +1
-1@@ -15,7 +15,7 @@*/ #include <linux/mm.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <linux/init.h> #include <linux/types.h> #include <linux/module.h> arch/mips/cavium-octeon/crypto/octeon-sha512.c +1
-1@@ -14,7 +14,7 @@*/ #include <linux/mm.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <linux/init.h> #include <linux/types.h> #include <linux/module.h> arch/powerpc/crypto/sha1-spe-glue.c +1
-1@@ -12,7 +12,7 @@#include <linux/module.h> #include <linux/mm.h> #include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <asm/byteorder.h> #include <asm/switch_to.h> #include <linux/hardirq.h> arch/powerpc/crypto/sha1.c +1
-1@@ -17,7 +17,7 @@#include <linux/module.h> #include <linux/mm.h> #include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <asm/byteorder.h> void powerpc_sha_transform (u32 *state,const u8 *src);arch/powerpc/crypto/sha256-spe-glue.c +1
-1@@ -13,7 +13,7 @@#include <linux/module.h> #include <linux/mm.h> #include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <asm/byteorder.h> #include <asm/switch_to.h> #include <linux/hardirq.h> arch/s390/crypto/sha.h +2
-1@@ -11,7 +11,8 @@#define _CRYPTO_ARCH_S390_SHA_H#include <linux/crypto.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/sha3.h> /* must be big enough for the largest SHA variant */ arch/s390/crypto/sha1_s390.c +1
-1@@ -22,7 +22,7 @@#include <linux/init.h> #include <linux/module.h> #include <linux/cpufeature.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <asm/cpacf.h> #include "sha.h" arch/s390/crypto/sha256_s390.c +1
-1@@ -12,7 +12,7 @@#include <linux/init.h> #include <linux/module.h> #include <linux/cpufeature.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <asm/cpacf.h> #include "sha.h" arch/s390/crypto/sha3_256_s390.c +0
-1@@ -12,7 +12,6 @@#include <linux/init.h> #include <linux/module.h> #include <linux/cpufeature.h> -#include <crypto/sha.h> #include <crypto/sha3.h> #include <asm/cpacf.h> arch/s390/crypto/sha3_512_s390.c +0
-1@@ -11,7 +11,6 @@#include <linux/init.h> #include <linux/module.h> #include <linux/cpufeature.h> -#include <crypto/sha.h> #include <crypto/sha3.h> #include <asm/cpacf.h> arch/s390/crypto/sha512_s390.c +1
-1@@ -8,7 +8,7 @@* Author(s): Jan Glauber ([email protected]) */ #include <crypto/internal/hash.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <linux/errno.h> #include <linux/init.h> #include <linux/kernel.h> arch/s390/purgatory/purgatory.c +1
-1@@ -9,7 +9,7 @@#include <linux/kexec.h> #include <linux/string.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <asm/purgatory.h> int verify_sha256_digest (void )arch/sparc/crypto/sha1_glue.c +1
-1@@ -16,7 +16,7 @@#include <linux/module.h> #include <linux/mm.h> #include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <asm/pstate.h> #include <asm/elf.h> arch/sparc/crypto/sha256_glue.c +1
-1@@ -16,7 +16,7 @@#include <linux/module.h> #include <linux/mm.h> #include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <asm/pstate.h> #include <asm/elf.h> arch/sparc/crypto/sha512_glue.c +1
-1@@ -15,7 +15,7 @@#include <linux/module.h> #include <linux/mm.h> #include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <asm/pstate.h> #include <asm/elf.h> arch/x86/crypto/sha1_ssse3_glue.c +1
-1@@ -22,7 +22,7 @@#include <linux/module.h> #include <linux/mm.h> #include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <crypto/sha1_base.h> #include <asm/simd.h> arch/x86/crypto/sha256_ssse3_glue.c +1
-1@@ -35,7 +35,7 @@#include <linux/module.h> #include <linux/mm.h> #include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/sha256_base.h> #include <linux/string.h> #include <asm/simd.h> arch/x86/crypto/sha512_ssse3_glue.c +1
-1@@ -34,7 +34,7 @@#include <linux/mm.h> #include <linux/string.h> #include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/sha512_base.h> #include <asm/simd.h> arch/x86/purgatory/purgatory.c +1
-1@@ -9,7 +9,7 @@*/ #include <linux/bug.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <asm/purgatory.h> #include "../boot/string.h" crypto/asymmetric_keys/asym_tpm.c +1
-1@@ -10,7 +10,7 @@#include <linux/tpm_command.h> #include <crypto/akcipher.h> #include <crypto/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <asm/unaligned.h> #include <keys/asymmetric-subtype.h> #include <keys/trusted_tpm.h> crypto/sha1_generic.c +1
-1@@ -16,7 +16,7 @@#include <linux/module.h> #include <linux/mm.h> #include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <crypto/sha1_base.h> #include <asm/byteorder.h> crypto/sha256_generic.c +1
-1@@ -12,7 +12,7 @@#include <linux/module.h> #include <linux/mm.h> #include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/sha256_base.h> #include <asm/byteorder.h> #include <asm/unaligned.h> crypto/sha512_generic.c +1
-1@@ -12,7 +12,7 @@#include <linux/init.h> #include <linux/crypto.h> #include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/sha512_base.h> #include <linux/percpu.h> #include <asm/byteorder.h> drivers/char/random.c +1
-1@@ -336,7 +336,7 @@#include <linux/completion.h> #include <linux/uuid.h> #include <crypto/chacha.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <asm/processor.h> #include <linux/uaccess.h> drivers/crypto/allwinner/sun4i-ss/sun4i-ss.h +1
-1@@ -25,7 +25,7 @@#include <linux/pm_runtime.h> #include <crypto/md5.h> #include <crypto/skcipher.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <crypto/hash.h> #include <crypto/internal/hash.h> #include <crypto/internal/skcipher.h> drivers/crypto/allwinner/sun8i-ce/sun8i-ce-hash.c +2
-1@@ -13,7 +13,8 @@#include <linux/pm_runtime.h> #include <linux/scatterlist.h> #include <crypto/internal/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/md5.h> #include "sun8i-ce.h" drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h +2
-1@@ -16,7 +16,8 @@#include <crypto/internal/hash.h> #include <crypto/md5.h> #include <crypto/rng.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> /* CE Registers */ #define CE_TDQ 0x00drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c +2
-1@@ -13,7 +13,8 @@#include <linux/pm_runtime.h> #include <linux/scatterlist.h> #include <crypto/internal/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/md5.h> #include "sun8i-ss.h" drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h +2
-1@@ -15,7 +15,8 @@#include <linux/crypto.h> #include <crypto/internal/hash.h> #include <crypto/md5.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #define SS_START 1drivers/crypto/amcc/crypto4xx_alg.c +1
-1@@ -20,7 +20,7 @@#include <crypto/aead.h> #include <crypto/aes.h> #include <crypto/gcm.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <crypto/ctr.h> #include <crypto/skcipher.h> #include "crypto4xx_reg_def.h" drivers/crypto/amcc/crypto4xx_core.c +1
-1@@ -30,7 +30,7 @@#include <crypto/aes.h> #include <crypto/ctr.h> #include <crypto/gcm.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <crypto/rng.h> #include <crypto/scatterwalk.h> #include <crypto/skcipher.h> drivers/crypto/atmel-authenc.h +2
-1@@ -16,7 +16,8 @@#include <crypto/authenc.h> #include <crypto/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include "atmel-sha-regs.h" struct atmel_aes_dev ;drivers/crypto/atmel-sha.c +2
-1@@ -33,7 +33,8 @@#include <linux/crypto.h> #include <crypto/scatterwalk.h> #include <crypto/algapi.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/hash.h> #include <crypto/internal/hash.h> #include "atmel-sha-regs.h" drivers/crypto/axis/artpec6_crypto.c +2
-1@@ -28,7 +28,8 @@#include <crypto/internal/hash.h> #include <crypto/internal/skcipher.h> #include <crypto/scatterwalk.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/xts.h> /* Max length of a line in all cache levels for Artpec SoCs. */ drivers/crypto/bcm/cipher.c +2
-1@@ -26,11 +26,12 @@#include <crypto/aes.h> #include <crypto/internal/des.h> #include <crypto/hmac.h> -#include <crypto/sha.h> #include <crypto/md5.h> #include <crypto/authenc.h> #include <crypto/skcipher.h> #include <crypto/hash.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/sha3.h> #include "util.h" drivers/crypto/bcm/cipher.h +2
-1@@ -16,7 +16,8 @@#include <crypto/aead.h> #include <crypto/arc4.h> #include <crypto/gcm.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/sha3.h> #include "spu.h" drivers/crypto/bcm/spu.h +2
-1@@ -17,7 +17,8 @@#include <linux/types.h> #include <linux/scatterlist.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> enum spu_cipher_alg {CIPHER_ALG_NONE =0x0 ,drivers/crypto/caam/compat.h +2
-1@@ -34,7 +34,8 @@#include <crypto/ctr.h> #include <crypto/internal/des.h> #include <crypto/gcm.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/md5.h> #include <crypto/chacha.h> #include <crypto/poly1305.h> drivers/crypto/cavium/nitrox/nitrox_aead.c +0
-1@@ -7,7 +7,6 @@#include <crypto/aead.h> #include <crypto/authenc.h> #include <crypto/des.h> -#include <crypto/sha.h> #include <crypto/internal/aead.h> #include <crypto/scatterwalk.h> #include <crypto/gcm.h> drivers/crypto/ccp/ccp-crypto-sha.c +2
-1@@ -17,7 +17,8 @@#include <crypto/hash.h> #include <crypto/hmac.h> #include <crypto/internal/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/scatterwalk.h> #include <linux/string.h> drivers/crypto/ccp/ccp-crypto.h +2
-1@@ -19,7 +19,8 @@#include <crypto/aead.h> #include <crypto/ctr.h> #include <crypto/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/akcipher.h> #include <crypto/skcipher.h> #include <crypto/internal/rsa.h> drivers/crypto/ccree/cc_driver.h +2
-1@@ -17,7 +17,8 @@#include <crypto/algapi.h> #include <crypto/internal/skcipher.h> #include <crypto/aes.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/aead.h> #include <crypto/authenc.h> #include <crypto/hash.h> drivers/crypto/chelsio/chcr_algo.c +2
-1@@ -53,7 +53,8 @@#include <crypto/algapi.h> #include <crypto/hash.h> #include <crypto/gcm.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/authenc.h> #include <crypto/ctr.h> #include <crypto/gf128mul.h> drivers/crypto/hisilicon/sec2/sec_crypto.c +2
-1@@ -7,7 +7,8 @@#include <crypto/des.h> #include <crypto/hash.h> #include <crypto/internal/aead.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/skcipher.h> #include <crypto/xts.h> #include <linux/crypto.h> drivers/crypto/img-hash.c +2
-1@@ -19,7 +19,8 @@#include <crypto/internal/hash.h> #include <crypto/md5.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #define CR_RESET 0#define CR_RESET_SET 1drivers/crypto/inside-secure/safexcel.h +2
-1@@ -11,7 +11,8 @@#include <crypto/aead.h> #include <crypto/algapi.h> #include <crypto/internal/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/sha3.h> #include <crypto/skcipher.h> #include <linux/types.h> drivers/crypto/inside-secure/safexcel_cipher.c +2
-1@@ -18,7 +18,8 @@#include <crypto/gcm.h> #include <crypto/ghash.h> #include <crypto/poly1305.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/sm3.h> #include <crypto/sm4.h> #include <crypto/xts.h> drivers/crypto/inside-secure/safexcel_hash.c +2
-1@@ -8,7 +8,8 @@#include <crypto/aes.h> #include <crypto/hmac.h> #include <crypto/md5.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/sha3.h> #include <crypto/skcipher.h> #include <crypto/sm3.h> drivers/crypto/ixp4xx_crypto.c +1
-1@@ -20,7 +20,7 @@#include <crypto/internal/des.h> #include <crypto/aes.h> #include <crypto/hmac.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <crypto/algapi.h> #include <crypto/internal/aead.h> #include <crypto/internal/skcipher.h> drivers/crypto/marvell/cesa/hash.c +2
-1@@ -11,7 +11,8 @@#include <crypto/hmac.h> #include <crypto/md5.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <linux/device.h> #include <linux/dma-mapping.h> drivers/crypto/marvell/octeontx/otx_cptvf_algs.c +2
-1@@ -13,7 +13,8 @@#include <crypto/cryptd.h> #include <crypto/des.h> #include <crypto/internal/aead.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/xts.h> #include <crypto/scatterwalk.h> #include <linux/rtnetlink.h> drivers/crypto/mediatek/mtk-sha.c +2
-1@@ -10,7 +10,8 @@*/ #include <crypto/hmac.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include "mtk-platform.h" #define SHA_ALIGN_MSK (sizeof(u32) - 1)drivers/crypto/mxs-dcp.c +2
-1@@ -17,7 +17,8 @@#include <linux/clk.h> #include <crypto/aes.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/internal/hash.h> #include <crypto/internal/skcipher.h> #include <crypto/scatterwalk.h> drivers/crypto/n2_core.c +2
-1@@ -15,7 +15,8 @@#include <linux/interrupt.h> #include <linux/crypto.h> #include <crypto/md5.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/aes.h> #include <crypto/internal/des.h> #include <linux/mutex.h> drivers/crypto/nx/nx-sha256.c +1
-1@@ -8,7 +8,7 @@*/ #include <crypto/internal/hash.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <linux/module.h> #include <asm/vio.h> #include <asm/byteorder.h> drivers/crypto/nx/nx-sha512.c +1
-1@@ -8,7 +8,7 @@*/ #include <crypto/internal/hash.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <linux/module.h> #include <asm/vio.h> drivers/crypto/nx/nx.c +1
-1@@ -10,7 +10,7 @@#include <crypto/internal/aead.h> #include <crypto/internal/hash.h> #include <crypto/aes.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/algapi.h> #include <crypto/scatterwalk.h> #include <linux/module.h> drivers/crypto/omap-sham.c +2
-1@@ -35,7 +35,8 @@#include <linux/crypto.h> #include <crypto/scatterwalk.h> #include <crypto/algapi.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/hash.h> #include <crypto/hmac.h> #include <crypto/internal/hash.h> drivers/crypto/padlock-sha.c +2
-1@@ -9,7 +9,8 @@#include <crypto/internal/hash.h> #include <crypto/padlock.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <linux/err.h> #include <linux/module.h> #include <linux/init.h> drivers/crypto/picoxcell_crypto.c +2
-1@@ -8,7 +8,8 @@#include <crypto/authenc.h> #include <crypto/internal/des.h> #include <crypto/md5.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/internal/skcipher.h> #include <linux/clk.h> #include <linux/crypto.h> drivers/crypto/qat/qat_common/qat_algs.c +2
-1@@ -6,7 +6,8 @@#include <crypto/internal/aead.h> #include <crypto/internal/skcipher.h> #include <crypto/aes.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/hash.h> #include <crypto/hmac.h> #include <crypto/algapi.h> drivers/crypto/qce/common.c +2
-1@@ -7,7 +7,8 @@#include <linux/interrupt.h> #include <linux/types.h> #include <crypto/scatterwalk.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include "cipher.h" #include "common.h" drivers/crypto/qce/core.c +0
-1@@ -13,7 +13,6 @@#include <linux/types.h> #include <crypto/algapi.h> #include <crypto/internal/hash.h> -#include <crypto/sha.h> #include "core.h" #include "cipher.h" drivers/crypto/qce/sha.h +2
-1@@ -7,7 +7,8 @@#define _SHA_H_#include <crypto/scatterwalk.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include "common.h" #include "core.h" drivers/crypto/rockchip/rk3288_crypto.h +2
-1@@ -12,7 +12,8 @@#include <crypto/internal/skcipher.h> #include <crypto/md5.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #define _SBF (v, f) ((v) << (f))drivers/crypto/s5p-sss.c +2
-1@@ -30,7 +30,8 @@#include <crypto/hash.h> #include <crypto/md5.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/internal/hash.h> #define _SBF (s, v) ((v) << (s))drivers/crypto/sa2ul.c +2
-1@@ -25,7 +25,8 @@#include <crypto/internal/hash.h> #include <crypto/internal/skcipher.h> #include <crypto/scatterwalk.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include "sa2ul.h" drivers/crypto/sa2ul.h +2
-1@@ -13,7 +13,8 @@#define _K3_SA2UL_#include <crypto/aes.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #define SA_ENGINE_ENABLE_CONTROL 0x1000drivers/crypto/sahara.c +2
-1@@ -15,7 +15,8 @@#include <crypto/internal/hash.h> #include <crypto/internal/skcipher.h> #include <crypto/scatterwalk.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <linux/clk.h> #include <linux/dma-mapping.h> drivers/crypto/stm32/stm32-hash.c +2
-1@@ -25,7 +25,8 @@#include <crypto/hash.h> #include <crypto/md5.h> #include <crypto/scatterwalk.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/internal/hash.h> #define HASH_CR 0x00drivers/crypto/talitos.c +2
-1@@ -31,7 +31,8 @@#include <crypto/algapi.h> #include <crypto/aes.h> #include <crypto/internal/des.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/md5.h> #include <crypto/internal/aead.h> #include <crypto/authenc.h> drivers/crypto/ux500/hash/hash_core.c +2
-1@@ -31,7 +31,8 @@#include <linux/bitops.h> #include <crypto/internal/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/scatterwalk.h> #include <crypto/algapi.h> drivers/firmware/efi/embedded-firmware.c +1
-1@@ -12,7 +12,7 @@#include <linux/slab.h> #include <linux/types.h> #include <linux/vmalloc.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> /* Exported for use by lib/test_firmware.c only */ LIST_HEAD (efi_embedded_fw_list);drivers/net/ethernet/chelsio/inline_crypto/ch_ipsec/chcr_ipsec.c +2
-1@@ -51,7 +51,8 @@#include <crypto/aes.h> #include <crypto/algapi.h> #include <crypto/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/authenc.h> #include <crypto/internal/aead.h> #include <crypto/null.h> drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls.h +2
-1@@ -9,7 +9,8 @@#include <crypto/aes.h> #include <crypto/algapi.h> #include <crypto/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/authenc.h> #include <crypto/ctr.h> #include <crypto/gf128mul.h> drivers/nfc/s3fwrn5/firmware.c +1
-1@@ -9,7 +9,7 @@#include <linux/completion.h> #include <linux/firmware.h> #include <crypto/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include "s3fwrn5.h" #include "firmware.h" drivers/tee/tee_core.c +1
-1@@ -14,7 +14,7 @@#include <linux/tee_drv.h> #include <linux/uaccess.h> #include <crypto/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include "tee_private.h" #define TEE_NUM_DEVICES 32fs/crypto/fname.c +1
-1@@ -14,7 +14,7 @@#include <linux/namei.h> #include <linux/scatterlist.h> #include <crypto/hash.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/skcipher.h> #include "fscrypt_private.h" fs/crypto/hkdf.c +1
-1@@ -10,7 +10,7 @@*/ #include <crypto/hash.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include "fscrypt_private.h" fs/ubifs/auth.c +0
-1@@ -12,7 +12,6 @@#include <linux/crypto.h> #include <linux/verification.h> #include <crypto/hash.h> -#include <crypto/sha.h> #include <crypto/algapi.h> #include <keys/user-type.h> #include <keys/asymmetric-type.h> fs/verity/fsverity_private.h +1
-1@@ -14,7 +14,7 @@#define pr_fmt (fmt) "fs-verity: " fmt -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <linux/fsverity.h> #include <linux/mempool.h> include/crypto/hash_info.h +2
-1@@ -8,7 +8,8 @@#ifndef _CRYPTO_HASH_INFO_H#define _CRYPTO_HASH_INFO_H -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> #include <crypto/md5.h> #include <crypto/streebog.h> include/crypto/sha1.h new file +46
-0@@ -0,0 +1,46 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Common values for SHA-1 algorithms +*/ + +#ifndef _CRYPTO_SHA1_H +#define _CRYPTO_SHA1_H + +#include <linux/types.h> + +#define SHA1_DIGEST_SIZE 20 +#define SHA1_BLOCK_SIZE 64 + +#define SHA1_H0 0x67452301UL +#define SHA1_H1 0xefcdab89UL +#define SHA1_H2 0x98badcfeUL +#define SHA1_H3 0x10325476UL +#define SHA1_H4 0xc3d2e1f0UL + +extern const u8 sha1_zero_message_hash[SHA1_DIGEST_SIZE ]; + +struct sha1_state { +u32 state[SHA1_DIGEST_SIZE /4 ]; +u64 count; +u8 buffer[SHA1_BLOCK_SIZE ]; +}; + +struct shash_desc ; + +extern int crypto_sha1_update (struct shash_desc *desc,const u8 *data, +unsigned int len); + +extern int crypto_sha1_finup (struct shash_desc *desc,const u8 *data, +unsigned int len,u8 *hash); + +/* +* An implementation of SHA-1's compression function. Don't use in new code! +* You shouldn't be using SHA-1, and even if you *have* to use SHA-1, this isn't +* the correct way to hash something with SHA-1 (use crypto_shash instead). +*/ +#define SHA1_DIGEST_WORDS (SHA1_DIGEST_SIZE / 4) +#define SHA1_WORKSPACE_WORDS 16 +void sha1_init (__u32 *buf); +void sha1_transform (__u32 *digest,const char *data,__u32 *W ); + +#endif /* _CRYPTO_SHA1_H */ include/crypto/sha1_base.h +1
-1@@ -9,7 +9,7 @@#define _CRYPTO_SHA1_BASE_H#include <crypto/internal/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <linux/crypto.h> #include <linux/module.h> #include <linux/string.h> include/crypto/sha2.h renamed from include/crypto/sha.h +4
-37@@ -1,16 +1,13 @@/* SPDX-License-Identifier: GPL-2.0 */ /* -* Common values for SHA algorithms +* Common values for SHA-2 algorithms */ -#ifndef _CRYPTO_SHA_H -#define _CRYPTO_SHA_H +#ifndef _CRYPTO_SHA2_H +#define _CRYPTO_SHA2_H#include <linux/types.h> -#define SHA1_DIGEST_SIZE 20 -#define SHA1_BLOCK_SIZE 64 -#define SHA224_DIGEST_SIZE 28#define SHA224_BLOCK_SIZE 64@@ -23,12 +20,6 @@#define SHA512_DIGEST_SIZE 64#define SHA512_BLOCK_SIZE 128 -#define SHA1_H0 0x67452301UL -#define SHA1_H1 0xefcdab89UL -#define SHA1_H2 0x98badcfeUL -#define SHA1_H3 0x10325476UL -#define SHA1_H4 0xc3d2e1f0UL -#define SHA224_H0 0xc1059ed8UL#define SHA224_H1 0x367cd507UL#define SHA224_H2 0x3070dd17UL@@ -65,8 +56,6 @@#define SHA512_H6 0x1f83d9abfb41bd6bULL#define SHA512_H7 0x5be0cd19137e2179ULL -extern const u8 sha1_zero_message_hash[SHA1_DIGEST_SIZE ]; -extern const u8 sha224_zero_message_hash[SHA224_DIGEST_SIZE ];extern const u8 sha256_zero_message_hash[SHA256_DIGEST_SIZE ];@@ -75,12 +64,6 @@ extern const u8 sha384_zero_message_hash[SHA384_DIGEST_SIZE];extern const u8 sha512_zero_message_hash[SHA512_DIGEST_SIZE ]; -struct sha1_state { -u32 state[SHA1_DIGEST_SIZE /4 ]; -u64 count; -u8 buffer[SHA1_BLOCK_SIZE ]; -}; -struct sha256_state {u32 state[SHA256_DIGEST_SIZE /4 ];u64 count;@@ -95,12 +78,6 @@ struct sha512_state {struct shash_desc ; -extern int crypto_sha1_update (struct shash_desc *desc,const u8 *data, -unsigned int len); - -extern int crypto_sha1_finup (struct shash_desc *desc,const u8 *data, -unsigned int len,u8 *hash); -extern int crypto_sha256_update (struct shash_desc *desc,const u8 *data,unsigned int len);@@ -113,16 +90,6 @@ extern int crypto_sha512_update(struct shash_desc *desc, const u8 *data,extern int crypto_sha512_finup (struct shash_desc *desc,const u8 *data,unsigned int len,u8 *hash); -/* -* An implementation of SHA-1's compression function. Don't use in new code! -* You shouldn't be using SHA-1, and even if you *have* to use SHA-1, this isn't -* the correct way to hash something with SHA-1 (use crypto_shash instead). -*/ -#define SHA1_DIGEST_WORDS (SHA1_DIGEST_SIZE / 4) -#define SHA1_WORKSPACE_WORDS 16 -void sha1_init (__u32 *buf); -void sha1_transform (__u32 *digest,const char *data,__u32 *W ); -/* * Stand-alone implementation of the SHA256 algorithm. It is designed to * have as little dependencies as possible so it can be used in the @@ -164,4 +131,4 @@ static inline void sha224_init(struct sha256_state *sctx)void sha224_update (struct sha256_state *sctx,const u8 *data,unsigned int len);void sha224_final (struct sha256_state *sctx,u8 *out); -#endif +#endif /* _CRYPTO_SHA2_H */ include/crypto/sha256_base.h +1
-1@@ -9,7 +9,7 @@#define _CRYPTO_SHA256_BASE_H#include <crypto/internal/hash.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <linux/crypto.h> #include <linux/module.h> #include <linux/string.h> include/crypto/sha512_base.h +1
-1@@ -9,7 +9,7 @@#define _CRYPTO_SHA512_BASE_H#include <crypto/internal/hash.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <linux/crypto.h> #include <linux/module.h> #include <linux/string.h> include/linux/ccp.h +2
-1@@ -15,7 +15,8 @@#include <linux/workqueue.h> #include <linux/list.h> #include <crypto/aes.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> +#include <crypto/sha2.h> struct ccp_device ;struct ccp_cmd ;include/linux/filter.h +1
-1@@ -21,7 +21,7 @@#include <linux/if_vlan.h> #include <linux/vmalloc.h> #include <linux/sockptr.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <net/sch_generic.h> include/linux/purgatory.h +1
-1@@ -3,7 +3,7 @@#define _LINUX_PURGATORY_H#include <linux/types.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <uapi/linux/kexec.h> struct kexec_sha_region {kernel/crash_core.c +1
-1@@ -11,7 +11,7 @@#include <asm/page.h> #include <asm/sections.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> /* vmcoreinfo stuff */ unsigned char *vmcoreinfo_data;kernel/kexec_core.c +0
-1@@ -42,7 +42,6 @@#include <asm/sections.h> #include <crypto/hash.h> -#include <crypto/sha.h> #include "kexec_internal.h" DEFINE_MUTEX (kexec_mutex);kernel/kexec_file.c +1
-1@@ -20,7 +20,7 @@#include <linux/fs.h> #include <linux/ima.h> #include <crypto/hash.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <linux/elf.h> #include <linux/elfcore.h> #include <linux/kernel.h> lib/crypto/sha256.c +1
-1@@ -15,7 +15,7 @@#include <linux/export.h> #include <linux/module.h> #include <linux/string.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <asm/unaligned.h> static const u32 SHA256_K [] = {lib/digsig.c +1
-1@@ -20,7 +20,7 @@#include <linux/key.h> #include <linux/crypto.h> #include <crypto/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <keys/user-type.h> #include <linux/mpi.h> #include <linux/digsig.h> lib/sha1.c +1
-1@@ -9,7 +9,7 @@#include <linux/kernel.h> #include <linux/export.h> #include <linux/bitops.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <asm/unaligned.h> /* net/ipv6/seg6_hmac.c +0
-1@@ -35,7 +35,6 @@#include <net/xfrm.h> #include <crypto/hash.h> -#include <crypto/sha.h> #include <net/seg6.h> #include <net/genetlink.h> #include <net/seg6_hmac.h> net/mptcp/crypto.c +1
-1@@ -21,7 +21,7 @@*/ #include <linux/kernel.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <asm/unaligned.h> #include "protocol.h" net/mptcp/options.c +1
-1@@ -7,7 +7,7 @@#define pr_fmt (fmt) "MPTCP: " fmt#include <linux/kernel.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <net/tcp.h> #include <net/mptcp.h> #include "protocol.h" net/mptcp/subflow.c +1
-1@@ -10,7 +10,7 @@#include <linux/module.h> #include <linux/netdevice.h> #include <crypto/algapi.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <net/sock.h> #include <net/inet_common.h> #include <net/inet_hashtables.h> security/integrity/integrity.h +1
-1@@ -14,7 +14,7 @@#include <linux/types.h> #include <linux/integrity.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <linux/key.h> #include <linux/audit.h> security/keys/encrypted-keys/encrypted.c +1
-1@@ -29,7 +29,7 @@#include <crypto/aes.h> #include <crypto/algapi.h> #include <crypto/hash.h> -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <crypto/skcipher.h> #include "encrypted.h" security/keys/trusted-keys/trusted_tpm1.c +1
-1@@ -22,7 +22,7 @@#include <linux/rcupdate.h> #include <linux/crypto.h> #include <crypto/hash.h> -#include <crypto/sha.h> +#include <crypto/sha1.h> #include <linux/capability.h> #include <linux/tpm.h> #include <linux/tpm_command.h> sound/soc/codecs/cros_ec_codec.c +1
-2@@ -8,7 +8,7 @@* EC for audio function. */ -#include <crypto/sha.h> +#include <crypto/sha2.h> #include <linux/acpi.h> #include <linux/delay.h> #include <linux/device.h> --2.29.2
Thanks for doing this.
Herbert Xu
maintainerQuoted 150 lines · Eric Biggers
From: Eric Biggers <[email protected]>
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.hinto a new insecure/ or dangerous/ directory.Signed-off-by Eric Biggers <[email protected]>---
This is a follow-up from
https://lkml.kernel.org/linux-crypto/[email protected].This could be split into multiple patches if
sha.hwere to be kept around temporarily. However, the end state is the same, and the updates to #includes are pretty straightforward. Let me know if multiple patches are preferred.arch/arm/crypto/sha1-ce-glue.c | 2 +- arch/arm/crypto/sha1.h | 2 +- arch/arm/crypto/sha1_glue.c | 2 +- arch/arm/crypto/sha1_neon_glue.c | 2 +- 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 | 2 +- arch/arm64/crypto/sha1-ce-glue.c | 2 +- arch/arm64/crypto/sha2-ce-glue.c | 2 +- arch/arm64/crypto/sha256-glue.c | 2 +- arch/arm64/crypto/sha512-ce-glue.c | 2 +- arch/arm64/crypto/sha512-glue.c | 2 +- arch/mips/cavium-octeon/crypto/octeon-sha1.c | 2 +- .../mips/cavium-octeon/crypto/octeon-sha256.c | 2 +- .../mips/cavium-octeon/crypto/octeon-sha512.c | 2 +- arch/powerpc/crypto/sha1-spe-glue.c | 2 +- arch/powerpc/crypto/sha1.c | 2 +- arch/powerpc/crypto/sha256-spe-glue.c | 2 +- arch/s390/crypto/sha.h | 3 +- arch/s390/crypto/sha1_s390.c | 2 +- arch/s390/crypto/sha256_s390.c | 2 +- arch/s390/crypto/sha3_256_s390.c | 1 - arch/s390/crypto/sha3_512_s390.c | 1 - arch/s390/crypto/sha512_s390.c | 2 +- arch/s390/purgatory/purgatory.c | 2 +- arch/sparc/crypto/sha1_glue.c | 2 +- arch/sparc/crypto/sha256_glue.c | 2 +- arch/sparc/crypto/sha512_glue.c | 2 +- arch/x86/crypto/sha1_ssse3_glue.c | 2 +- arch/x86/crypto/sha256_ssse3_glue.c | 2 +- arch/x86/crypto/sha512_ssse3_glue.c | 2 +- arch/x86/purgatory/purgatory.c | 2 +- crypto/asymmetric_keys/asym_tpm.c | 2 +- crypto/sha1_generic.c | 2 +- crypto/sha256_generic.c | 2 +- crypto/sha512_generic.c | 2 +- drivers/char/random.c | 2 +- drivers/crypto/allwinner/sun4i-ss/sun4i-ss.h | 2 +- .../crypto/allwinner/sun8i-ce/sun8i-ce-hash.c | 3 +- drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h | 3 +- .../crypto/allwinner/sun8i-ss/sun8i-ss-hash.c | 3 +- drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h | 3 +- drivers/crypto/amcc/crypto4xx_alg.c | 2 +- drivers/crypto/amcc/crypto4xx_core.c | 2 +- drivers/crypto/atmel-authenc.h | 3 +- drivers/crypto/atmel-sha.c | 3 +- drivers/crypto/axis/artpec6_crypto.c | 3 +- drivers/crypto/bcm/cipher.c | 3 +- drivers/crypto/bcm/cipher.h | 3 +- drivers/crypto/bcm/spu.h | 3 +- drivers/crypto/caam/compat.h | 3 +- drivers/crypto/cavium/nitrox/nitrox_aead.c | 1 - drivers/crypto/ccp/ccp-crypto-sha.c | 3 +- drivers/crypto/ccp/ccp-crypto.h | 3 +- drivers/crypto/ccree/cc_driver.h | 3 +- drivers/crypto/chelsio/chcr_algo.c | 3 +- drivers/crypto/hisilicon/sec2/sec_crypto.c | 3 +- drivers/crypto/img-hash.c | 3 +- drivers/crypto/inside-secure/safexcel.h | 3 +- .../crypto/inside-secure/safexcel_cipher.c | 3 +- drivers/crypto/inside-secure/safexcel_hash.c | 3 +- drivers/crypto/ixp4xx_crypto.c | 2 +- drivers/crypto/marvell/cesa/hash.c | 3 +- .../crypto/marvell/octeontx/otx_cptvf_algs.c | 3 +- drivers/crypto/mediatek/mtk-sha.c | 3 +- drivers/crypto/mxs-dcp.c | 3 +- drivers/crypto/n2_core.c | 3 +- drivers/crypto/nx/nx-sha256.c | 2 +- drivers/crypto/nx/nx-sha512.c | 2 +- drivers/crypto/nx/nx.c | 2 +- drivers/crypto/omap-sham.c | 3 +- drivers/crypto/padlock-sha.c | 3 +- drivers/crypto/picoxcell_crypto.c | 3 +- drivers/crypto/qat/qat_common/qat_algs.c | 3 +- drivers/crypto/qce/common.c | 3 +- drivers/crypto/qce/core.c | 1 - drivers/crypto/qce/sha.h | 3 +- drivers/crypto/rockchip/rk3288_crypto.h | 3 +- drivers/crypto/s5p-sss.c | 3 +- drivers/crypto/sa2ul.c | 3 +- drivers/crypto/sa2ul.h | 3 +- drivers/crypto/sahara.c | 3 +- drivers/crypto/stm32/stm32-hash.c | 3 +- drivers/crypto/talitos.c | 3 +- drivers/crypto/ux500/hash/hash_core.c | 3 +- drivers/firmware/efi/embedded-firmware.c | 2 +- .../inline_crypto/ch_ipsec/chcr_ipsec.c | 3 +- .../chelsio/inline_crypto/chtls/chtls.h | 3 +- drivers/nfc/s3fwrn5/firmware.c | 2 +- drivers/tee/tee_core.c | 2 +- fs/crypto/fname.c | 2 +- fs/crypto/hkdf.c | 2 +- fs/ubifs/auth.c | 1 - fs/verity/fsverity_private.h | 2 +- include/crypto/hash_info.h | 3 +- include/crypto/sha1.h | 46 +++++++++++++++++++ include/crypto/sha1_base.h | 2 +- include/crypto/{sha.h => sha2.h} | 41 ++--------------- include/crypto/sha256_base.h | 2 +- include/crypto/sha512_base.h | 2 +- include/linux/ccp.h | 3 +- include/linux/filter.h | 2 +- include/linux/purgatory.h | 2 +- kernel/crash_core.c | 2 +- kernel/kexec_core.c | 1 - kernel/kexec_file.c | 2 +- lib/crypto/sha256.c | 2 +- lib/digsig.c | 2 +- lib/sha1.c | 2 +- net/ipv6/seg6_hmac.c | 1 - net/mptcp/crypto.c | 2 +- net/mptcp/options.c | 2 +- net/mptcp/subflow.c | 2 +- security/integrity/integrity.h | 2 +- security/keys/encrypted-keys/encrypted.c | 2 +- security/keys/trusted-keys/trusted_tpm1.c | 2 +- sound/soc/codecs/cros_ec_codec.c | 2 +- 120 files changed, 205 insertions(+), 155 deletions(-)
Quoted 2 lines
create mode 100644
include/crypto/sha1.h
renameinclude/crypto/{sha.h=>sha2.h} (77%)
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt