Skip to content

Commit

Permalink
update main.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
CblPOK-git committed Feb 16, 2024
1 parent f98383b commit 7269201
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include <nil/crypto3/algebra/curves/pallas.hpp>

using namespace nil::crypto3::algebra::curves;
typename pallas::base_field_type::value_type pow(typename pallas::base_field_type::value_type a, int n) {
typename pallas::base_field_type::value_type pow2(typename pallas::base_field_type::value_type a) {
if (n == 0)
return 1;

typename pallas::base_field_type::value_type res = 1;
for (int i = 0; i < n; ++i) {
for (int i = 0; i < 2; ++i) {
res *= a;
}
return res;
Expand All @@ -19,5 +19,5 @@ typename pallas::base_field_type::value_type pow(typename pallas::base_field_typ

typename pallas::base_field_type::value_type c = (a + b) * a + b * (a + b) * (a + b);
const typename pallas::base_field_type::value_type constant = 0x12345678901234567890_cppui255;
return c * c * c / (b - a) + pow(a, 2) + constant + p;
return c * c * c / (b - a) + pow_2(a) + constant + p;
}

0 comments on commit 7269201

Please sign in to comment.