fix modulus=2

This commit is contained in:
filifa 2025-08-19 21:59:11 -04:00
parent d79d532014
commit f2b157732a
1 changed files with 2 additions and 2 deletions

View File

@ -29,8 +29,8 @@ 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) {
for g := big.NewInt(2); 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 := new(big.Int).Set(g) e := big.NewInt(1)
exps := make(map[string]big.Int) exps := make(map[string]big.Int)
for k := big.NewInt(1); k.Cmp(modulus) == -1; k.Add(k, big.NewInt(1)) { for k := big.NewInt(1); k.Cmp(modulus) == -1; k.Add(k, big.NewInt(1)) {
e.Mul(e, g) e.Mul(e, g)