Skip to content

Remove duplicate subgroup check in ecpairing precompile #4939

@MegaRedHand

Description

@MegaRedHand

Looking at flamegraphs, it seems we are doing subgroup checks two times during an ecpairing precompile call: one before calling compute_batch, and another inside it.

First check (in our side):

if !g2.is_in_subgroup() {
return Err(PrecompileError::PointNotInSubgroup.into());
}

Second, compute_batch check (in the lambdaworks side):

https://github.com/lambdaclass/lambdaworks/blob/3b96e92c046dc7088a53dfb6f4772489a05cc11b/crates/math/src/elliptic_curve/short_weierstrass/curves/bn_254/pairing.rs#L163-L165

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    No status

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions