blob: 4180f3a13512cf4d284a67eff636972b0f0ece86 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001# SPDX-License-Identifier: GPL-2.0
David McCulloughf0be44f2012-09-07 04:17:02 +08002#
3# Arch-specific CryptoAPI modules.
4#
5
6obj-$(CONFIG_CRYPTO_AES_ARM) += aes-arm.o
Ard Biesheuvele4e7f102013-09-16 18:31:38 +02007obj-$(CONFIG_CRYPTO_AES_ARM_BS) += aes-arm-bs.o
David McCulloughf0be44f2012-09-07 04:17:02 +08008obj-$(CONFIG_CRYPTO_SHA1_ARM) += sha1-arm.o
Jussi Kivilinna60468252014-07-29 17:14:14 +01009obj-$(CONFIG_CRYPTO_SHA1_ARM_NEON) += sha1-arm-neon.o
Sami Tolvanenf2f770d2015-04-03 18:03:40 +080010obj-$(CONFIG_CRYPTO_SHA256_ARM) += sha256-arm.o
Ard Biesheuvelc80ae7c2015-05-08 10:46:21 +020011obj-$(CONFIG_CRYPTO_SHA512_ARM) += sha512-arm.o
Eric Biggers3cc21512018-11-16 17:26:25 -080012obj-$(CONFIG_CRYPTO_CHACHA20_NEON) += chacha-neon.o
Eric Biggers16aae352018-11-16 17:26:30 -080013obj-$(CONFIG_CRYPTO_NHPOLY1305_NEON) += nhpoly1305-neon.o
Ard Biesheuvel3abafaf2015-04-11 15:32:34 +020014
15ce-obj-$(CONFIG_CRYPTO_AES_ARM_CE) += aes-arm-ce.o
16ce-obj-$(CONFIG_CRYPTO_SHA1_ARM_CE) += sha1-arm-ce.o
17ce-obj-$(CONFIG_CRYPTO_SHA2_ARM_CE) += sha2-arm-ce.o
18ce-obj-$(CONFIG_CRYPTO_GHASH_ARM_CE) += ghash-arm-ce.o
Ard Biesheuvel1d481f12016-12-05 18:42:26 +000019ce-obj-$(CONFIG_CRYPTO_CRCT10DIF_ARM_CE) += crct10dif-arm-ce.o
Ard Biesheuvelefa7ceb2017-02-28 14:36:57 +000020crc-obj-$(CONFIG_CRYPTO_CRC32_ARM_CE) += crc32-arm-ce.o
21
22ifneq ($(crc-obj-y)$(crc-obj-m),)
23ifeq ($(call as-instr,.arch armv8-a\n.arch_extension crc,y,n),y)
24ce-obj-y += $(crc-obj-y)
25ce-obj-m += $(crc-obj-m)
26else
27$(warning These CRC Extensions modules need binutils 2.23 or higher)
28$(warning $(crc-obj-y) $(crc-obj-m))
29endif
30endif
Ard Biesheuvel3abafaf2015-04-11 15:32:34 +020031
32ifneq ($(ce-obj-y)$(ce-obj-m),)
33ifeq ($(call as-instr,.fpu crypto-neon-fp-armv8,y,n),y)
34obj-y += $(ce-obj-y)
35obj-m += $(ce-obj-m)
36else
37$(warning These ARMv8 Crypto Extensions modules need binutils 2.23 or higher)
38$(warning $(ce-obj-y) $(ce-obj-m))
39endif
40endif
David McCulloughf0be44f2012-09-07 04:17:02 +080041
Ard Biesheuvel81edb422017-01-11 16:41:53 +000042aes-arm-y := aes-cipher-core.o aes-cipher-glue.o
Ard Biesheuvelcc477bf2017-01-11 16:41:54 +000043aes-arm-bs-y := aes-neonbs-core.o aes-neonbs-glue.o
Ard Biesheuvele4e7f102013-09-16 18:31:38 +020044sha1-arm-y := sha1-armv4-large.o sha1_glue.o
Jussi Kivilinna60468252014-07-29 17:14:14 +010045sha1-arm-neon-y := sha1-armv7-neon.o sha1_neon_glue.o
Sami Tolvanenf2f770d2015-04-03 18:03:40 +080046sha256-arm-neon-$(CONFIG_KERNEL_MODE_NEON) := sha256_neon_glue.o
47sha256-arm-y := sha256-core.o sha256_glue.o $(sha256-arm-neon-y)
Ard Biesheuvelc80ae7c2015-05-08 10:46:21 +020048sha512-arm-neon-$(CONFIG_KERNEL_MODE_NEON) := sha512-neon-glue.o
49sha512-arm-y := sha512-core.o sha512-glue.o $(sha512-arm-neon-y)
Ard Biesheuvel864cbee2015-03-10 09:47:45 +010050sha1-arm-ce-y := sha1-ce-core.o sha1-ce-glue.o
Ard Biesheuvel006d0622015-03-10 09:47:46 +010051sha2-arm-ce-y := sha2-ce-core.o sha2-ce-glue.o
Ard Biesheuvel86464852015-03-10 09:47:47 +010052aes-arm-ce-y := aes-ce-core.o aes-ce-glue.o
Ard Biesheuvelf1e866b2015-03-10 09:47:48 +010053ghash-arm-ce-y := ghash-ce-core.o ghash-ce-glue.o
Ard Biesheuvel1d481f12016-12-05 18:42:26 +000054crct10dif-arm-ce-y := crct10dif-ce-core.o crct10dif-ce-glue.o
Ard Biesheuveld0a34312016-12-05 18:42:28 +000055crc32-arm-ce-y:= crc32-ce-core.o crc32-ce-glue.o
Eric Biggers3cc21512018-11-16 17:26:25 -080056chacha-neon-y := chacha-neon-core.o chacha-neon-glue.o
Eric Biggers16aae352018-11-16 17:26:30 -080057nhpoly1305-neon-y := nh-neon-core.o nhpoly1305-neon-glue.o
Ard Biesheuvele4e7f102013-09-16 18:31:38 +020058
Leonard Crestez6aaf49b2018-03-13 22:17:23 +020059ifdef REGENERATE_ARM_CRYPTO
Ard Biesheuvele4e7f102013-09-16 18:31:38 +020060quiet_cmd_perl = PERL $@
61 cmd_perl = $(PERL) $(<) > $(@)
62
Sami Tolvanenf2f770d2015-04-03 18:03:40 +080063$(src)/sha256-core.S_shipped: $(src)/sha256-armv4.pl
64 $(call cmd,perl)
65
Ard Biesheuvelc80ae7c2015-05-08 10:46:21 +020066$(src)/sha512-core.S_shipped: $(src)/sha512-armv4.pl
67 $(call cmd,perl)
Leonard Crestez6aaf49b2018-03-13 22:17:23 +020068endif
Ard Biesheuvelc80ae7c2015-05-08 10:46:21 +020069
Masahiro Yamada8e9b61b2018-12-01 09:27:15 +090070clean-files += sha256-core.S sha512-core.S