Crates.io | blahaj |
lib.rs | blahaj |
version | 0.6.0 |
source | src |
created_at | 2024-11-14 16:37:51.482156 |
updated_at | 2024-11-17 00:51:18.868868 |
description | Fast, small, and secure Shamir's Secret Sharing |
homepage | https://git.distrust.co/public/blahaj |
repository | https://git.distrust.co/public/blahaj |
max_upload_size | |
id | 1448013 |
size | 38,151 |
Fast, small and secure Shamir's Secret Sharing library crate
Documentation:
Add this to your Cargo.toml
:
[dependencies]
blahaj = "0.6"
If your environment doesn't support std
:
[dependencies]
blahaj = { version = "0.6", default-features = false }
To get started using Blahaj, see the Rust docs
The API is simple and to the point, with minimal configuration.
The code is as idiomatic and clean as possible, with minimum external dependencies.
The implementation forbids the user to choose parameters that would result in an insecure application, like generating more shares than what's allowed by the finite field length.
Because the Galois finite field it uses is GF256, only up to 255 shares can be generated for a given secret. A larger number would be insecure as shares would start duplicating. Nevertheless, the secret can be arbitrarily long as computations are performed on single byte chunks.
This crate contains both unit and benchmark tests (as well as the examples included in the docs).
You can run them with cargo test
and cargo bench
.
CPU | obtain_shares_dealer | step_shares_dealer | recover_secret | share_from_bytes | share_to_bytes |
---|---|---|---|---|---|
Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz | [1.4321 us 1.4339 us 1.4357 us] | [1.3385 ns 1.3456 ns 1.3552 ns] | [228.77 us 232.17 us 236.23 us] | [24.688 ns 25.083 ns 25.551 ns] | [22.832 ns 22.910 ns 22.995 ns] |
Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz | [1.3439 us 1.3499 us 1.3562 us] | [1.5416 ns 1.5446 ns 1.5481 ns] | [197.46 us 198.37 us 199.22 us] | [20.455 ns 20.486 ns 20.518 ns] | [18.726 ns 18.850 ns 18.993 ns] |
Apple M1 ARM (Macbook Air) | [3.3367 us 3.3629 us 3.4058 us] | [741.75 ps 742.65 ps 743.52 ps] | [210.14 us 210.23 us 210.34 us] | [27.567 ns 27.602 ns 27.650 ns] | [26.716 ns 26.735 ns 26.755 ns] |
If you find a vulnerability, bug or would like a new feature, reach out to mailto:team@distrust.co.
Blahaj is distributed under the terms of the MIT license.
See LICENSE-MIT and COPYRIGHT for details.