Crates.io | sylow |
lib.rs | sylow |
version | 0.1.1 |
source | src |
created_at | 2024-09-09 00:35:19.0454 |
updated_at | 2024-09-09 04:18:07.477772 |
description | Implementation of the BLS signature scheme using the alt-bn128 curve. |
homepage | https://github.com/warlock-labs/sylow |
repository | https://github.com/warlock-labs/sylow.git |
max_upload_size | |
id | 1368693 |
size | 8,672,485 |
Sylow (หsyหlษv) is a comprehensive Rust library for elliptic curve cryptography, specifically tailored for the BN254 ( alt-bn128) curve. It provides a robust implementation of finite fields, elliptic curve groups, and pairing-based cryptography, making it an ideal choice for applications in blockchain, zero-knowledge proofs, and other cryptographic systems.
Add this to your Cargo.toml
:
[dependencies]
sylow = "0.1.0"
Here's a basic example demonstrating key generation, signing, and verification:
use sylow::{KeyPair, sign, verify};
fn main() {
// Generate a new key pair
let key_pair = KeyPair::generate();
// Message to be signed
let message = b"Hello, Sylow!";
// Sign the message
match sign(&key_pair.secret_key, message) {
Ok(signature) => {
// Verify the signature
match verify(&key_pair.public_key, message, &signature) {
Ok(is_valid) => {
assert!(is_valid, "Signature verification failed");
println!("Signature verified successfully!");
}
Err(e) => println!("Verification error: {:?}", e),
}
}
Err(e) => println!("Signing error: {:?}", e),
}
}
For more examples, please see the examples directory.
Expander
trait, such as the XMD and XOF
algorithms on any hasher from sha3.Sylow is designed with performance in mind, leveraging optimized algorithms for j-invariant zero curves, the optimal ate pairing for efficient signature verification, as well as multiprecision Montgomery arithmetic.
Sylow is designed in compliance with the recommendations set forth by Cloudflare
in RFC 9380, especially regarding hashing an arbitrary byte array to an
element of the curve. We provide multiple secure implementations of the hash_to_field
standard and implement the
Shallue-van de Woestijne encoding for elliptic curve points.
The multiprecision arithmetic operations are implemented in constant time, ensuring resistance to side-channel attacks. Constant-time operations are used whenever possible, and there are currently no variable-time functions used in Sylow.
If you discover any security issues, please report them to team@warlock.xyz.
For detailed API documentation, please refer to docs.rs/sylow.
We welcome contributions to Sylow! Whether it's bug reports, feature requests, or code contributions, please feel free to engage with the project by submitting issues, feature requests, or pull requests on the GitHub repository.
This project is licensed under the MIT License. See the LICENSE file for details.
This project is maintained by:
Warlock Labs - https://github.com/warlock-labs
Project Link: https://github.com/warlock-labs/sylow