You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Point equality is not being done correctly. b's y component is being compared to itself here
To Reproduce
rustup update nightly
rustup override set nightly
Run the test above (p1's y component is different than p2's y component and the proving fails.
#[test]fnfailing_test(){let rng = &mutStdRng::seed_from_u64(8349u64);let n = 1 << 12;let label = b"demo";let pp = PublicParameters::setup(n, rng).expect("failed to create pp");pubstructDummyCircuit{p1:JubJubExtended,p2:JubJubExtended,}implDefaultforDummyCircuit{fndefault() -> Self{Self{p1:JubJubExtended::from_raw_unchecked(BlsScalar::zero(),BlsScalar::one(),BlsScalar::one(),BlsScalar::zero(),BlsScalar::zero(),),p2:JubJubExtended::from_raw_unchecked(BlsScalar::zero(),BlsScalar::zero(),BlsScalar::one(),BlsScalar::zero(),BlsScalar::zero(),),}}}implCircuitforDummyCircuit{fncircuit<C>(&self,composer:&mutC) -> Result<(),Error>whereC:Composer,{let w_x = composer.append_point(self.p1);let w_y = composer.append_point(self.p2);
composer.assert_equal_point(w_x, w_y);Ok(())}}let(prover, _verifier) = Compiler::compile::<DummyCircuit>(&pp, label).expect("failed to compile circuit");let proving_result = prover
.prove(rng,&Default::default());assert!(proving_result.is_err(), "proving should fail because the points are not equal");}
Expected behavior
Proving should fail because the points that are being compared are not equal.
Logs/Screenshot
thread 'failing_test' panicked at 'proving should fail because the points are not equal', tests/composer.rs:167:5
stack backtrace:
0: rust_begin_unwind
at /rustc/4781233a77e879e49cb5ce3c98d2abba6a6ade7a/library/std/src/panicking.rs:575:5
1: core::panicking::panic_fmt
at /rustc/4781233a77e879e49cb5ce3c98d2abba6a6ade7a/library/core/src/panicking.rs:64:14
2: composer::failing_test
at ./tests/composer.rs:167:5
3: composer::failing_test::{{closure}}
at ./tests/composer.rs:116:19
4: core::ops::function::FnOnce::call_once
at /rustc/4781233a77e879e49cb5ce3c98d2abba6a6ade7a/library/core/src/ops/function.rs:250:5
5: core::ops::function::FnOnce::call_once
at /rustc/4781233a77e879e49cb5ce3c98d2abba6a6ade7a/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full`for a verbose backtrace.
test failing_test ... FAILED
failures:
failures:
failing_test
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 1 filtered out; finished in 16.31s
Platform
Fill as appropriate
Architecture:ARM
OS: macOS
Browser: firefox
Additional context
The text was updated successfully, but these errors were encountered:
Describe the bug
Point equality is not being done correctly.
b
'sy
component is being compared to itself hereTo Reproduce
rustup update nightly
rustup override set nightly
p1
'sy
component is different thanp2
'sy
component and the proving fails.Expected behavior
Proving should fail because the points that are being compared are not equal.
Logs/Screenshot
Platform
Fill as appropriate
Additional context
The text was updated successfully, but these errors were encountered: