bool CompositeIntegerGroup::IsGenerator(const Element &a) const { if(IsIdentity(Exponentiate(a, 2))) return false; if(IsIdentity(Exponentiate(a, _s))) return false; if(!IsIdentity(Exponentiate(a, _n))) return false; return true; }
bool CppECGroup::IsProbablyValid() const { return IsElement(GetGenerator()) && IsIdentity(Exponentiate(GetGenerator(), GetOrder())) && CryptoPP::IsPrime(_curve.FieldSize()) && GetOrder().IsPrime(); }
Element CppECGroup::RandomElement() const { return Exponentiate(GetGenerator(), RandomExponent()); }
Element ByteGroup::CascadeExponentiate(const Element &a1, const Integer &e1, const Element &a2, const Integer &e2) const { return Multiply(Exponentiate(a1, e1), Exponentiate(a2, e2)); }
bool IntegerGroup::IsGenerator(const Element &a) const { return IsElement(a) && ((Exponentiate(a, GetOrder()) == GetIdentity())) && (!(Exponentiate(a, Integer(2)) == GetIdentity())); }