avila_primitives/
lib.rs

1//! # Avila Primitives
2//!
3//! Big integer primitives for cryptography and high-precision arithmetic.
4//!
5//! This crate provides:
6//! - **U256, U512, U1024, U2048, U4096** - Unsigned big integers
7//! - **I256, I512, I1024, I2048, I4096** - Signed big integers
8//! - **Arithmetic operations** - Add, sub, mul, div, mod with overflow detection
9//! - **Bitwise operations** - AND, OR, XOR, NOT, shifts, rotations
10//! - **Constant-time operations** - For cryptographic safety
11//! - **SIMD acceleration** - Optional AVX2/AVX512 support
12//!
13//! Built on top of `avila-nucleus` for low-level bit manipulation.
14
15#![cfg_attr(not(feature = "std"), no_std)]
16#![warn(missing_docs)]
17#![warn(clippy::all)]
18
19pub mod u256;
20pub mod u512;
21pub mod u1024;
22pub mod u2048;
23pub mod u4096;
24
25pub mod i256;
26pub mod i512;
27pub mod i1024;
28pub mod i2048;
29pub mod i4096;
30
31pub mod traits;
32
33// Re-export types at the root for easier access
34pub use u256::U256;
35pub use u512::U512;
36pub use u1024::U1024;
37pub use u2048::U2048;
38pub use u4096::U4096;
39
40pub use i256::I256;
41pub use i512::I512;
42pub use i1024::I1024;
43pub use i2048::I2048;
44pub use i4096::I4096;
45
46pub use traits::{BigInt, BigUint};
47
48pub mod prelude {
49    //! Common imports for convenience
50
51    pub use crate::u256::U256;
52    pub use crate::u512::U512;
53    pub use crate::u1024::U1024;
54    pub use crate::u2048::U2048;
55    pub use crate::u4096::U4096;
56
57    pub use crate::i256::I256;
58    pub use crate::i512::I512;
59    pub use crate::i1024::I1024;
60    pub use crate::i2048::I2048;
61    pub use crate::i4096::I4096;
62
63    pub use crate::traits::{BigInt, BigUint};
64}