Skip to content

Commit c6d5b69

Browse files
committed
Added default Pollard in Go
1 parent 842476e commit c6d5b69

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Pollard_Rho_Algorithm/Go/jcla1/pollard.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ import (
44
"math"
55
)
66

7+
func DefaultPollard(n int) int {
8+
return Pollard(n, defaultFunc)
9+
}
10+
11+
func defaultFunc(x, n int) int {
12+
return (x*x - 1) % n
13+
}
14+
715
func Pollard(n int, f func(int, int) int) int {
816
x, y, d := 2, 2, 1
917
for d == 1 {

0 commit comments

Comments
 (0)