don't declare so many vars
This commit is contained in:
parent
8333be5d2d
commit
3c1ade74aa
|
|
@ -161,12 +161,11 @@ func PrimitiveRootFast(modulus *big.Int, tpf map[string]*big.Int) (*big.Int, err
|
|||
|
||||
isPrimitive := true
|
||||
for p := range tpf {
|
||||
e := new(big.Int)
|
||||
f, _ := new(big.Int).SetString(p, 10)
|
||||
k := new(big.Int).Div(phi, f)
|
||||
e.Exp(g, k, modulus)
|
||||
|
||||
if e.Cmp(big.NewInt(1)) == 0 {
|
||||
// we already know factors are valid from computing phi
|
||||
k, _ := new(big.Int).SetString(p, 10)
|
||||
k.Div(phi, k)
|
||||
k.Exp(g, k, modulus)
|
||||
if k.Cmp(big.NewInt(1)) == 0 {
|
||||
isPrimitive = false
|
||||
break
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue