Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test on Windows and fix CMakeList #25

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SHA256SUMS eol=lf
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise sha256sum chokes on Windows, as it is checked out with eol=input.

10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ jobs:
- CFLAGS="-I/usr/local/opt/[email protected]/include/"
- NISTFLAGS="-I/usr/local/opt/[email protected]/include/"
- LDFLAGS="-L/usr/local/opt/[email protected]/lib/"
- os: windows
compiler: msvc19
before_install:
- choco install openssl
script:
- mkdir build
- cd build
- cmake -A x64 -DCMAKE_BUILD_TYPE=Release ..
- cmake --build . -- /property:Configuration=Release
- ctest --output-on-failure -C Release

- stage: coverage
os: linux
Expand Down
2 changes: 1 addition & 1 deletion avx2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ target_compile_options(PQCgenKAT_kem_avx2 PUBLIC)
target_link_libraries(PQCgenKAT_kem_avx2 PRIVATE kyber ${OPENSSL_CRYPTO_LIBRARY})
if (WIN32)
# Necessary cludge to make hashes be ignorant of Windows CRLF file formatting:
add_test(NAME PQCgenKAT_kem_avx2 COMMAND ${CMAKE_COMMAND} -E chdir $<TARGET_FILE_DIR:PQCgenKAT_kem_avx2> $ENV{ComSpec} /c "$<TARGET_FILE_NAME:PQCgenKAT_kem_avx2> && dos2unix -n PQCsignKAT_KEM.rsp ../PQCsignKAT_KEM.rsp && dos2unix -n PQCsignKAT_KEM.req ../PQCsignKAT_KEM.req")
add_test(NAME PQCgenKAT_kem_avx2 COMMAND ${CMAKE_COMMAND} -E chdir $<TARGET_FILE_DIR:PQCgenKAT_kem_avx2> $ENV{ComSpec} /c "$<TARGET_FILE_NAME:PQCgenKAT_kem_avx2> && dos2unix -n PQCkemKAT_2400.rsp ../PQCkemKAT_2400.rsp && dos2unix -n PQCkemKAT_2400.req ../PQCkemKAT_2400.req")
else()
add_test(PQCgenKAT_kem_avx2 PQCgenKAT_kem_avx2)
endif()
Expand Down
6 changes: 3 additions & 3 deletions ref/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ foreach(X RANGE 2 4)
add_executable(test_vectors${K${X}}-90s_ref ${VECTOR_SRCS})
target_compile_options(test_vectors${K${X}}-90s_ref PUBLIC -DKYBER_K=${X} -DKYBER_90S)
target_link_libraries(test_vectors${K${X}}-90s_ref PRIVATE kyber ${OPENSSL_CRYPTO_LIBRARY})
if (WIN32)
if (WIN32)
add_test(NAME test_vectors${X}-90s_ref COMMAND ${CMAKE_COMMAND} -E chdir $<TARGET_FILE_DIR:test_vectors${K${X}}-90s_ref> $ENV{ComSpec} /c "$<TARGET_FILE_NAME:test_vectors${K${X}}-90s_ref> | dos2unix > ../tvecs${K${X}}-90s")
else()
add_test(NAME test_vectors${K${X}}-90s_ref COMMAND sh -c "$<TARGET_FILE:test_vectors${K${X}}-90s_ref> > tvecs${K${X}}-90s")
Expand All @@ -120,9 +120,9 @@ endforeach()
add_executable(PQCgenKAT_kem_ref ${PQCKAT_SRCS})
target_compile_options(PQCgenKAT_kem_ref PUBLIC)
target_link_libraries(PQCgenKAT_kem_ref PRIVATE kyber ${OPENSSL_CRYPTO_LIBRARY})
if (WIN32)
if (WIN32)
# Necessary cludge to make hashes be ignorant of Windows CRLF file formatting:
add_test(NAME PQCgenKAT_kem_ref COMMAND ${CMAKE_COMMAND} -E chdir $<TARGET_FILE_DIR:PQCgenKAT_kem_ref> $ENV{ComSpec} /c "$<TARGET_FILE_NAME:PQCgenKAT_kem_ref> && dos2unix -n PQCsignKAT_KEM.rsp ../PQCsignKAT_KEM.rsp && dos2unix -n PQCsignKAT_KEM.req ../PQCsignKAT_KEM.req")
add_test(NAME PQCgenKAT_kem_ref COMMAND ${CMAKE_COMMAND} -E chdir $<TARGET_FILE_DIR:PQCgenKAT_kem_ref> $ENV{ComSpec} /c "$<TARGET_FILE_NAME:PQCgenKAT_kem_ref> && dos2unix -n PQCkemKAT_2400.rsp ../PQCkemKAT_2400.rsp && dos2unix -n PQCkemKAT_2400.req ../PQCkemKAT_2400.req")
else()
add_test(PQCgenKAT_kem_ref PQCgenKAT_kem_ref)
endif()
Expand Down