Skip to content

Commit

Permalink
Adding Tonneli-Shanks algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
armfazh committed Aug 21, 2020
1 parent a641a01 commit 6c51d64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion field/fp.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ func (s sqrt1mod16) Sqrt(x Elt) Elt {
return z
}

// Tonelli-Shanks algorithm.
func generateSqrt1mod16(f *fp) hasSqrt {
one := big.NewInt(1)
two := big.NewInt(2)
Expand All @@ -226,7 +227,6 @@ func generateSqrt1mod16(f *fp) hasSqrt {
c4 := findNonSquare(f)
c5 := f.Exp(c4, c2).(*fpElt)

fmt.Printf("c1: %v, c2: %v, c3: %v, c4: %v, c5: %v\n", c1, c2, c3, c4, c5)

return sqrt1mod16{fp: f, c1: c1, c3: c3, c5: c5}
}
Expand Down

0 comments on commit 6c51d64

Please sign in to comment.