26 #ifndef CRYPTO3_ALGEBRA_PAIRING_EDWARDS_183_ATE_MILLER_LOOP_HPP
27 #define CRYPTO3_ALGEBRA_PAIRING_EDWARDS_183_ATE_MILLER_LOOP_HPP
29 #include <nil/crypto3/multiprecision/number.hpp>
30 #include <nil/crypto3/multiprecision/cpp_int.hpp>
41 template<std::
size_t Version = 183>
53 static typename gt_type::value_type
process(
const policy_type::ate_g1_precomputed_type &prec_P,
54 const policy_type::ate_g2_precomputed_type &prec_Q) {
56 typename gt_type::value_type f = gt_type::value_type::one();
58 bool found_one =
false;
61 const typename policy_type::integral_type &loop_count = params_type::ate_loop_count;
63 for (
long i = params_type::integral_type_max_bits - 1; i >= 0; --i) {
64 const bool bit = nil::crypto3::multiprecision::bit_test(loop_count, i);
74 typename policy_type::Fq3_conic_coefficients cc = prec_Q[idx++];
76 typename gt_type::value_type g_RR_at_P =
typename gt_type::value_type(
77 prec_P.P_XY * cc.c_XY + prec_P.P_XZ * cc.c_XZ, prec_P.P_ZZplusYZ * cc.c_ZZ);
78 f = f.squared() * g_RR_at_P;
81 typename gt_type::value_type g_RQ_at_P =
typename gt_type::value_type(
82 prec_P.P_ZZplusYZ * cc.c_ZZ, prec_P.P_XY * cc.c_XY + prec_P.P_XZ * cc.c_XZ);
Definition: pairing/detail/alt_bn128/params.hpp:38
Definition: pairing/detail/edwards/183/types.hpp:38
static gt_type::value_type process(const policy_type::ate_g1_precomputed_type &prec_P, const policy_type::ate_g2_precomputed_type &prec_Q)
Definition: edwards/183/ate_miller_loop.hpp:53
Definition: edwards/183/ate_miller_loop.hpp:42
A struct representing a Edwards curve, providing 128 bits of security.
Definition: curves/edwards.hpp:51
policy_type::gt_field_type gt_type
Definition: curves/edwards.hpp:69