Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding group_order_minus_one_half to vesta field, it must be in every field. #174

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/nil/crypto3/algebra/fields/detail/element/fp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ namespace nil {
}

constexpr element_fp &operator++() {
// TODO(martun): fix this.
data = data + one().data;
data += one().data;
return *this;
}

Expand Down Expand Up @@ -197,6 +196,7 @@ namespace nil {
return zero();
element_fp result = ressol(data);
// If the element does not have a square root, this function must not be called.
// Call is_square() before using this function.
assert(!result.is_zero());

return result;
Expand Down
1 change: 1 addition & 0 deletions include/nil/crypto3/algebra/fields/vesta/base_field.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ namespace nil {

constexpr static const integral_type modulus =
0x40000000000000000000000000000000224698fc0994a8dd8c46eb2100000001_cppui_modular255;
constexpr static const integral_type group_order_minus_one_half = (modulus - 1u) / 2;

typedef typename policy_type::modular_backend modular_backend;
constexpr static const modular_params_type modulus_params = modulus.backend();
Expand Down
Loading