-
Notifications
You must be signed in to change notification settings - Fork 17
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
Fail on bad scalar conversions #703
Conversation
Is it OK that this panics, or should I get it to return a Result? |
We were using the unsafe code to process data provided by the user. As a result, there were no guarantees about the integrity of the data usually provided for an unsafe block of code. Now we are changing that to a |
d76363a
to
58c3790
Compare
I'll make it an option, it's actually showing some interesting parts of our codebase. Like what happens if, when deriving epsilon, the output of the hash function doesn't fall into the field? |
Previously we'd allow bad scalars to be converted too and from bytes. This should be impossible since all conversions are done internally, but it's good to check.
b9ef520
to
b7c6ef9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine for now to panic until we get error handling into the contract. At least with this while deriving epsilon, it panics at the entrypoint in the contract before making it to the MPC network. It's kinda buried where this guard is happening but we will have to surface it in a later error handing PR
Terraform Feature Environment Destroy (dev-703)Terraform Initialization ⚙️
|
Previously we'd allow bad scalars to be converted too and from bytes. This should be impossible since all conversions are done internally, but it's good to check.
Closes #702