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>
64 lines
915 B
CMake
64 lines
915 B
CMake
include_directories(. .. ../../include)
|
|
|
|
if (${ARCH} STREQUAL "x86_64")
|
|
set(
|
|
MODES_ARCH_SOURCES
|
|
|
|
aesni-gcm-x86_64.${ASM_EXT}
|
|
ghash-x86_64.${ASM_EXT}
|
|
)
|
|
endif()
|
|
|
|
if (${ARCH} STREQUAL "x86")
|
|
set(
|
|
MODES_ARCH_SOURCES
|
|
|
|
ghash-x86.${ASM_EXT}
|
|
)
|
|
endif()
|
|
|
|
if (${ARCH} STREQUAL "arm")
|
|
set(
|
|
MODES_ARCH_SOURCES
|
|
|
|
ghash-armv4.${ASM_EXT}
|
|
ghashv8-armx.${ASM_EXT}
|
|
)
|
|
endif()
|
|
|
|
if (${ARCH} STREQUAL "aarch64")
|
|
set(
|
|
MODES_ARCH_SOURCES
|
|
|
|
ghashv8-armx.${ASM_EXT}
|
|
)
|
|
endif()
|
|
|
|
add_library(
|
|
modes
|
|
|
|
OBJECT
|
|
|
|
cbc.c
|
|
ctr.c
|
|
ofb.c
|
|
cfb.c
|
|
gcm.c
|
|
|
|
${MODES_ARCH_SOURCES}
|
|
)
|
|
|
|
perlasm(aesni-gcm-x86_64.${ASM_EXT} asm/aesni-gcm-x86_64.pl)
|
|
perlasm(ghash-x86_64.${ASM_EXT} asm/ghash-x86_64.pl)
|
|
perlasm(ghash-x86.${ASM_EXT} asm/ghash-x86.pl)
|
|
perlasm(ghash-armv4.${ASM_EXT} asm/ghash-armv4.pl)
|
|
perlasm(ghashv8-armx.${ASM_EXT} asm/ghashv8-armx.pl)
|
|
|
|
add_executable(
|
|
gcm_test
|
|
|
|
gcm_test.c
|
|
)
|
|
|
|
target_link_libraries(gcm_test crypto)
|