| Crates.io | avila-nucleus |
| lib.rs | avila-nucleus |
| version | 0.1.0 |
| created_at | 2025-12-08 18:31:32.220884+00 |
| updated_at | 2025-12-08 18:31:32.220884+00 |
| description | Atomic-level operations - Foundation of Avila cryptography stack |
| homepage | https://avila.inc |
| repository | https://github.com/avilaops/arxis |
| max_upload_size | |
| id | 1974187 |
| size | 195,109 |
Low-level cryptographic primitives and bit-manipulation operations
avila-nucleus provides foundational building blocks for cryptographic operations, including constant-time comparisons, bit manipulation, SIMD operations, and mathematical primitives used throughout the Avila ecosystem.
bitsLow-level bit manipulation and arithmetic operations:
u256_ops: 256-bit unsigned integer operationsu512_ops: 512-bit unsigned integer operationsu1024_ops: 1024-bit unsigned integer operationsu2048_ops: 2048-bit unsigned integer operationsu4096_ops: 4096-bit unsigned integer operationssimdSIMD-accelerated operations (x86_64):
use avila_nucleus::bits::eq256;
let a = [1u64, 2, 3, 4];
let b = [1u64, 2, 3, 4];
assert!(eq256(&a, &b));
use avila_nucleus::bits::u256_ops::*;
let a = [100u64, 0, 0, 0];
let b = [50u64, 0, 0, 0];
let (sum, carry) = add256(&a, &b);
assert_eq!(sum[0], 150);
use avila_nucleus::bits::u256_ops::*;
let dividend = [107u64, 0, 0, 0];
let divisor = [10u64, 0, 0, 0];
let (quotient, remainder) = div256(÷nd, &divisor);
assert_eq!(quotient[0], 10);
assert_eq!(remainder[0], 7);
All operations in this crate are designed with security in mind:
The crate is optimized for:
Run the test suite:
cargo test
Current test coverage: 47 tests passing
core only (no_std compatible)Part of the Avila cryptographic suite.
avila-primitives: High-level big integer types using these primitivesavila-crypto: Cryptographic algorithms built on these foundationsavila-atom: Thread-safe atomic operationsWhen adding new operations: