Skip to content

Commit

Permalink
Constantine - use batch affine
Browse files Browse the repository at this point in the history
  • Loading branch information
Armantidas committed Jan 6, 2024
1 parent 1a0ef97 commit 30b1aa6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 3 additions & 17 deletions constantine/src/types/g1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,23 +357,9 @@ impl G1Affine<CtG1, CtFp> for CtG1Affine {
}

fn into_affines_loc(out: &mut [Self], g1: &[CtG1]) {
g1.iter()
.zip(out.iter_mut())
.for_each(|(g, out_slot)| unsafe {
constantine::ctt_bls12_381_g1_jac_affine(&mut out_slot.0, &g.0);
});
}

fn into_affines(g1: &[CtG1]) -> Vec<Self> {
g1.iter()
.map(|g| {
let mut ret = Self::default();
unsafe {
constantine::ctt_bls12_381_g1_jac_affine(&mut ret.0, &g.0);
}
ret
})
.collect::<Vec<_>>()
unsafe{
constantine::ctt_bls12_381_g1_jac_batch_affine(core::mem::transmute(out.as_mut_ptr()), core::mem::transmute(g1.as_ptr()), g1.len());
}
}

fn to_proj(&self) -> CtG1 {
Expand Down

0 comments on commit 30b1aa6

Please sign in to comment.