Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
wjblanke committed Oct 13, 2024
1 parent b6b5c32 commit c1a955e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set(CMAKE_MODULE_PATH

if(MSVC)
add_compile_options(/EHsc)
ENDIF()
endif()

if(WIN32)
set(MPIR_LIBRARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../mpir_gc_x64")
Expand Down
1 change: 0 additions & 1 deletion src/integer_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ struct integer {
//lsb first
vector<uint64> to_vector() const {
vector<uint64> res;

res.resize(mpz_sizeinbase(impl, 2)/64 + 1, 0);

size_t count;
Expand Down
1 change: 0 additions & 1 deletion src/proof_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ form FastPowFormNucomp(form x, integer &D, integer num_iterations, integer &L, P
// Do exponentiation by squaring from top bits of exponent to bottom
for (i = num_iterations.num_bits() - 2; i >= 0; i--) {
nudupl_form(res, res, D, L);
gmp_printf("a %Zd _mp_size %d max_size %d\n",res.a.impl,res.a.impl->_mp_size,max_size);
if (res.a.impl->_mp_size > max_size) {
// Reduce only when 'a' exceeds a half of the discriminant size
reducer.reduce(res);
Expand Down
3 changes: 2 additions & 1 deletion src/prover_slow.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ uint64_t GetBlock(uint64_t i, uint64_t k, uint64_t T, integer& B) {
mpz_mul_2exp(res.impl, res.impl, k);
res = res / B;
auto res_vector = res.to_vector();
gmp_printf("i %lld k %lld T %lld B %Zd GB %lld\n",i,k,T,B.impl,res_vector.empty() ? 0 : res_vector[0]);
// 0 value results in empty vector from mpz_export
// https://gmplib.org/list-archives/gmp-bugs/2009-July/001534.html
return res_vector.empty() ? 0 : res_vector[0];
}

Expand Down

0 comments on commit c1a955e

Please sign in to comment.