ARM backends: fix round key byte-swap on little-endian (vrev32q_u8), rewrite decrypt to pre-process middle keys with InvMixColumns, fix GHASH PMULL reflect and reduction ordering. API: add nonce/IV-generating convenience overloads for CTR, CBC, and GCM (library generates and prepends nonce, appends tag). Add C API for IV/nonce generation. Rename error codes (TINYAES_OK, Result::Ok, Result::AuthenticationFailed, etc.). Build: add MinGW GCC AVX-512 debug alignment fix, harden bench/fuzz CMake targets (warnings-as-errors, linker hardening), align with tinysha CMake conventions. Add README. Tests: expand coverage for nonce-generating API overloads, add NIST GCM test vectors, improve fuzz target differential testing.
33 lines
1.2 KiB
CMake
33 lines
1.2 KiB
CMake
add_executable(tinyaes_benchmarks
|
|
bench_all.cpp
|
|
)
|
|
|
|
target_link_libraries(tinyaes_benchmarks PRIVATE tinyaes)
|
|
target_include_directories(tinyaes_benchmarks PRIVATE
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../src
|
|
)
|
|
set_target_properties(tinyaes_benchmarks PROPERTIES
|
|
CXX_STANDARD 17
|
|
CXX_STANDARD_REQUIRED ON
|
|
CXX_EXTENSIONS OFF
|
|
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
|
|
)
|
|
|
|
# Warning flags for benchmarks
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
|
target_compile_options(tinyaes_benchmarks PRIVATE -Wall -Wextra -Wpedantic -Werror)
|
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
set_property(TARGET tinyaes_benchmarks APPEND_STRING PROPERTY LINK_FLAGS
|
|
" -Wl,-z,relro,-z,now -Wl,-z,noexecstack")
|
|
endif()
|
|
# macOS: -bind_at_load is deprecated on modern macOS (eager binding is the default)
|
|
if(MINGW)
|
|
set_property(TARGET tinyaes_benchmarks APPEND_STRING PROPERTY LINK_FLAGS
|
|
" -Wl,--nxcompat -Wl,--dynamicbase -Wl,--high-entropy-va")
|
|
endif()
|
|
elseif(MSVC)
|
|
target_compile_options(tinyaes_benchmarks PRIVATE /W4 /WX)
|
|
set_property(TARGET tinyaes_benchmarks APPEND_STRING PROPERTY LINK_FLAGS
|
|
" /DYNAMICBASE /NXCOMPAT /HIGHENTROPYVA")
|
|
endif()
|