Skip to content

Commit

Permalink
Add Go bindings for group check and field check
Browse files Browse the repository at this point in the history
  • Loading branch information
simonatsn committed Jul 26, 2020
1 parent c2a2ff3 commit d31b0b5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
12 changes: 12 additions & 0 deletions bindings/go/blst.go
Original file line number Diff line number Diff line change
Expand Up @@ -1410,6 +1410,10 @@ func (p1 *P1Affine) Uncompress(in []byte) *P1Affine {
return p1
}

func (p1 *P1Affine) InG1() bool {
return bool(C.blst_p1_affine_in_g1(p1))
}

func (dummy *P1Affine) BatchUncompress(in [][]byte) []*P1Affine {
// Allocate space for all of the resulting points. Later we'll save pointers
// and return those so that the result could be used in other functions,
Expand Down Expand Up @@ -1612,6 +1616,10 @@ func (p2 *P2Affine) Uncompress(in []byte) *P2Affine {
return p2
}

func (p2 *P2Affine) InG2() bool {
return bool(C.blst_p2_affine_in_g2(p2))
}

func (dummy *P2Affine) BatchUncompress(in [][]byte) []*P2Affine {
// Allocate space for all of the resulting points. Later we'll save pointers
// and return those so that the result could be used in other functions,
Expand Down Expand Up @@ -1805,6 +1813,10 @@ func (s *Scalar) Deserialize(in []byte) *Scalar {
return s
}

func (s *Scalar) Valid() bool {
return bool(C.blst_scalar_fr_check(s))
}

//
// LEndian
//
Expand Down
4 changes: 4 additions & 0 deletions bindings/go/blst_misc.tgo
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ func (s *Scalar) Deserialize(in []byte) *Scalar {
return s
}

func (s *Scalar) Valid() bool {
return bool(C.blst_scalar_fr_check(s))
}

//
// LEndian
//
Expand Down
4 changes: 4 additions & 0 deletions bindings/go/blst_px.tgo
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ func (p1 *P1Affine) Uncompress(in []byte) *P1Affine {
return p1
}

func (p1 *P1Affine) InG1() bool {
return bool(C.blst_p1_affine_in_g1(p1))
}

func (dummy *P1Affine) BatchUncompress(in [][]byte) []*P1Affine {
// Allocate space for all of the resulting points. Later we'll save pointers
// and return those so that the result could be used in other functions,
Expand Down

0 comments on commit d31b0b5

Please sign in to comment.