Skip to content

Commit

Permalink
test: half-GCD test with bigger integers
Browse files Browse the repository at this point in the history
  • Loading branch information
yelhousni committed Sep 21, 2024
1 parent dda7a27 commit 6f69c7e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ecc/eisenstein_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package ecc

import (
"crypto/rand"
"math/big"
"math/rand"
"testing"

"github.com/leanovate/gopter"
Expand Down Expand Up @@ -245,8 +245,9 @@ func TestEisensteinHalfGCD(t *testing.T) {
// GenNumber generates a random integer
func GenNumber() gopter.Gen {
return func(genParams *gopter.GenParameters) *gopter.GenResult {
elmt := *big.NewInt(rand.Int63())
genResult := gopter.NewGenResult(elmt, gopter.NoShrinker)
var prime, _ = new(big.Int).SetString("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed", 16) // 2^255 - 19
elmt, _ := rand.Int(rand.Reader, prime)
genResult := gopter.NewGenResult(*elmt, gopter.NoShrinker)
return genResult
}
}
Expand Down

0 comments on commit 6f69c7e

Please sign in to comment.