Skip to content

Commit

Permalink
fix: use correct bn128 mul input length (#1238)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtraglia authored Mar 28, 2024
1 parent a114438 commit 020c6ff
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions crates/precompile/src/bn128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,17 @@ pub mod pair {
}

/// Input length for the add operation.
pub const ADD_INPUT_LEN: usize = 128;
/// `ADD` takes two uncompressed G1 points (64 bytes each).
pub const ADD_INPUT_LEN: usize = 64 + 64;

/// Input length for the multiplication operation.
pub const MUL_INPUT_LEN: usize = 128;
/// `MUL` takes an uncompressed G1 point (64 bytes) and scalar (32 bytes).
pub const MUL_INPUT_LEN: usize = 64 + 32;

/// Pair element length.
pub const PAIR_ELEMENT_LEN: usize = 192;
/// `PAIR` elements are composed of an uncompressed G1 point (64 bytes) and an uncompressed G2 point
/// (128 bytes).
pub const PAIR_ELEMENT_LEN: usize = 64 + 128;

/// Reads a single `Fq` from the input slice.
///
Expand Down

0 comments on commit 020c6ff

Please sign in to comment.