DiscreteLogarithmPackage M

ffcat.spad line 348 [edit on github]

DiscreteLogarithmPackage implements help functions for discrete logarithms in monoids using small cyclic groups.

shanksDiscLogAlgorithm: (M, M, NonNegativeInteger) -> Union(NonNegativeInteger, failed)

shanksDiscLogAlgorithm(b, a, p) computes s with b^s = a for assuming that a and b are elements in a ‘small’ cyclic group of order p by Shank's algorithm. Note: this is a subroutine of the function discreteLog.