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 build error when "yoloproofs" enabled #23

Merged
merged 2 commits into from
Jun 19, 2024

Conversation

matthiasgeihs
Copy link

Currently, the crate doesn't build with "yoloproofs" enabled.

error[E0599]: no method named `ok_or` found for struct `CtOption` in the current scope
   --> src/r1cs/proof.rs:180:59
    |
180 |         let t_x = Scalar::from_canonical_bytes(read32!()).ok_or(R1CSError::FormatError)?;
    |                                                           ^^^^^ method not found in `CtOption<Scalar>`

Since curve25519-dalek v4, from_canonical_bytes returns CtOption.
Solution: Wrap with Option::from.

Since curve25519-dalek v4, `from_canonical_bytes` returns CtOption.
to ensure crate builds with "yoloproofs" enabled
Copy link
Collaborator

@cathieyun cathieyun left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the fix.

@cathieyun cathieyun merged commit 29c9e3c into zkcrypto:main Jun 19, 2024
2 checks passed
@matthiasgeihs matthiasgeihs deleted the fix/scalar-deserialize branch June 20, 2024 07:14
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