Skip to content

Commit

Permalink
use g1_multi_exp in g1_lincomb
Browse files Browse the repository at this point in the history
  • Loading branch information
kevaundray committed Apr 23, 2024
1 parent ef0c8b1 commit 733a255
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions specs/deneb/polynomial-commitments.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,10 @@ def g1_lincomb(points: Sequence[KZGCommitment], scalars: Sequence[BLSFieldElemen
BLS multiscalar multiplication. This function can be optimized using Pippenger's algorithm and variants.
"""
assert len(points) == len(scalars)
result = bls.Z1()
for x, a in zip(points, scalars):
result = bls.add(result, bls.multiply(bls.bytes48_to_G1(x), a))
points_g1 = []
for point in points:
points_g1.append(bls.bytes48_to_G1(point))
result = bls.g1_multi_exp(points_g1,scalars)
return KZGCommitment(bls.G1_to_bytes48(result))
```

Expand Down

0 comments on commit 733a255

Please sign in to comment.