This library provides implementations of prime fields and elliptic curve operations in Rust. In the future, it will also include lattice-based cryptography, signatures, and symmetric/asymmetric cryptography.
src/lib.rs: Contains the core traits and structs, including thePrimeFieldtrait and theFestruct for representing field elements.src/curves.rs: Defines specific prime fields, such asBN254andSmallPrime, and implements thePrimeFieldtrait for them. It also includes unit tests for field element conversions and addition.src/point.rs: Defines thePointstruct for representing points on an elliptic curve and implements basic point operations like addition.
To use this library, add the following to your Cargo.toml file:
[dependencies]
zuer = { git = "https://github.com/hhamud/zuer" }Here's a basic example of how to use the library:
use zuer::{Fe, SmallPrime};
fn main() {
let a: Fe<SmallPrime> = 5u64.into();
let b: Fe<SmallPrime> = 10u64.into();
let c = a + b;
println!("a: {}", a.value());
println!("b: {}", b.value());
println!("c: {}", c.value());
}The src/curves.rs file includes unit tests for basic field operations. To run the tests, use the following command:
cargo testContributions are welcome! Please feel free to submit pull requests or open issues to suggest improvements or report bugs.
This library is licensed under the MIT License. See the LICENSE file for details.