Path: blob/main/secure/lib/libcrypto/Makefile.asm
102404 views
# Use this to help generate the asm *.S files after an import. It is not1# perfect by any means, but does what is needed.2# Do a 'make -f Makefile.asm all' and it will generate *.S. Move them3# to the arch subdir, and correct any exposed paths.45.include "Makefile.inc"67.if defined(ASM_aarch64)89.PATH: ${LCRYPTO_SRC}/crypto \10${LCRYPTO_SRC}/crypto/aes/asm \11${LCRYPTO_SRC}/crypto/bn/asm \12${LCRYPTO_SRC}/crypto/chacha/asm \13${LCRYPTO_SRC}/crypto/ec/asm \14${LCRYPTO_SRC}/crypto/md5/asm \15${LCRYPTO_SRC}/crypto/modes/asm \16${LCRYPTO_SRC}/crypto/poly1305/asm \17${LCRYPTO_SRC}/crypto/sha/asm \18${LCRYPTO_SRC}/crypto/sm3/asm \19${LCRYPTO_SRC}/crypto/sm4/asm2021PERLPATH= -I${LCRYPTO_SRC}/crypto/perlasm2223# cpuid24SRCS= arm64cpuid.pl2526# aes27SRCS+= aesv8-armx.pl bsaes-armv8.pl vpaes-armv8.pl2829# bn30SRCS+= armv8-mont.pl3132# chacha33SRCS+= chacha-armv8.pl chacha-armv8-sve.pl3435# ec36SRCS+= ecp_nistz256-armv8.pl ecp_sm2p256-armv8.pl3738# md539SRCS+= md5-aarch64.pl4041# modes42SRCS+= ghashv8-armx.pl aes-gcm-armv8_64.pl aes-gcm-armv8-unroll8_64.pl4344# poly130545SRCS+= poly1305-armv8.pl4647# sha48SRCS+= keccak1600-armv8.pl sha1-armv8.pl sha512-armv8.pl4950# sm351SRCS+= sm3-armv8.pl5253# sm454SRCS+= sm4-armv8.pl vpsm4-armv8.pl vpsm4_ex-armv8.pl5556ASM= ${SRCS:R:S/$/.S/} sha256-armv8.S5758all: ${ASM}59rm -f ${ASM:R:S/$/.s/}60${CP} ${LCRYPTO_SRC}/crypto/arm_arch.h ../arm_arch.h6162CLEANFILES= ${ASM}63.SUFFIXES: .pl6465sha256-armv8.S: sha512-armv8.pl66env CC=cc perl ${.ALLSRC} linux64 ${.TARGET:R:S/$/.s/}67( echo '/* Do not modify. This file is auto-generated from ${.ALLSRC:T}. */' ;\68cat ${.TARGET:R:S/$/.s/}) > ${.TARGET}6970.pl.S:71env CC=cc perl ${.IMPSRC} linux64 ${.TARGET:R:S/$/.s/}72( echo '/* Do not modify. This file is auto-generated from ${.IMPSRC:T}. */' ;\73cat ${.TARGET:R:S/$/.s/}) > ${.TARGET}7475.elif defined(ASM_amd64)7677.PATH: ${LCRYPTO_SRC}/crypto \78${LCRYPTO_SRC}/crypto/aes/asm \79${LCRYPTO_SRC}/crypto/bn/asm \80${LCRYPTO_SRC}/crypto/camellia/asm \81${LCRYPTO_SRC}/crypto/chacha/asm \82${LCRYPTO_SRC}/crypto/ec/asm \83${LCRYPTO_SRC}/crypto/md5/asm \84${LCRYPTO_SRC}/crypto/modes/asm \85${LCRYPTO_SRC}/crypto/poly1305/asm \86${LCRYPTO_SRC}/crypto/rc4/asm \87${LCRYPTO_SRC}/crypto/sha/asm \88${LCRYPTO_SRC}/crypto/whrlpool/asm \89${LCRYPTO_SRC}/engines/asm9091# cpuid92SRCS= x86_64cpuid.pl9394# aes95SRCS+= aes-x86_64.pl \96aesni-mb-x86_64.pl aesni-sha1-x86_64.pl aesni-sha256-x86_64.pl \97aesni-x86_64.pl aesni-xts-avx512.pl bsaes-x86_64.pl vpaes-x86_64.pl9899# bn100SRCS+= rsaz-avx2.pl rsaz-x86_64.pl \101rsaz-2k-avx512.pl rsaz-2k-avxifma.pl \102rsaz-3k-avx512.pl rsaz-3k-avxifma.pl \103rsaz-4k-avx512.pl rsaz-4k-avxifma.pl \104x86_64-gf2m.pl x86_64-mont.pl x86_64-mont5.pl105106# camellia107SRCS+= cmll-x86_64.pl108109# chacha110SRCS+= chacha-x86_64.pl111112# ec113SRCS+= ecp_nistz256-x86_64.pl x25519-x86_64.pl114115# md5116SRCS+= md5-x86_64.pl117118# modes119SRCS+= aes-gcm-avx512.pl aesni-gcm-x86_64.pl ghash-x86_64.pl120121# poly1305122SRCS+= poly1305-x86_64.pl123124# rc4125SRCS+= rc4-md5-x86_64.pl rc4-x86_64.pl126127# sha128SRCS+= keccak1600-x86_64.pl sha1-mb-x86_64.pl sha1-x86_64.pl \129sha256-mb-x86_64.pl130131# whrlpool132SRCS+= wp-x86_64.pl133134# engines135SRCS+= e_padlock-x86_64.pl136137SHA_ASM= sha256-x86_64 sha512-x86_64138SHA_SRC= sha512-x86_64.pl139SHA_TMP= ${SHA_ASM:S/$/.s/}140141ASM= ${SRCS:R:S/$/.S/} ${SHA_ASM:S/$/.S/}142143all: ${ASM}144rm -f ${SHA_TMP}145146CLEANFILES= ${ASM}147.SUFFIXES: .pl148149.pl.S:150( echo '/* Do not modify. This file is auto-generated from ${.IMPSRC:T}. */' ;\151env CC=cc perl ${.IMPSRC} elf ) > ${.TARGET}152153${SHA_TMP}: ${SHA_SRC}154env CC=cc perl ${.ALLSRC} elf ${.TARGET}155156.for s in ${SHA_ASM}157${s}.S: ${s}.s158( echo '/* Do not modify. This file is auto-generated from ${SHA_SRC}. */' ;\159cat ${s}.s ) > ${.TARGET}160.endfor161162.elif defined(ASM_arm)163164.PATH: ${LCRYPTO_SRC}/crypto \165${LCRYPTO_SRC}/crypto/aes/asm \166${LCRYPTO_SRC}/crypto/bn/asm \167${LCRYPTO_SRC}/crypto/chacha/asm \168${LCRYPTO_SRC}/crypto/ec/asm \169${LCRYPTO_SRC}/crypto/modes/asm \170${LCRYPTO_SRC}/crypto/poly1305/asm \171${LCRYPTO_SRC}/crypto/sha/asm172173PERLPATH= -I${LCRYPTO_SRC}/crypto/perlasm174175# cpuid176SRCS= armv4cpuid.pl177178# aes179SRCS+= aes-armv4.pl aesv8-armx.pl bsaes-armv7.pl180181# bn182SRCS+= armv4-mont.pl armv4-gf2m.pl183184# chacha185SRCS+= chacha-armv4.pl186187# ec188SRCS+= ecp_nistz256-armv4.pl189190# modes191SRCS+= ghash-armv4.pl ghashv8-armx.pl192193# poly1305194SRCS+= poly1305-armv4.pl195196# sha197SRCS+= keccak1600-armv4.pl sha1-armv4-large.pl sha256-armv4.pl sha512-armv4.pl198199ASM= ${SRCS:R:S/$/.S/}200201all: ${ASM}202rm -f ${ASM:R:S/$/.s/}203${CP} ${LCRYPTO_SRC}/crypto/arm_arch.h ../arm_arch.h204205CLEANFILES= ${ASM}206.SUFFIXES: .pl207208.pl.S:209env CC=cc perl ${.IMPSRC} linux32 ${.TARGET:R:S/$/.s/}210( echo '/* Do not modify. This file is auto-generated from ${.IMPSRC:T}. */' ;\211cat ${.TARGET:R:S/$/.s/}) > ${.TARGET}212213.elif defined(ASM_i386)214215.PATH: ${LCRYPTO_SRC}/crypto \216${LCRYPTO_SRC}/crypto/aes/asm \217${LCRYPTO_SRC}/crypto/bf/asm \218${LCRYPTO_SRC}/crypto/bn/asm \219${LCRYPTO_SRC}/crypto/camellia/asm \220${LCRYPTO_SRC}/crypto/cast/asm \221${LCRYPTO_SRC}/crypto/chacha/asm \222${LCRYPTO_SRC}/crypto/des/asm \223${LCRYPTO_SRC}/crypto/ec/asm \224${LCRYPTO_SRC}/crypto/md5/asm \225${LCRYPTO_SRC}/crypto/modes/asm \226${LCRYPTO_SRC}/crypto/poly1305/asm \227${LCRYPTO_SRC}/crypto/rc4/asm \228${LCRYPTO_SRC}/crypto/rc5/asm \229${LCRYPTO_SRC}/crypto/ripemd/asm \230${LCRYPTO_SRC}/crypto/sha/asm \231${LCRYPTO_SRC}/crypto/whrlpool/asm \232${LCRYPTO_SRC}/engines/asm233234#PERLPATH= -I${LCRYPTO_SRC}/crypto/des/asm -I${LCRYPTO_SRC}/crypto/perlasm235CFLAGS= -DOPENSSL_IA32_SSE2236237# cpuid238SRCS= x86cpuid.pl239240# aes241SRCS+= aes-586.pl aesni-x86.pl vpaes-x86.pl242243# blowfish244SRCS+= bf-586.pl245246# bn247SRCS+= bn-586.pl co-586.pl x86-gf2m.pl x86-mont.pl248249# camellia250SRCS+= cmll-x86.pl251252# cast253SRCS+= cast-586.pl254255# chacha256SRCS+= chacha-x86.pl257258# des259SRCS+= crypt586.pl des-586.pl260261# ec262SRCS+= ecp_nistz256-x86.pl263264# md5265SRCS+= md5-586.pl266267# modes268SRCS+= ghash-x86.pl269270# poly1305271SRCS+= poly1305-x86.pl272273# rc4274SRCS+= rc4-586.pl275276# rc5277SRCS+= rc5-586.pl278279# ripemd280SRCS+= rmd-586.pl281282# sha283SRCS+= sha1-586.pl sha256-586.pl sha512-586.pl284285# whrlpool286SRCS+= wp-mmx.pl287288# engines289SRCS+= e_padlock-x86.pl290291ASM= ${SRCS:R:S/$/.S/}292293all: ${ASM}294295CLEANFILES= ${ASM}296.SUFFIXES: .pl297298.pl.S:299( echo '/* Do not modify. This file is auto-generated from ${.IMPSRC:T}. */' ;\300echo '#ifdef PIC' ;\301env CC=cc perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} -fpic /dev/stdout ;\302echo '#else' ;\303env CC=cc perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} /dev/stdout ;\304echo '#endif' ) > ${.TARGET}305306.elif defined(ASM_powerpc)307308.PATH: ${LCRYPTO_SRC}/crypto \309${LCRYPTO_SRC}/crypto/aes/asm \310${LCRYPTO_SRC}/crypto/bn/asm \311${LCRYPTO_SRC}/crypto/chacha/asm \312${LCRYPTO_SRC}/crypto/modes/asm \313${LCRYPTO_SRC}/crypto/poly1305/asm \314${LCRYPTO_SRC}/crypto/sha/asm315316PERLPATH= -I${LCRYPTO_SRC}/crypto/perlasm317318#cpuid319SRCS= ppccpuid.pl320321#bn322SRCS+= ppc.pl ppc-mont.pl323324#aes325SRCS+= aes-ppc.pl vpaes-ppc.pl aesp8-ppc.pl326327#sha1328SRCS+= sha1-ppc.pl sha512-ppc.pl sha512p8-ppc.pl329330#modes331SRCS+= aes-gcm-ppc.pl ghashp8-ppc.pl332333#chacha334SRCS+= chacha-ppc.pl chachap10-ppc.pl335336#poly1305337SRCS+= poly1305-ppc.pl poly1305-ppcfp.pl338339ASM= ${SRCS:R:S/$/.S/} bn-ppc.S sha256-ppc.S sha256p8-ppc.S340341all: ${ASM}342rm -f ${ASM:R:S/$/.s/}343344CLEANFILES= ${ASM}345.SUFFIXES: .pl346347bn-ppc.S: ppc.pl348env CC=cc perl ${.ALLSRC} linux32 ${.TARGET:R:S/$/.s/}349( echo '/* Do not modify. This file is auto-generated from ${.ALLSRC:T}. */' ;\350cat ${.TARGET:R:S/$/.s/}) > ${.TARGET}351352sha256-ppc.S: sha512-ppc.pl353env CC=cc perl ${.ALLSRC} linux32 ${.TARGET:R:S/$/.s/}354( echo '/* Do not modify. This file is auto-generated from ${.ALLSRC:T}. */' ;\355cat ${.TARGET:R:S/$/.s/}) > ${.TARGET}356357sha256p8-ppc.S: sha512p8-ppc.pl358env CC=cc perl ${.ALLSRC} linux32 ${.TARGET:R:S/$/.s/}359( echo '/* Do not modify. This file is auto-generated from ${.ALLSRC:T}. */' ;\360cat ${.TARGET:R:S/$/.s/}) > ${.TARGET}361362.pl.S:363env CC=cc perl ${.IMPSRC} linux32 ${.TARGET:R:S/$/.s/}364( echo '/* Do not modify. This file is auto-generated from ${.ALLSRC:T}. */' ;\365cat ${.TARGET:R:S/$/.s/}) > ${.TARGET}366367.elif defined(ASM_powerpc64)368369.PATH: ${LCRYPTO_SRC}/crypto \370${LCRYPTO_SRC}/crypto/aes/asm \371${LCRYPTO_SRC}/crypto/bn/asm \372${LCRYPTO_SRC}/crypto/chacha/asm \373${LCRYPTO_SRC}/crypto/ec/asm \374${LCRYPTO_SRC}/crypto/modes/asm \375${LCRYPTO_SRC}/crypto/poly1305/asm \376${LCRYPTO_SRC}/crypto/sha/asm377378PERLPATH= -I${LCRYPTO_SRC}/crypto/perlasm379380#cpuid381SRCS= ppccpuid.pl382383#bn384SRCS+= ppc.pl ppc-mont.pl385386#aes387SRCS+= aes-ppc.pl vpaes-ppc.pl aesp8-ppc.pl388389#sha1390SRCS+= sha1-ppc.pl sha512-ppc.pl sha512p8-ppc.pl391392#modes393SRCS+= aes-gcm-ppc.pl ghashp8-ppc.pl394395#chacha396SRCS+= chacha-ppc.pl chachap10-ppc.pl397398#poly1305399SRCS+= poly1305-ppc.pl poly1305-ppcfp.pl400401#ec402SRCS+= ecp_nistp384-ppc64.pl ecp_nistp521-ppc64.pl ecp_nistz256-ppc64.pl x25519-ppc64.pl403404405#keccak1600406SRCS+= keccak1600-ppc64.pl407408ASM= ${SRCS:R:S/$/.S/} bn-ppc.S sha256-ppc.S sha256p8-ppc.S409410all: ${ASM}411rm -f ${ASM:R:S/$/.s/}412413CLEANFILES= ${ASM}414.SUFFIXES: .pl415416bn-ppc.S: ppc.pl417env CC=cc perl ${.ALLSRC} linux64v2 ${.TARGET:R:S/$/.s/}418( echo '/* Do not modify. This file is auto-generated from ${.ALLSRC:T}. */' ;\419cat ${.TARGET:R:S/$/.s/}) > ${.TARGET}420421sha256-ppc.S: sha512-ppc.pl422env CC=cc perl ${.ALLSRC} linux64v2 ${.TARGET:R:S/$/.s/}423( echo '/* Do not modify. This file is auto-generated from ${.ALLSRC:T}. */' ;\424cat ${.TARGET:R:S/$/.s/}) > ${.TARGET}425426sha256p8-ppc.S: sha512p8-ppc.pl427env CC=cc perl ${.ALLSRC} linux64v2 ${.TARGET:R:S/$/.s/}428( echo '/* Do not modify. This file is auto-generated from ${.ALLSRC:T}. */' ;\429cat ${.TARGET:R:S/$/.s/}) > ${.TARGET}430431.pl.S:432env CC=cc perl ${.IMPSRC} linux64v2 ${.TARGET:R:S/$/.s/}433( echo '/* Do not modify. This file is auto-generated from ${.ALLSRC:T}. */' ;\434cat ${.TARGET:R:S/$/.s/}) > ${.TARGET}435436.elif defined(ASM_powerpc64le)437438.PATH: ${LCRYPTO_SRC}/crypto \439${LCRYPTO_SRC}/crypto/aes/asm \440${LCRYPTO_SRC}/crypto/bn/asm \441${LCRYPTO_SRC}/crypto/chacha/asm \442${LCRYPTO_SRC}/crypto/ec/asm \443${LCRYPTO_SRC}/crypto/modes/asm \444${LCRYPTO_SRC}/crypto/poly1305/asm \445${LCRYPTO_SRC}/crypto/sha/asm446447PERLPATH= -I${LCRYPTO_SRC}/crypto/perlasm448449#cpuid450SRCS= ppccpuid.pl451452#bn453SRCS+= ppc.pl ppc-mont.pl454455#aes456SRCS+= aes-ppc.pl vpaes-ppc.pl aesp8-ppc.pl457458#sha1459SRCS+= sha1-ppc.pl sha512-ppc.pl sha512p8-ppc.pl460461#modes462SRCS+= aes-gcm-ppc.pl ghashp8-ppc.pl463464#chacha465SRCS+= chacha-ppc.pl chachap10-ppc.pl466467#poly1305468SRCS+= poly1305-ppc.pl poly1305-ppcfp.pl469470#ec471SRCS+= ecp_nistp384-ppc64.pl ecp_nistp521-ppc64.pl ecp_nistz256-ppc64.pl x25519-ppc64.pl472473#keccak1600474SRCS+= keccak1600-ppc64.pl475476ASM= ${SRCS:R:S/$/.S/} bn-ppc.S sha256-ppc.S sha256p8-ppc.S477478all: ${ASM}479rm -f ${ASM:R:S/$/.s/}480481CLEANFILES= ${ASM}482.SUFFIXES: .pl483484bn-ppc.S: ppc.pl485env CC=cc perl ${.ALLSRC} linux64le ${.TARGET:R:S/$/.s/}486( echo '/* Do not modify. This file is auto-generated from ${.ALLSRC:T}. */' ;\487cat ${.TARGET:R:S/$/.s/}) > ${.TARGET}488489sha256-ppc.S: sha512-ppc.pl490env CC=cc perl ${.ALLSRC} linux64le ${.TARGET:R:S/$/.s/}491( echo '/* Do not modify. This file is auto-generated from ${.ALLSRC:T}. */' ;\492cat ${.TARGET:R:S/$/.s/}) > ${.TARGET}493494sha256p8-ppc.S: sha512p8-ppc.pl495env CC=cc perl ${.ALLSRC} linux64le ${.TARGET:R:S/$/.s/}496( echo '/* Do not modify. This file is auto-generated from ${.ALLSRC:T}. */' ;\497cat ${.TARGET:R:S/$/.s/}) > ${.TARGET}498499.pl.S:500env CC=cc perl ${.IMPSRC} linux64le ${.TARGET:R:S/$/.s/}501( echo '/* Do not modify. This file is auto-generated from ${.ALLSRC:T}. */' ;\502cat ${.TARGET:R:S/$/.s/}) > ${.TARGET}503504.endif505506.include <bsd.prog.mk>507508509