Skip to content

Commit

Permalink
Merge pull request #23 from matthiasgeihs/fix/scalar-deserialize
Browse files Browse the repository at this point in the history
Fix build error when "yoloproofs" enabled
  • Loading branch information
cathieyun authored Jun 19, 2024
2 parents 86eadbe + 5550ff0 commit 29c9e3c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/check-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:
- name: Cargo fmt
run: cargo fmt --all -- --check
- name: Run tests
run: cargo test --verbose
run: cargo test --features="yoloproofs" --verbose
- name: Build benchmarks
run: cargo bench --verbose DONTRUNBENCHMARKS
run: cargo bench --features="yoloproofs" --verbose DONTRUNBENCHMARKS

check-nightly:

Expand All @@ -38,6 +38,6 @@ jobs:
toolchain: nightly
override: true
- name: Run tests
run: cargo test --features="std,nightly" --verbose
run: cargo test --features="std,nightly,yoloproofs" --verbose
- name: Build benchmarks
run: cargo bench --features="std,nightly" --verbose DONTRUNBENCHMARKS
run: cargo bench --features="std,nightly,yoloproofs" --verbose DONTRUNBENCHMARKS
9 changes: 6 additions & 3 deletions src/r1cs/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,12 @@ impl R1CSProof {
let T_4 = CompressedRistretto(read32!());
let T_5 = CompressedRistretto(read32!());
let T_6 = CompressedRistretto(read32!());
let t_x = Scalar::from_canonical_bytes(read32!()).ok_or(R1CSError::FormatError)?;
let t_x_blinding = Scalar::from_canonical_bytes(read32!()).ok_or(R1CSError::FormatError)?;
let e_blinding = Scalar::from_canonical_bytes(read32!()).ok_or(R1CSError::FormatError)?;
let t_x =
Option::from(Scalar::from_canonical_bytes(read32!())).ok_or(R1CSError::FormatError)?;
let t_x_blinding =
Option::from(Scalar::from_canonical_bytes(read32!())).ok_or(R1CSError::FormatError)?;
let e_blinding =
Option::from(Scalar::from_canonical_bytes(read32!())).ok_or(R1CSError::FormatError)?;

// XXX: IPPProof from_bytes gives ProofError.
let ipp_proof = InnerProductProof::from_bytes(slice).map_err(|_| R1CSError::FormatError)?;
Expand Down

0 comments on commit 29c9e3c

Please sign in to comment.