Skip to content

Commit 3adbee3

Browse files
committed
Address comments
1 parent cd2799c commit 3adbee3

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

cryptomite/raz.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,7 @@ def calc_raz_out(n_1: int,
366366
min(floor(k_2) - m_init,
367367
initial_tests), dtype=int)
368368
i = 0
369-
STOP = 0
370-
while STOP == 0:
369+
while True:
371370
m = ms[i]
372371
if opt_error_raz(n_1, k_1, n_2, k_2, m,
373372
max_tests_basic=max_tests_basic,
@@ -376,10 +375,10 @@ def calc_raz_out(n_1: int,
376375
verbose=False) <= log2_error_tol:
377376
max_m = m
378377
else:
379-
STOP = 1
378+
break
380379
i += 1
381380
if i >= len(ms):
382-
STOP = 1
381+
break
383382
if detailed_opt:
384383
max_m += 1
385384
while opt_error_raz(n_1, k_1, n_2, k_2, max_m,
@@ -411,7 +410,7 @@ def from_params(
411410
k_2: float,
412411
log2_error: float,
413412
detailed_opt=False,
414-
verbose: bool = True) -> Raz:
413+
verbose: bool = False) -> Raz:
415414
"""
416415
Generate a weak version of the efficient Raz
417416
extractor from [Fore2025]_ with valid

src/ntt.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ std::vector<uint32_t> NTT::conv(const std::vector<uint32_t> &a, const std::vecto
155155
}
156156

157157
std::vector<uint32_t> NTT::conv_and_reduce(const std::vector<uint32_t> &a, const std::vector<uint32_t> &b, uint32_t r, uint32_t s) {
158-
auto call_ntt = [this](const std::vector<uint32_t> &x, bool inverse){ return ntt(x, inverse); };
158+
auto call_ntt = auto call_ntt = std::bind(&Ntt::ntt, this, std::placeholders::_1, std::placeholders::_2);;
159159
std::future<std::vector<uint32_t>> ntt_a = std::async(std::launch::async, call_ntt, a, false);
160160
std::future<std::vector<uint32_t>> ntt_b = std::async(std::launch::async, call_ntt, b, false);
161161
auto finish_and_reduce = [this](const std::vector<uint32_t> &x, const std::vector<uint32_t> &y, uint32_t r, uint32_t s){
@@ -174,10 +174,10 @@ std::vector<uint32_t> NTT::conv_and_reduce(const std::vector<uint32_t> &a, const
174174
}
175175

176176
std::pair<std::vector<uint32_t>, std::vector<uint32_t>> NTT::raz_iteration(const std::vector<uint32_t> &product, const std::vector<uint32_t> &delta, uint32_t r, uint32_t s) {
177-
auto call_ntt = [this](const std::vector<uint32_t> &x, bool inverse, bool plusone = false){ return ntt(x, inverse, plusone); };
178-
std::future<std::vector<uint32_t>> ntt_delta = std::async(std::launch::async, call_ntt, delta, false);
177+
auto call_ntt = std::bind(&Ntt::ntt, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3);;
178+
std::future<std::vector<uint32_t>> ntt_delta = std::async(std::launch::async, call_ntt, delta, false, false);
179179
std::future<std::vector<uint32_t>> ntt_delta_p1 = std::async(std::launch::async, call_ntt, delta, false, true);
180-
std::future<std::vector<uint32_t>> ntt_product = std::async(std::launch::async, call_ntt, product, false);
180+
std::future<std::vector<uint32_t>> ntt_product = std::async(std::launch::async, call_ntt, product, false, false);
181181

182182

183183
auto finish_and_reduce = [this](const std::vector<uint32_t> &x, const std::vector<uint32_t> &y, uint32_t r, uint32_t s){

0 commit comments

Comments
 (0)