Skip to content

Commit

Permalink
bindings/go: add AggregateWithRandomness().
Browse files Browse the repository at this point in the history
  • Loading branch information
dot-asm committed Jul 23, 2024
1 parent e839fe7 commit e6b842e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
18 changes: 18 additions & 0 deletions bindings/go/blst.go
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,15 @@ func (agg *P2Aggregate) Aggregate(elmts []*P2Affine,
return agg.coreAggregate(getter, groupcheck, len(elmts))
}

func (agg *P2Aggregate) AggregateWithRandomness(pointsIf interface{},
scalarsIf interface{}, nbits int, groupcheck bool) bool {
if groupcheck && !P2AffinesValidate(pointsIf) {
return false
}
agg.v = P2AffinesMult(pointsIf, scalarsIf, nbits)
return true
}

// Aggregate compressed elements
func (agg *P2Aggregate) AggregateCompressed(elmts [][]byte,
groupcheck bool) bool {
Expand Down Expand Up @@ -1519,6 +1528,15 @@ func (agg *P1Aggregate) Aggregate(elmts []*P1Affine,
return agg.coreAggregate(getter, groupcheck, len(elmts))
}

func (agg *P1Aggregate) AggregateWithRandomness(pointsIf interface{},
scalarsIf interface{}, nbits int, groupcheck bool) bool {
if groupcheck && !P1AffinesValidate(pointsIf) {
return false
}
agg.v = P1AffinesMult(pointsIf, scalarsIf, nbits)
return true
}

// Aggregate compressed elements
func (agg *P1Aggregate) AggregateCompressed(elmts [][]byte,
groupcheck bool) bool {
Expand Down
9 changes: 9 additions & 0 deletions bindings/go/blst_minpk.tgo
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,15 @@ func (agg *P2Aggregate) Aggregate(elmts []*P2Affine,
return agg.coreAggregate(getter, groupcheck, len(elmts))
}

func (agg *P2Aggregate) AggregateWithRandomness(pointsIf interface{},
scalarsIf interface{}, nbits int, groupcheck bool) bool {
if groupcheck && !P2AffinesValidate(pointsIf) {
return false
}
agg.v = P2AffinesMult(pointsIf, scalarsIf, nbits)
return true
}

// Aggregate compressed elements
func (agg *P2Aggregate) AggregateCompressed(elmts [][]byte,
groupcheck bool) bool {
Expand Down

0 comments on commit e6b842e

Please sign in to comment.