add special case for modulus=1
This commit is contained in:
@@ -29,6 +29,10 @@ var modulus string
|
|||||||
var tpf []string
|
var tpf []string
|
||||||
|
|
||||||
func computeNaive(modulus *big.Int) (*big.Int, error) {
|
func computeNaive(modulus *big.Int) (*big.Int, error) {
|
||||||
|
if modulus.Cmp(big.NewInt(1)) == 0 {
|
||||||
|
return big.NewInt(0), nil
|
||||||
|
}
|
||||||
|
|
||||||
for g := big.NewInt(1); g.Cmp(modulus) == -1; g.Add(g, big.NewInt(1)) {
|
for g := big.NewInt(1); g.Cmp(modulus) == -1; g.Add(g, big.NewInt(1)) {
|
||||||
e := big.NewInt(1)
|
e := big.NewInt(1)
|
||||||
exps := make(map[string]big.Int)
|
exps := make(map[string]big.Int)
|
||||||
|
|||||||
Reference in New Issue
Block a user