Skip to content

Commit

Permalink
Merge pull request #18 from AntelopeIO/fix-warnings
Browse files Browse the repository at this point in the history
Fix warnings on clang
  • Loading branch information
heifner authored Nov 30, 2023
2 parents 1388808 + 1cd8e25 commit 3391cbb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 22 deletions.
26 changes: 6 additions & 20 deletions bench/eth_bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,10 @@ void benchG1Add2() {
string testName = "G1 Addition With different settings";
cout << endl << testName << endl;

const int numIters = 10000;
constexpr int numIters = 10000;
g1 pbak = random_g1();



array<uint64_t, 4> s = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff};


auto performTest = [numIters, s, pbak](bool check, bool raw) {
auto performTest = [pbak](bool check, bool raw) {
array<uint8_t, 144> pRaw = {};
g1 p = pbak;
p.toJacobianBytesLE(pRaw, raw);
Expand All @@ -217,12 +212,10 @@ void benchG1Add2() {

for (int i = 0; i < numIters; i++) {
p = *g1::fromJacobianBytesLE(pRaw, check, raw);
p.add(p);
p.addAssign(p);
p.toJacobianBytesLE(pRaw, raw);
}
endStopwatch(string("check=") + std::to_string(check) + string(", raw=") + std::to_string(raw), start, numIters);

start = startStopwatch();
};

performTest(true, true);
Expand All @@ -236,15 +229,10 @@ void benchG2Add2() {
string testName = "G2 Addition With different settings";
cout << endl << testName << endl;

const int numIters = 10000;
constexpr int numIters = 10000;
g2 pbak = random_g2();



array<uint64_t, 4> s = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff};


auto performTest = [numIters, s, pbak](bool check, bool raw) {
auto performTest = [pbak](bool check, bool raw) {
array<uint8_t, 288> pRaw = {};
g2 p = pbak;
p.toJacobianBytesLE(pRaw, raw);
Expand All @@ -253,12 +241,10 @@ void benchG2Add2() {

for (int i = 0; i < numIters; i++) {
p = *g2::fromJacobianBytesLE(pRaw, check, raw);
p.add(p);
p.addAssign(p);
p.toJacobianBytesLE(pRaw, raw);
}
endStopwatch(string("check=") + std::to_string(check) + string(", raw=") + std::to_string(raw), start, numIters);

start = startStopwatch();
};

performTest(true, true);
Expand Down
2 changes: 0 additions & 2 deletions test/unittests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,6 @@ void TestG1WeightedSumExpected()
void TestG1WeightedSumBatch()
{
const auto doTest = [](int64_t n) {
g1 one = g1::one();
vector<array<uint64_t, 4>> scalars;
vector<g1> bases;

Expand Down Expand Up @@ -1312,7 +1311,6 @@ void TestG2WeightedSumExpected()
void TestG2WeightedSumBatch()
{
const auto doTest = [](int64_t n) {
g2 one = g2::one();
vector<array<uint64_t, 4>> scalars;
vector<g2> bases;

Expand Down

0 comments on commit 3391cbb

Please sign in to comment.