| # SPDX-License-Identifier: GPL-2.0-only |
| # |
| # Create a separate FIPS archive that duplicates the modules that are relevant |
| # for FIPS 140 certification as builtin objects |
| # |
| |
| sha1-ce-y := sha1-ce-glue.o sha1-ce-core.o |
| sha2-ce-y := sha2-ce-glue.o sha2-ce-core.o |
| sha512-ce-y := sha512-ce-glue.o sha512-ce-core.o |
| ghash-ce-y := ghash-ce-glue.o ghash-ce-core.o |
| aes-ce-cipher-y := aes-ce-core.o aes-ce-glue.o |
| aes-ce-blk-y := aes-glue-ce.o aes-ce.o |
| aes-neon-blk-y := aes-glue-neon.o aes-neon.o |
| sha256-arm64-y := sha256-glue.o sha256-core.o |
| sha512-arm64-y := sha512-glue.o sha512-core.o |
| aes-arm64-y := aes-cipher-core.o aes-cipher-glue.o |
| aes-neon-bs-y := aes-neonbs-core.o aes-neonbs-glue.o |
| |
| crypto-arm64-fips-src := $(srctree)/arch/arm64/crypto/ |
| crypto-arm64-fips-modules := sha1-ce.o sha2-ce.o sha512-ce.o ghash-ce.o \ |
| aes-ce-cipher.o aes-ce-blk.o aes-neon-blk.o \ |
| sha256-arm64.o sha512-arm64.o aes-arm64.o \ |
| aes-neon-bs.o |
| |
| crypto-fips-objs += $(foreach o,$(crypto-arm64-fips-modules),$($(o:.o=-y):.o=-fips-arch.o)) |
| |
| CFLAGS_aes-glue-ce-fips-arch.o := -DUSE_V8_CRYPTO_EXTENSIONS |
| |
| $(obj)/aes-glue-%-fips-arch.o: KBUILD_CFLAGS += $(FIPS140_CFLAGS) |
| $(obj)/aes-glue-%-fips-arch.o: $(crypto-arm64-fips-src)/aes-glue.c FORCE |
| $(call if_changed_rule,cc_o_c) |
| |
| $(obj)/%-fips-arch.o: KBUILD_CFLAGS += $(FIPS140_CFLAGS) |
| $(obj)/%-fips-arch.o: $(crypto-arm64-fips-src)/%.c FORCE |
| $(call if_changed_rule,cc_o_c) |
| |
| $(obj)/%-fips-arch.o: $(crypto-arm64-fips-src)/%.S FORCE |
| $(call if_changed_rule,as_o_S) |
| |
| quiet_cmd_perlasm = PERLASM $@ |
| cmd_perlasm = $(PERL) $(<) void $(@) |
| |
| $(obj)/%-core.S: $(crypto-arm64-fips-src)/%-armv8.pl |
| $(call cmd,perlasm) |
| |
| $(obj)/sha256-core.S: $(crypto-arm64-fips-src)/sha512-armv8.pl |
| $(call cmd,perlasm) |
| |
| clean-files += sha256-core.S sha512-core.S |
| |
| $(obj)/%-fips-arch.o: $(obj)/%.S FORCE |
| $(call if_changed_rule,as_o_S) |