Skip to content

Commit

Permalink
add a privatetopoint test (#176)
Browse files Browse the repository at this point in the history
Co-authored-by: LucasLvy <[email protected]>
  • Loading branch information
gregoryguillou and 0xLucqs authored Nov 2, 2022
1 parent dd1e926 commit bc34fac
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions curve_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@ func BenchmarkCurveSign(b *testing.B) {
}
}

func TestPrivateToPoint(t *testing.T) {
x, _, err := Curve.PrivateToPoint(big.NewInt(2))
if err != nil {
t.Errorf("PrivateToPoint err %v", err)
}
expectedX, _ := new(big.Int).SetString("3324833730090626974525872402899302150520188025637965566623476530814354734325", 10)
if x.Cmp(expectedX) != 0 {
t.Errorf("Actual public key %v different from expected %v", x, expectedX)
}
}

func TestPedersenHash(t *testing.T) {
testPedersen := []struct {
elements []*big.Int
Expand Down

0 comments on commit bc34fac

Please sign in to comment.