Skip to content
Merged
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
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
target/
build/
dist/
*.o
Expand All @@ -7,3 +6,8 @@ __pycache__
python/build/
*.egg-info/
node_modules/
**.gcno
**.lcov
**/target/
tags
TAGS
31 changes: 0 additions & 31 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,11 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

# Platform-specific settings
if(APPLE)
# Set strict floating-point model for macOS to match other platforms
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffp-contract=off -fno-fast-math")
# Define FPEMU macro for Falcon to use emulated floating-point on macOS
# This avoids platform-specific floating-point behavior
add_definitions(-DFALCON_FPEMU=1)
message(STATUS "macOS detected: Using emulated floating-point for Falcon")
endif()

# Include directories
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/dilithium/ref
${CMAKE_CURRENT_SOURCE_DIR}/sphincsplus/ref
${CMAKE_CURRENT_SOURCE_DIR}/falcon
)

# Custom randombytes implementation
Expand Down Expand Up @@ -67,20 +56,6 @@ set(SLH_DSA_SOURCES
sphincsplus/ref/fips202.c
)

# FN-DSA-512 (FALCON) source files
set(FN_DSA_SOURCES
falcon/codec.c
falcon/common.c
falcon/falcon.c
falcon/fft.c
falcon/fpr.c
falcon/keygen.c
falcon/shake.c
falcon/sign.c
falcon/vrfy.c
falcon/rng.c
)

# libbitcoinpqc source files
set(BITCOINPQC_SOURCES
src/bitcoinpqc.c
Expand All @@ -92,18 +67,13 @@ set(BITCOINPQC_SOURCES
src/slh_dsa/keygen.c
src/slh_dsa/sign.c
src/slh_dsa/verify.c
src/fn_dsa/utils.c
src/fn_dsa/keygen.c
src/fn_dsa/sign.c
src/fn_dsa/verify.c
)

# Define the main library target
add_library(bitcoinpqc STATIC
${BITCOINPQC_SOURCES}
${ML_DSA_SOURCES}
${SLH_DSA_SOURCES}
${FN_DSA_SOURCES}
${CUSTOM_RANDOMBYTES}
)

Expand All @@ -116,7 +86,6 @@ target_include_directories(bitcoinpqc PUBLIC
target_compile_definitions(bitcoinpqc PRIVATE
DILITHIUM_MODE=2 # ML-DSA-44 (Dilithium2)
PARAMS=sphincs-shake-128s
FALCON_LOGN_512=9
CUSTOM_RANDOMBYTES=1
)

Expand Down
Loading
Loading