Expand description
alt_bn128_g1_msm reference implementation
This crate is the proposed reference implementation of the
alt_bn128_g1_msm SIMD: Σᵢ scalarsᵢ · pointsᵢ over BN254 G1, computed
by a Pippenger window-NAF multi-scalar multiplication. It is no_std-
compatible so the same code path can run on host (for off-chain
verifiers) and inside agave’s syscall bridge.
Two entrypoints:
alt_bn128_g1_msm_be— proposed syscall surface. Takes the wire byte layout[n: u32 LE | scalar₀ | point₀ | scalar₁ | point₁ | …]and returns 64-byte BE G1Affine.naive_msm_be— same surface, but implemented asnsequential scalar multiplications + additions. Serves as the baseline for benchmarks: it is what an on-chain verifier ends up doing today when it can only callalt_bn128_g1_multiplication_beper point.
Both functions reject identity points + zero scalars consistently
(skipping their contribution rather than erroring), to match the
existing alt_bn128_* syscalls’ semantics on the empty/identity
input edge cases.
Enums§
- MsmError
- Wire-format error code matching the existing
alt_bn128_*syscalls.
Functions§
- alt_
bn128_ g1_ msm_ be - Wire format expected by the proposed
alt_bn128_g1_msm_besyscall. - naive_
msm_ be - Baseline: sequential
Σᵢ scalarᵢ · pointᵢvia per-point scalar mul + add.