26 #ifndef CRYPTO3_ALGEBRA_CURVES_SHORT_WEIERSTRASS_G1_ELEMENT_JACOBIAN_WITH_A4_0_MADD_2007_BL_HPP
27 #define CRYPTO3_ALGEBRA_CURVES_SHORT_WEIERSTRASS_G1_ELEMENT_JACOBIAN_WITH_A4_0_MADD_2007_BL_HPP
43 template<
typename ElementType>
44 constexpr
static inline ElementType
process(
const ElementType &first,
45 const ElementType &second) {
47 using field_value_type =
typename ElementType::field_type::value_type;
52 const field_value_type Z1Z1 = (first.Z).squared();
53 const field_value_type U2 = second.X * Z1Z1;
54 const field_value_type S2 = second.Y * first.Z * Z1Z1;
55 const field_value_type H = U2 - (first.X);
56 const field_value_type HH = H.squared();
57 const field_value_type I = HH.doubled().doubled();
58 const field_value_type J = H * I;
59 const field_value_type r = (S2 - (first.Y)).doubled();
60 const field_value_type V = first.X * I;
61 const field_value_type X3 = r.squared() - J - V.doubled();
62 const field_value_type Y3 =
63 r * (V - X3) - (first.Y * J).doubled();
64 const field_value_type Z3 = (first.Z + H).squared() - Z1Z1 - HH;
66 return ElementType(X3, Y3, Z3);
A struct representing element addition from the group G1 of short Weierstrass curve for jacobian_with...
Definition: short_weierstrass/jacobian_with_a4_0/madd_2007_bl.hpp:41
constexpr static ElementType process(const ElementType &first, const ElementType &second)
Definition: short_weierstrass/jacobian_with_a4_0/madd_2007_bl.hpp:44