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

fix: prevent underflow when generating Party::f #55

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hstove
Copy link

@hstove hstove commented Feb 23, 2024

When threshold is 0, an underflow runtime error is thrown. This is caused by VSS::random_poly(threshold - 1). I've changed this code to instead use 0 as the n argument if threshold is zero.

@hstove hstove requested a review from xoloki February 23, 2024 21:30
Copy link
Collaborator

@xoloki xoloki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes more sense to simply panic with a threshold of 0.

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.

2 participants