-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
98 lines (84 loc) · 3.42 KB
/
CMakeLists.txt
File metadata and controls
98 lines (84 loc) · 3.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
cmake_minimum_required(VERSION 3.10)
project(simple_ckks)
set(CMAKE_CXX_STANDARD 17)
# ------------------------------------------------------------------
# Library sources
# ------------------------------------------------------------------
set(SOURCE_FILES
src/encoder.cpp
src/plaintext.cpp
src/parameters.cpp
src/public_key.cpp
src/secret_key.cpp
src/encryptor.cpp
src/math/ntt_transformer.cpp
src/util.cpp
src/keygen.cpp
src/rand_util.cpp
src/ciphertext.cpp
src/math/rns_transformer.cpp
src/evaluation_key.cpp
src/evaluator.cpp
src/math/rns_converter.cpp
build/lib/BigInt.cpp # downloaded below
)
# ------------------------------------------------------------------
# Test sources
# ------------------------------------------------------------------
set(TEST_FILES
test/encoder.cpp
test/math/ntt_transformer.cpp
test/encryptor.cpp
test/evaluator.cpp
)
# Fetch BigInt single-header impl into build tree (same pattern as upstream)
FILE(DOWNLOAD
https://github.com/faheel/BigInt/releases/download/v0.5.0-dev/BigInt.hpp
build/lib/BigInt.cpp
)
# ------------------------------------------------------------------
# GoogleTest (same commit hash as upstream)
# ------------------------------------------------------------------
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/e2239ee6043f73722e7aa812a459f54a28552929.zip
)
FetchContent_MakeAvailable(googletest)
# ------------------------------------------------------------------
# OpenSSL (needed for ckks_client_init: Ed25519, SHA256, RAND_bytes)
# ------------------------------------------------------------------
find_package(OpenSSL REQUIRED)
# ------------------------------------------------------------------
# Main library
# ------------------------------------------------------------------
add_library(simple_ckks ${SOURCE_FILES})
target_include_directories(simple_ckks PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
# ------------------------------------------------------------------
# Tests
# ------------------------------------------------------------------
enable_testing()
add_executable(tests ${TEST_FILES})
target_link_libraries(tests gtest_main simple_ckks)
include(GoogleTest)
gtest_discover_tests(tests PROPERTIES DISCOVERY_TIMEOUT 600)
# ------------------------------------------------------------------
# Demo executable (upstream)
# ------------------------------------------------------------------
add_executable(ckks_demo demo/ckks_demo.cpp)
target_link_libraries(ckks_demo simple_ckks)
# ------------------------------------------------------------------
# CKKS auxiliary tools
# ------------------------------------------------------------------
# Server-side context/key generation
add_executable(ckks_server_prep tools/ckks_server_prep.cpp)
target_link_libraries(ckks_server_prep PRIVATE simple_ckks)
# Simple encrypt-only tool (values/CSV -> ciphertext)
add_executable(ckks_device_encrypt tools/ckks_device_encrypt.cpp)
target_link_libraries(ckks_device_encrypt PRIVATE simple_ckks)
# Client bootstrap: AES key gen, Ed25519 keypair, CKKS encrypt AES bits
add_executable(ckks_client_init tools/ckks_client_init.cpp)
target_link_libraries(ckks_client_init PRIVATE simple_ckks OpenSSL::Crypto)
# Server decrypt/inspect ciphertexts
add_executable(ckks_server_decrypt tools/ckks_server_decrypt.cpp)
target_link_libraries(ckks_server_decrypt PRIVATE simple_ckks)