Commit Graph

9 Commits

Author SHA1 Message Date
Ryan Heywood 4faab1cd33
blahaj::math: increase allowable polynomial coefficients to maximum
The previously existing polynomial coefficients had an inverse bias
towards `0`, only starting higher than `1`. This allows `0` to be a
valid polynomial.

As per an audit performed by Cure53:

> The correct method to select a random polynomial would be to select
all coefficients (including the most significant coefficient) uniformly
in the range 0..255 (inclusive). Otherwise, knowledge that a coefficient
in a polynomial cannot be 0 permits the exclusion of single byte values
for the shared secret given one share less than required. [...]
Exploiting this weakness necessitates sharing the same secret multiple
times. In this scenario, an attacker could exclude an exponential number
of values for each of the shared bytes until sufficiently few values
remain for brute forcing.  Cure53 estimates that under ideal
circumstances (e.g., a 2-out-of-N scheme) a shared secret can be
reconstructed if the same secret has been distributed 500-1500 times.
2024-11-16 19:26:26 -05:00
Ryan Heywood f10fef2c88
blahaj::math: make clippy happy 2024-11-16 19:18:43 -05:00
Garrett T 775333fe17
Add Zeroize to Share and GF256 (#19)
* Add Zeroize crate to project behind a default feature flag

Closes https://github.com/c0dearm/sharks/issues/8

* Switch match to Clone to add zeroize(drop)

* Add zeroize(drop) to Share

Co-authored-by: Aitor Ruano <45633475+c0dearm@users.noreply.github.com>
2021-03-14 17:56:20 +01:00
Kitsu 31c8cb7650
Support no_std (#13)
* feat: support no_std

* simplify rng usage, update tests, upgrade version to 0.4

* fix workflow no-std test

* unignore doc-tests

* refactor tests

Co-authored-by: Aitor Ruano <codearm@pm.me>
2020-04-02 13:45:01 +02:00
Aitor Ruano eb05d00080 upgrade version 2020-03-23 15:16:43 +01:00
zer0x64 3489574840 Added Share Serialization and Created Share Struct (#2)
* Added share serialisation and created Share struct

Co-authored-by: Aitor Ruano <45633475+c0dearm@users.noreply.github.com>
2020-01-22 15:01:35 +01:00
Aitor Ruano 5344dda94b
changed arithmetic to GF256, unlimited secret length, updated docs (#1) 2020-01-21 10:09:20 +01:00
Aitor Ruano d6c7a6be9e Written readme, improved documentation, added changelog and copyright 2020-01-13 11:42:59 +01:00
Aitor Ruano 90c7382c17 initial commit 2020-01-10 17:08:30 +01:00