3e6526575a
This is an initial cut at aarch64 support. I have only qemu to test it however—hopefully hardware will be coming soon. This also affects 32-bit ARM in that aarch64 chips can run 32-bit code and we would like to be able to take advantage of the crypto operations even in 32-bit mode. AES and GHASH should Just Work in this case: the -armx.pl files can be built for either 32- or 64-bit mode based on the flavour argument given to the Perl script. SHA-1 and SHA-256 don't work like this however because they've never support for multiple implementations, thus BoringSSL built for 32-bit won't use the SHA instructions on an aarch64 chip. No dedicated ChaCha20 or Poly1305 support yet. Change-Id: Ib275bc4894a365c8ec7c42f4e91af6dba3bd686c Reviewed-on: https://boringssl-review.googlesource.com/2801 Reviewed-by: Adam Langley <agl@google.com>
67 lines
1.3 KiB
CMake
67 lines
1.3 KiB
CMake
include_directories(. .. ../../include)
|
|
|
|
if (${ARCH} STREQUAL "x86_64")
|
|
set(
|
|
SHA_ARCH_SOURCES
|
|
|
|
sha1-x86_64.${ASM_EXT}
|
|
sha256-x86_64.${ASM_EXT}
|
|
sha512-x86_64.${ASM_EXT}
|
|
)
|
|
endif()
|
|
|
|
if (${ARCH} STREQUAL "x86")
|
|
set(
|
|
SHA_ARCH_SOURCES
|
|
|
|
sha1-586.${ASM_EXT}
|
|
sha256-586.${ASM_EXT}
|
|
sha512-586.${ASM_EXT}
|
|
)
|
|
endif()
|
|
|
|
if (${ARCH} STREQUAL "arm")
|
|
set(
|
|
SHA_ARCH_SOURCES
|
|
|
|
sha1-armv4-large.${ASM_EXT}
|
|
sha256-armv4.${ASM_EXT}
|
|
sha512-armv4.${ASM_EXT}
|
|
)
|
|
endif()
|
|
|
|
if (${ARCH} STREQUAL "aarch64")
|
|
set(
|
|
SHA_ARCH_SOURCES
|
|
|
|
sha1-armv8.${ASM_EXT}
|
|
sha256-armv8.${ASM_EXT}
|
|
sha512-armv8.${ASM_EXT}
|
|
)
|
|
endif()
|
|
|
|
add_library(
|
|
sha
|
|
|
|
OBJECT
|
|
|
|
sha1.c
|
|
sha256.c
|
|
sha512.c
|
|
|
|
${SHA_ARCH_SOURCES}
|
|
)
|
|
|
|
perlasm(sha1-x86_64.${ASM_EXT} asm/sha1-x86_64.pl)
|
|
perlasm(sha256-x86_64.${ASM_EXT} asm/sha512-x86_64.pl sha256)
|
|
perlasm(sha512-x86_64.${ASM_EXT} asm/sha512-x86_64.pl sha512)
|
|
perlasm(sha1-586.${ASM_EXT} asm/sha1-586.pl)
|
|
perlasm(sha256-586.${ASM_EXT} asm/sha256-586.pl)
|
|
perlasm(sha512-586.${ASM_EXT} asm/sha512-586.pl)
|
|
perlasm(sha1-armv4-large.${ASM_EXT} asm/sha1-armv4-large.pl)
|
|
perlasm(sha256-armv4.${ASM_EXT} asm/sha256-armv4.pl)
|
|
perlasm(sha512-armv4.${ASM_EXT} asm/sha512-armv4.pl)
|
|
perlasm(sha1-armv8.${ASM_EXT} asm/sha1-armv8.pl)
|
|
perlasm(sha256-armv8.${ASM_EXT} asm/sha512-armv8.pl sha256)
|
|
perlasm(sha512-armv8.${ASM_EXT} asm/sha512-armv8.pl sha512)
|