Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-lj committed Oct 1, 2024
1 parent d567183 commit accd370
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion fastcrypto/src/groups/bls12381.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ use serde::{de, Deserialize};
use std::fmt::Debug;
use std::ops::{Add, Div, Mul, Neg, Sub};
use std::ptr;
use std::ptr::null;
use zeroize::Zeroize;

/// Elements of the group G_1 in BLS 12-381.
Expand Down Expand Up @@ -425,7 +426,7 @@ impl G1ElementUncompressed {

// Inspired by https://github.com/supranational/blst/blob/6f3136ffb636974166a93f2f25436854fe8d10ff/bindings/rust/src/pippenger.rs#L334-L337
let mut ret = blst_p1::default();
let p: [*const _; 2] = [&affine_points[0], ptr::null()];
let p: [*const _; 2] = [&affine_points[0], null()];
unsafe { blst_p1s_add(&mut ret, &p[0], terms.len()) };
Ok(G1Element(ret))
}
Expand Down
2 changes: 1 addition & 1 deletion fastcrypto/src/tests/bls12381_group_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ fn test_g1_sum() {
#[test]
fn test_g1_large_sum() {
let mut rng = thread_rng();
let n: usize = 1000;
let n: usize = 100;
let points: Vec<G1Element> = (0..n)
.map(|_| G1Element::generator() * Scalar::rand(&mut rng))
.collect();
Expand Down

0 comments on commit accd370

Please sign in to comment.