-
Notifications
You must be signed in to change notification settings - Fork 146
/
Copy pathlib.rs
39 lines (33 loc) · 866 Bytes
/
lib.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#![cfg_attr(feature = "asm", feature(asm_const))]
mod arithmetic;
pub mod bn256;
pub mod pairing;
pub mod pasta;
pub mod secp256k1;
pub mod serde;
#[macro_use]
mod derive;
pub use arithmetic::CurveAffineExt;
pub use pasta_curves::arithmetic::{Coordinates, CurveAffine, CurveExt};
// Re-export ff and group to simplify down stream dependencies
#[cfg(feature = "reexport")]
pub use ff;
#[cfg(not(feature = "reexport"))]
use ff;
#[cfg(feature = "reexport")]
pub use group;
#[cfg(not(feature = "reexport"))]
use group;
#[cfg(test)]
pub mod tests;
#[cfg(all(feature = "prefetch", target_arch = "x86_64"))]
#[inline(always)]
pub fn prefetch<T>(data: &[T], offset: usize) {
use core::arch::x86_64::_mm_prefetch;
unsafe {
_mm_prefetch(
data.as_ptr().add(offset) as *const i8,
core::arch::x86_64::_MM_HINT_T0,
);
}
}