4467e59bc8
This change adds AES and GHASH assembly from upstream, with the aim of speeding up AES-GCM. The PPC64LE assembly matches the interface of the ARMv8 assembly so I've changed the prefix of both sets of asm functions to be the same ("aes_hw_"). Otherwise, the new assmebly files and Perlasm match exactly those from upstream's c536b6be1a (from their master branch). Before: Did 1879000 AES-128-GCM (16 bytes) seal operations in 1000428us (1878196.1 ops/sec): 30.1 MB/s Did 61000 AES-128-GCM (1350 bytes) seal operations in 1006660us (60596.4 ops/sec): 81.8 MB/s Did 11000 AES-128-GCM (8192 bytes) seal operations in 1072649us (10255.0 ops/sec): 84.0 MB/s Did 1665000 AES-256-GCM (16 bytes) seal operations in 1000591us (1664016.6 ops/sec): 26.6 MB/s Did 52000 AES-256-GCM (1350 bytes) seal operations in 1006971us (51640.0 ops/sec): 69.7 MB/s Did 8840 AES-256-GCM (8192 bytes) seal operations in 1013294us (8724.0 ops/sec): 71.5 MB/s After: Did 4994000 AES-128-GCM (16 bytes) seal operations in 1000017us (4993915.1 ops/sec): 79.9 MB/s Did 1389000 AES-128-GCM (1350 bytes) seal operations in 1000073us (1388898.6 ops/sec): 1875.0 MB/s Did 319000 AES-128-GCM (8192 bytes) seal operations in 1000101us (318967.8 ops/sec): 2613.0 MB/s Did 4668000 AES-256-GCM (16 bytes) seal operations in 1000149us (4667304.6 ops/sec): 74.7 MB/s Did 1202000 AES-256-GCM (1350 bytes) seal operations in 1000646us (1201224.0 ops/sec): 1621.7 MB/s Did 269000 AES-256-GCM (8192 bytes) seal operations in 1002804us (268247.8 ops/sec): 2197.5 MB/s Change-Id: Id848562bd4e1aa79a4683012501dfa5e6c08cfcc Reviewed-on: https://boringssl-review.googlesource.com/11262 Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: Adam Langley <agl@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
76 lines
1.1 KiB
CMake
76 lines
1.1 KiB
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()
|
|
|
|
if (${ARCH} STREQUAL "ppc64le")
|
|
set(
|
|
MODES_ARCH_SOURCES
|
|
|
|
ghashp8-ppc.${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)
|
|
perlasm(ghashp8-ppc.${ASM_EXT} asm/ghashp8-ppc.pl)
|
|
|
|
add_executable(
|
|
gcm_test
|
|
|
|
gcm_test.cc
|
|
|
|
$<TARGET_OBJECTS:test_support>
|
|
)
|
|
|
|
target_link_libraries(gcm_test crypto)
|
|
add_dependencies(all_tests gcm_test)
|