Initial commit

This commit is contained in:
Pratyush Mishra
2020-10-11 19:50:41 -07:00
commit 43ca2132fd
209 changed files with 18825 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
macro_rules! n_fold {
($tmp:ident, $v:ident, $func:ident, $count:ident) => {
const ITERS: usize = 1000;
#[cfg(not(feature = "n_fold"))]
$tmp.$func(&$v[$count].1);
#[cfg(feature = "n_fold")]
for _ in 0..ITERS {
$tmp.$func(&$v[$count].1);
}
};
($tmp:ident, $func:ident) => {
const ITERS: usize = 1000;
#[cfg(not(feature = "n_fold"))]
$tmp.$func();
#[cfg(feature = "n_fold")]
for _ in 0..ITERS {
$tmp.$func();
}
};
}
macro_rules! prepared_v {
($v:ident, $rng:ident) => {
let $v: Vec<(G1Prepared<Parameters>, G2Prepared<Parameters>)> = (0..SAMPLES)
.map(|_| {
(
G1Affine::from(G1::rand(&mut $rng)).into(),
G2Affine::from(G2::rand(&mut $rng)).into(),
)
})
.collect();
};
}
macro_rules! affine_v {
($v:ident, $rng:ident) => {
let $v: Vec<(G1Affine, G2Affine)> = (0..SAMPLES)
.map(|_| {
(
G1Affine::from(G1::rand(&mut $rng)).into(),
G2Affine::from(G2::rand(&mut $rng)).into(),
)
})
.collect();
};
}