-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Regardless of threshold, all polynomials are lines due to small syntactic error #43
Comments
Fixes SpinResearch#43. Fixes a syntactic error. Threshold should determine the number of coefficients in the secret polynomial. As is the code is equivalent to threshold always being 2.
Regardless of threshold, all polynomials are lines due to small syntactic error
Hi Noah, Thank you so much for reporting this, that's a big one. Fortunately, this bug seem to follow from a refactoring I did while working on the deterministic secret sharing scheme, and is thus not present in RustySecrets v0.0.2. As such, Sunder is thankfully not affected, given that the npm package it depends on actually uses that very same version of the library. I will merge this as soon as I have time to write a good test to ensure we never make the same mistake in the future. Thank you so much again for taking the time to go through the code and report this security issue. The DSS code is going to go under audit soon and we'll work towards improving the code coverage in tests. In the meantime, I want to stress that the code published under v0.0.2 has been audited already and does not suffer from this very issue. Thanks again! |
Regardless of threshold, all polynomials are lines due to small syntactic error
Regardless of threshold, all polynomials are lines due to small syntactic error
Fixes #43. Fixes a syntactic error. Threshold should determine the number of coefficients in the secret polynomial. As is the code is equivalent to threshold always being 2.
@nvesely Your patch has been merged. I added a test in #44 to make sure we never encounter this very same issue in the future. Thank you again for noticing this bug, reporting it, and fixing it :) |
In the the
SSS::secret_share
function, the author clearly intended to makecol_in
an array ofthreshold
bytes, but put a comma where the semi-colon should go in thevec!
macro. Thus the code always generates just a single coefficient instead ofthreshold - 1
coefficients for our secret polynomial. So regardless of how high thethreshold
is set two shares are enough to uncover the secret.This did not cause an error in the secret recovery code because of the fundamental uniqueness of the Lagrange polynomial: regardless of the number of nodes (shares) presented in excess of
k + 1
for ak
degree polynomial, Langrange interpolation finds the unique polynomial of degreek
.Here is an illustration of the problem:
The text was updated successfully, but these errors were encountered: