Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to validation and errors #54

Merged
merged 8 commits into from
Mar 28, 2018

Conversation

psivesely
Copy link
Contributor

Some changes and improvements to the validation process and error messaging. The commits are pretty granular changes, and if it isn't really obvious why a certain change was made, the corresponding commit message should have a detailed justification for said change.

Since id is a `u8` it will never be greater than 255.
@psivesely
Copy link
Contributor Author

Okay, I was not testing with --all-features, which is why Travis failed.

It's possible that two different points have the same data.

To give a concrete example consider the secret polynomial `x^2 + x + s`, where
`s` is the secret byte. Plugging in 214 and 215 (both elements of the cyclic
subgroup of order 2) for `x` will give the same result, `1 + s`.

More broadly, for any polynomial `b*x^t + b*x^(t-1) + ... + x + s`, where `t` is
the order of at least one subgroup of GF(256), for all subgroups of order `t`,
all elements of that subgroup, when chosen for `x`, will produce the same
result.

There are certainly other types of polynomials that have "share collisions."
This type was just easy to find because it exploits the nature of finite fields.
Ensures that threshold > 2 during the parsing process, since we ensure the same
during the splitting process.
Since the validation already confirms `shares` is not empty, `k_sets` will never
match 0.
The arguments were provided in the wrong order.
@psivesely
Copy link
Contributor Author

Rebased/ squashed fix into relevant commit. Travis should pass now.

@romac
Copy link
Member

romac commented Mar 28, 2018

Very nice, thanks!

@romac romac merged commit fefd5ab into SpinResearch:master Mar 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants