26 #ifndef CRYPTO3_ALGEBRA_CURVES_HASH_TO_CURVE_UTILS_HPP
27 #define CRYPTO3_ALGEBRA_CURVES_HASH_TO_CURVE_UTILS_HPP
39 template<
typename FieldParams>
41 using modular_type =
typename FieldParams::modular_type;
45 return static_cast<bool>(e.
data % two);
48 template<
typename FieldParams>
51 using modular_type =
typename FieldParams::modular_type;
53 static const modular_type two = modular_type(2, underlying_type::modulus);
55 modular_type sign_0 = e.
data[0].data % two;
56 bool zero_0 = e.
data[0].data.is_zero();
57 modular_type sign_1 = e.
data[1].data % two;
58 return static_cast<bool>(sign_0) || (zero_0 &&
static_cast<bool>(sign_1));
Definition: detail/element/fp2.hpp:39
policy_type::underlying_type underlying_type
Definition: detail/element/fp2.hpp:52
data_type data
Definition: detail/element/fp2.hpp:56
data_type data
Definition: fp.hpp:63
bool sgn0(const element_fp< FieldParams > &e)
Definition: h2c_sgn0.hpp:40