Exemple #1
0
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;
}
Exemple #2
0
 bool CppECGroup::IsProbablyValid() const
 {
   return IsElement(GetGenerator()) && 
     IsIdentity(Exponentiate(GetGenerator(), GetOrder())) &&
     CryptoPP::IsPrime(_curve.FieldSize()) &&
     GetOrder().IsPrime();
 }
Exemple #3
0
 Element CppECGroup::RandomElement() const
 {
   return Exponentiate(GetGenerator(), RandomExponent());
 }
Exemple #4
0
Element ByteGroup::CascadeExponentiate(const Element &a1, const Integer &e1,
                                       const Element &a2, const Integer &e2) const
{
    return Multiply(Exponentiate(a1, e1), Exponentiate(a2, e2));
}
Exemple #5
0
 bool IntegerGroup::IsGenerator(const Element &a) const 
 {
   return IsElement(a) 
     && ((Exponentiate(a, GetOrder()) == GetIdentity()))
     && (!(Exponentiate(a, Integer(2)) == GetIdentity()));
 }