HOKG is a Rust library implementing the Hensel-Optimized Key Generation algorithm for elliptic curve cryptography (ECC). By leveraging Hensel's lemma, HOKG achieves up to 40% data efficiency in key generation, making it ideal for resource-constrained environments like IoT and edge devices. This library is efficient, secure, and built with modern Rust best practices.
📚 Inspired by the article by Dr. Roy Murphy: Revolutionizing Elliptic Curve Cryptography
- Data Efficiency: Reduces key generation data footprint by up to 40%.
- Hensel's Lemma: Novel application for lifting ECC parameters.
- Secure: Maintains ECC security based on the discrete logarithm problem.
- Modular Design: Clean separation of Hensel lifting, ECC, and utilities.
- Comprehensive Tests: Ensures reliability and correctness.
Add HOKG to your project with:
[dependencies]
hokg = "0.1.0"Ensure you have Rust 1.80 or later installed.
use hokg::{hokg, Config};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = Config {
p: 17,
a: 2,
b: 3,
x0: 5,
y0: 6,
k: 5,
};
let (base_point, private_key, public_key, minimal_data) = hokg(config)?;
println!("Base Point: {:?}", base_point);
println!("Private Key: {}", private_key);
println!("Public Key: {:?}", public_key);
println!("Minimal Data: {:?}", minimal_data);
Ok(())
}Run the example:
cargo run --example simpleFull API documentation is available via:
cargo doc --openRun the test suite:
cargo testRun benchmarks:
cargo benchContributions are welcome! Please:
- Fork the repository.
- Create a feature branch (
git checkout -b feature/awesome-feature). - Commit your changes (
git commit -m 'Add awesome feature'). - Push to the branch (
git push origin feature/awesome-feature). - Open a Pull Request.
See CONTRIBUTING.md for details.
This project is licensed under the MIT License - see the LICENSE file.
This is a cryptographic library. For production use, ensure:
- Use standardized curves (e.g., NIST P-256).
- Validate curve order and points.
- Consult a cryptography expert.
For questions, open an issue or contact Dr. Roy Murphy.
Built with ❤️ using Rust 🦀