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

n_choose_k example throws MalformedVerifyingKey at proof generation #336

Closed
zillerium opened this issue Apr 28, 2019 · 2 comments
Closed

Comments

@zillerium
Copy link

I have the error below. Any idea what could be the cause? I am trying to implement a simple Zokrates program. The preceding steps all run, and I compiled ok, computed the witness, exported the verifier and generated a proof.

def fac(field x)->(field):
    field f = 1
    field counter = 0
    for field i in 1..100 do
        f = if counter == x then f else f * i fi
        counter = if counter == x then counter else counter + 1 fi
    endfor
    return f
    
    def main(field n, field k)->(field):
       return fac(n)/(fac(k)*fac(n-k))
 
trevor@ecc-server:~/.zokrates$ zokrates generate-proof
Generating proof...
WARNING: You are using the G16 scheme which is subject to malleability. See zokrates.github.io/reference/proving_schemes.html#g16-malleability for implications.
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: MalformedVerifyingKey', src/libcore/result.rs:999:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:59
             at src/libstd/panicking.rs:197
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:211
   4: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:474
   5: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:381
   6: rust_begin_unwind
             at src/libstd/panicking.rs:308
   7: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
   8: core::result::unwrap_failed
   9: zokrates_core::proof_system::bn128::utils::bellman::Computation::prove
  10: ::generate_proof
  11: zokrates::cli
  12: zokrates::main
  13: std::rt::lang_start::{{closure}}
  14: std::panicking::try::do_call
             at src/libstd/rt.rs:49
             at src/libstd/panicking.rs:293
  15: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:85
  16: std::rt::lang_start_internal
             at src/libstd/panicking.rs:272
             at src/libstd/panic.rs:388
             at src/libstd/rt.rs:48
  17: main
  18: __libc_start_main
  19: 


@Schaeff
Copy link
Member

Schaeff commented May 6, 2019

Thanks for filing this, looking into it

@Schaeff Schaeff changed the title thread 'main' panicked at 'called Result::unwrap() on an Err value: MalformedVerifyingKey', src/libcore/result.rs:999:5 n_choose_k example throws MalformedVerifyingKey at proof generation May 6, 2019
@Schaeff
Copy link
Member

Schaeff commented May 7, 2019

Should have been fixed by #342, if you're able to try on the develop branch now and let me know @zillerium that would be awesome.

This was referenced May 7, 2019
@Schaeff Schaeff closed this as completed May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants