Skip to content

Commit e6b842e

Browse files
committed
bindings/go: add AggregateWithRandomness().
1 parent e839fe7 commit e6b842e

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

bindings/go/blst.go

+18
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,15 @@ func (agg *P2Aggregate) Aggregate(elmts []*P2Affine,
928928
return agg.coreAggregate(getter, groupcheck, len(elmts))
929929
}
930930

931+
func (agg *P2Aggregate) AggregateWithRandomness(pointsIf interface{},
932+
scalarsIf interface{}, nbits int, groupcheck bool) bool {
933+
if groupcheck && !P2AffinesValidate(pointsIf) {
934+
return false
935+
}
936+
agg.v = P2AffinesMult(pointsIf, scalarsIf, nbits)
937+
return true
938+
}
939+
931940
// Aggregate compressed elements
932941
func (agg *P2Aggregate) AggregateCompressed(elmts [][]byte,
933942
groupcheck bool) bool {
@@ -1519,6 +1528,15 @@ func (agg *P1Aggregate) Aggregate(elmts []*P1Affine,
15191528
return agg.coreAggregate(getter, groupcheck, len(elmts))
15201529
}
15211530

1531+
func (agg *P1Aggregate) AggregateWithRandomness(pointsIf interface{},
1532+
scalarsIf interface{}, nbits int, groupcheck bool) bool {
1533+
if groupcheck && !P1AffinesValidate(pointsIf) {
1534+
return false
1535+
}
1536+
agg.v = P1AffinesMult(pointsIf, scalarsIf, nbits)
1537+
return true
1538+
}
1539+
15221540
// Aggregate compressed elements
15231541
func (agg *P1Aggregate) AggregateCompressed(elmts [][]byte,
15241542
groupcheck bool) bool {

bindings/go/blst_minpk.tgo

+9
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,15 @@ func (agg *P2Aggregate) Aggregate(elmts []*P2Affine,
458458
return agg.coreAggregate(getter, groupcheck, len(elmts))
459459
}
460460

461+
func (agg *P2Aggregate) AggregateWithRandomness(pointsIf interface{},
462+
scalarsIf interface{}, nbits int, groupcheck bool) bool {
463+
if groupcheck && !P2AffinesValidate(pointsIf) {
464+
return false
465+
}
466+
agg.v = P2AffinesMult(pointsIf, scalarsIf, nbits)
467+
return true
468+
}
469+
461470
// Aggregate compressed elements
462471
func (agg *P2Aggregate) AggregateCompressed(elmts [][]byte,
463472
groupcheck bool) bool {

0 commit comments

Comments
 (0)