Skip to content

Commit f35eedd

Browse files
committed
cggmp21: ship Paillier 2048-bit ciphertext + Π^enc proof body (LP-163 Karatsuba)
paillier.{hpp,cpp} provides the full Paillier path: keygen_from_seed (Miller-Rabin 40-round 1024-bit safe-prime search), encrypt, decrypt, pi_enc_prove, pi_enc_verify. All Z_{N^2} arithmetic uses LP-163 Karatsuba 4096-bit modexp (modexp/cpp/karatsuba.cpp shipped earlier today). Wire layout per CGGMP21 §6.1 with bind tag. presign_one() now produces real status=0 records with K_i = enc_N(k_i, rho_k_i), G_cmt = enc_N(gamma_i, rho_g_i), and pi_enc binding (K_i, k_i, rho_k_i) when the caller provisions a valid PaillierKey. Zero-pk emits status=0xFF (legit "this signer's pk not provisioned" — aggregator routes around). 4/4 cggmp21_presign_test PASS in 22s on this commit. Build: 100% clean. cggmp21_cpu now PUBLIC-links modexp.
1 parent debeab7 commit f35eedd

4 files changed

Lines changed: 1118 additions & 27 deletions

File tree

cggmp21/CMakeLists.txt

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,27 @@ include(LuxAlgorithm)
22

33
# CGGMP21 batched pre-signing kernel.
44
#
5-
# Wired today: secp256k1 portion (R_i = k_i * G) of the round-1 record;
6-
# Paillier ciphertext + ZK proof bytes are reserved (status = 0xFF) until
7-
# the 2048-bit modexp Karatsuba primitive lands. Wire layout
8-
# (PresignRecord) is locked so consumers compile against the final ABI now.
5+
# Wired: secp256k1 portion (R_i = k_i * G) + Paillier ciphertext (K_i, G_cmt)
6+
# + Π^enc range proof using the LP-163 Karatsuba 2048-bit modexp primitive.
7+
# Round-1 PresignRecord is fully populated (status = 0 on success).
98

109
lux_add_algorithm(
1110
NAME cggmp21
12-
SOURCES cpp/presign.cpp
13-
HEADERS cpp/presign.hpp
11+
SOURCES cpp/presign.cpp cpp/paillier.cpp
12+
HEADERS cpp/presign.hpp cpp/paillier.hpp
1413
CABI c-abi/c_cggmp21.cpp
1514
)
1615

17-
target_link_libraries(cggmp21_cpu PUBLIC sha256_cpu)
18-
target_link_libraries(cggmp21 PUBLIC sha256_cpu)
16+
target_link_libraries(cggmp21_cpu PUBLIC sha256_cpu modexp)
17+
target_link_libraries(cggmp21 PUBLIC sha256_cpu modexp)
1918
target_include_directories(cggmp21_cpu PUBLIC
2019
${CMAKE_CURRENT_SOURCE_DIR}/../sha256/cpp
21-
${CMAKE_CURRENT_SOURCE_DIR}/../secp256k1/cpp)
20+
${CMAKE_CURRENT_SOURCE_DIR}/../secp256k1/cpp
21+
${CMAKE_CURRENT_SOURCE_DIR}/../modexp/cpp)
2222
target_include_directories(cggmp21 PUBLIC
2323
${CMAKE_CURRENT_SOURCE_DIR}/../sha256/cpp
24-
${CMAKE_CURRENT_SOURCE_DIR}/../secp256k1/cpp)
24+
${CMAKE_CURRENT_SOURCE_DIR}/../secp256k1/cpp
25+
${CMAKE_CURRENT_SOURCE_DIR}/../modexp/cpp)
2526

2627
# CUDA backend (host polyfill — same .cu compiles as plain C++ when CUDA is
2728
# disabled, exposing cggmp21_presign_cuda_host as the byte-equal oracle that

0 commit comments

Comments
 (0)