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 Shamir's implementation #210

Merged
merged 1 commit into from
Mar 18, 2024

Conversation

cipherboy
Copy link
Member

This adds several improvements to Shamir's implementation:

  1. Use a CS-PRNG with a shuffling algorithm to permute X coordinates in the range [1, 254], removing the need for a later +1 addition later.
  2. Panic in the (unreachable) event that the polynomial is evaluated at x == 0; this was already unreachable (and further explicit improvements to shuffling have ensured it remains so), and as it is in a private library function, panicing is an acceptable approach rather than returning an error.
  3. Annotate the inverse function to describe multiplications for maintainability.

Resolves: #182

Co-authored-by: @wavefnx

This adds several improvements to Shamir's implementation:

 1. Use a CS-PRNG with a shuffling algorithm to permute X coordinates in
    the range [1, 254], removing the need for a later +1 addition later.
 2. Panic in the (unreachable) event that the polynomial is evaluated at
    x == 0; this was already unreachable (and further explicit
    improvements to shuffling have ensured it remains so), and as it is
    in a private library function, panicing is an acceptable approach
    rather than returning an error.
 3. Annotate the inverse function to describe multiplications for
    maintainability.

Resolves: openbao#182

Co-authored-by: @wavefnx
Signed-off-by: Alexander Scheel <alexander.m.scheel@gmail.com>
@naphelps naphelps merged commit a209a05 into openbao:main Mar 18, 2024
71 of 79 checks passed
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.

Improvements on the current shamir implementation
2 participants