This repository has been archived by the owner on Oct 28, 2024. It is now read-only.
forked from barryWhiteHat/semaphore
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JS syntax cleanups, Cmake Cleanups, mpz multiply benchmark
- Loading branch information
HarryR
authored and
HarryR
committed
Oct 17, 2018
1 parent
b6f960d
commit 5b4f664
Showing
8 changed files
with
96 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#include "ethsnarks.hpp" | ||
|
||
using namespace libsnark; | ||
using namespace libff; | ||
|
||
int main( ) | ||
{ | ||
bigint<alt_bn128_r_limbs> number_a; | ||
bigint<alt_bn128_r_limbs> number_b; | ||
|
||
number_a.randomize(); | ||
number_b.randomize(); | ||
|
||
mpz_t result; | ||
mpz_init(result); | ||
|
||
mpz_t number_a_mpz; | ||
mpz_init(number_a_mpz); | ||
number_a.to_mpz(number_a_mpz); | ||
|
||
mpz_t number_b_mpz; | ||
mpz_init(number_b_mpz); | ||
number_b.to_mpz(number_b_mpz); | ||
|
||
enter_block("Multiplying with MPZ, 1 million times"); | ||
|
||
for( int i = 0; i < 100000000; i++ ) { | ||
mpz_mul(result, number_a_mpz, number_b_mpz); | ||
} | ||
|
||
leave_block("Multiplying with MPZ, 1 million times"); | ||
|
||
mpz_clear(number_a_mpz); | ||
mpz_clear(number_b_mpz); | ||
mpz_clear(result); | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters