Skip to content

Commit

Permalink
Merge branch 'master' of github.com:relic-toolkit/relic
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaranha committed Jan 16, 2021
2 parents 00aa037 + bdf0762 commit 9e3cb3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
7 changes: 4 additions & 3 deletions cmake/fiat.cmake
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
set(TEST_FP "${CMAKE_BINARY_DIR}/../bin/test_fp")
set(TEST_FP "${CMAKE_BINARY_DIR}/bin/test_fp")
set(FIAT_TXT "${CMAKE_BINARY_DIR}/test_fp.txt")
set(FIAT_LOW "${CMAKE_SOURCE_DIR}/../../src/low/fiat/")
set(FIAT_LOW "${CMAKE_SOURCE_DIR}/src/low/fiat/")
set(FIAT_FP "${FIAT_LOW}/fiat_fp.c")
set(MONT "word_by_word_montgomery")
set(MONT "src/ExtractionOCaml/word_by_word_montgomery")

message(STATUS "Running test_fp to discover prime modulus.")
execute_process(COMMAND ${TEST_FP} OUTPUT_FILE ${FIAT_TXT})
file(READ ${FIAT_TXT} OUTPUT_CONTENT)
string(REGEX MATCHALL "[(0-9)|(A-F)]+[ \n]" MATCHES ${OUTPUT_CONTENT})
Expand Down
9 changes: 2 additions & 7 deletions src/low/fiat/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ if(GMP_FOUND)
endif(GMP_FOUND)

set(FIAT_CMAKE ${CMAKE_SOURCE_DIR}/cmake/fiat.cmake)
set(FIAT_FP "${CMAKE_SOURCE_DIR}/../../src/low/fiat-crypto/fiat_fp.c")

add_custom_command(OUTPUT ${FIAT_FP}
COMMAND ${CMAKE_COMMAND} -P ${FIAT_CMAKE}
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
COMMENT "Running test_fp to discover prime modulus."
)
set(FIAT_FP "${CMAKE_SOURCE_DIR}/src/low/fiat/fiat_fp.c")

include(${FIAT_CMAKE})
add_custom_target(fiat DEPENDS ${FIAT_FP})

0 comments on commit 9e3cb3e

Please sign in to comment.