Closed jimouris closed 5 years ago
Thanks for reporting this! It looks like this commit:
https://github.com/pepper-project/pequin/commit/bef43f2e445e567a222bfcd3a308920fba1bb3dd
Is the only change that could have introduced the problem, but it doesn't look like it is doing anything obviously wrong; the only thing it does is change the type of the arguments passed to gmp_printf() from an int to mpz_t. What happens if you change the format flag from %d to %Zd?
Yes, you are right, %Zd
is the correct way to print integers in GMP and works fine. Probably should update readme or revert the change with mpz_set_q
to mpz_get_si
in order for %d
to work as it used to.
I'm hesitant to revert this, since some other recent contributions depend on it, and mpz_t is at least a bit more general than restricting printf to signed ints.
Long term, it would be nice to pass type information to the prover's printf function, but I think this would require a significant rewrite. I'll add a note somewhere when I get the chance.
Yes, I agree. Passing type information to printf would be a good solution.
Hello,
It seems that
printf
does not work as expected in the latest commits. I did not trace the origin of the problem, however in commit 4a441d3 it works as expected. Below are the same printings from two different commits (master and 4a441d3) for printing input hash and preimage ( from PR #27 ):master:
commit 4a441d3:
The second is the correct - expected output. Below I have also posted the
printf
s that I used for the above printings (file prover_knows_hash_preimage.c):Dimitris Mouris