boringssl/crypto/chacha/CMakeLists.txt
David Benjamin d7166d07ad Add a standalone ChaCha test.
The coverage tool revealed that we weren't testing all codepaths of the ChaCha
assembly. Add a standalone test as it's much easier to iterate over all lengths
when there isn't the entire AEAD in the way.

I wasn't able to find a really long test vector, so I generated a random one
with the Go implementation we have in runner.

This test gives us full coverage on the ChaCha20_ssse3 variant. (We'll see how
it fares on the other codepaths when the multi-variant test harnesses get in. I
certainly hope there isn't a more novel way to call ChaCha20 than this...)

Change-Id: I087e421c7351f46ea65dacdc7127e4fbf5f4c0aa
Reviewed-on: https://boringssl-review.googlesource.com/7299
Reviewed-by: Adam Langley <agl@google.com>
2016-03-04 19:11:03 +00:00

58 lines
895 B
CMake

include_directories(../../include)
if (${ARCH} STREQUAL "arm")
set(
CHACHA_ARCH_SOURCES
chacha-armv4.${ASM_EXT}
)
endif()
if (${ARCH} STREQUAL "aarch64")
set(
CHACHA_ARCH_SOURCES
chacha-armv8.${ASM_EXT}
)
endif()
if (${ARCH} STREQUAL "x86")
set(
CHACHA_ARCH_SOURCES
chacha-x86.${ASM_EXT}
)
endif()
if (${ARCH} STREQUAL "x86_64")
set(
CHACHA_ARCH_SOURCES
chacha-x86_64.${ASM_EXT}
)
endif()
add_library(
chacha
OBJECT
chacha.c
${CHACHA_ARCH_SOURCES}
)
add_executable(
chacha_test
chacha_test.cc
$<TARGET_OBJECTS:test_support>
)
target_link_libraries(chacha_test crypto)
add_dependencies(all_tests chacha_test)
perlasm(chacha-armv4.${ASM_EXT} asm/chacha-armv4.pl)
perlasm(chacha-armv8.${ASM_EXT} asm/chacha-armv8.pl)
perlasm(chacha-x86.${ASM_EXT} asm/chacha-x86.pl)
perlasm(chacha-x86_64.${ASM_EXT} asm/chacha-x86_64.pl)