Skip to content

Commit

Permalink
pre-allocate pairing vector length
Browse files Browse the repository at this point in the history
  • Loading branch information
samkim-crypto committed Nov 5, 2024
1 parent 59afe46 commit 9bdf55e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion curves/bn254/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ mod target_arch {

let ele_len = input.len().saturating_div(ALT_BN128_PAIRING_ELEMENT_LEN);

let mut vec_pairs: Vec<(G1, G2)> = Vec::new();
let mut vec_pairs: Vec<(G1, G2)> = Vec::with_capacity(ele_len);
for chunk in input.chunks(ALT_BN128_PAIRING_ELEMENT_LEN) {
let (p_bytes, q_bytes) = chunk.split_at(G1_POINT_SIZE);

Expand Down

0 comments on commit 9bdf55e

Please sign in to comment.