Crates.io | crystals-dilithium |
lib.rs | crystals-dilithium |
version | 1.0.0 |
source | src |
created_at | 2023-07-04 17:57:04.849004 |
updated_at | 2023-07-04 17:57:04.849004 |
description | Pure RUST implementation of CRYSTALS-Dilithium digital signature scheme |
homepage | https://www.quantumblockchains.io/ |
repository | https://github.com/Quantum-Blockchains/dilithium |
max_upload_size | |
id | 908233 |
size | 736,300 |
Pure RUST implementation of CRYSTALS-Dilithium digital signature scheme in 3 variants:
The code was ported from the original reference source code provided by the authors of the algorithm.
The implementation takes advantage of RUST clean and safe memory management. The code is much cleaner and shorter compared to the original. The implementation was verified in two separate ways:
Use at Your Own Risk
This implementation of the CRYSTALS-Dilithium cryptographic algorithm has not yet undergone a formal security audit by a recognized authority. As a result, there may be unknown security vulnerabilities, weaknesses, or potential flaws in the code. Users are advised to exercise caution when implementing or using this code.
cargo build --release
use dilithium2::Keypair;
let keypair = Keypair::generate(Some(&seed));
let signature = keypair.sign(&msg);
let is_verified = keypair.public.verify(&msg, &signature);
cargo test
Benchmarks are run using criterion.rs:
cargo bench
Running on 2,6 GHz 6-Core Intel Core i7
Benchmark | time |
---|---|
keypair generation | 83.548 µs |
signing | 137.19 µs |
signature verification | 57.331 µs |
cargo doc --open
By contributing to this repository, you agree that your contributions will be licensed under the GPLv3 License.