NAMESPACE_END ECP::ECP(const ECP &ecp, bool convertToMontgomeryRepresentation) { if (convertToMontgomeryRepresentation && !ecp.GetField().IsMontgomeryRepresentation()) { m_fieldPtr.reset(new MontgomeryRepresentation(ecp.GetField().GetModulus())); m_a = GetField().ConvertIn(ecp.m_a); m_b = GetField().ConvertIn(ecp.m_b); } else operator=(ecp); }
void EcPrecomputation<ECP>::SetCurveAndBase(const ECP &ec, const ECP::Point &base) { m_mr.reset(new MontgomeryRepresentation(ec.GetField().GetModulus())); m_ec.reset(new ECP(*m_mr, m_mr->ConvertIn(ec.GetA()), m_mr->ConvertIn(ec.GetB()))); m_ep.SetGroupAndBase(*m_ec, ToMontgomery(*m_mr, base)); }