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

Errors trying to compile sample ZKP code sig_and_vrf_example.rs #25

Open
rgutierrez2004 opened this issue Feb 19, 2021 · 0 comments
Open

Comments

@rgutierrez2004
Copy link

I'm getting the following errors when trying to compile code sig_and_vrf_example.rs.
Rust version: 1.47.0

ERROR 1
error[E0308]: mismatched types
--> src/main.rs:91:20
|
91 | x: &self.sk.0,
| ^^^^^^^^^^ expected struct zkp::curve25519_dalek_ng::scalar::Scalar, found struct curve25519_dalek::scalar::Scalar
|
= note: expected reference &zkp::curve25519_dalek_ng::scalar::Scalar
found reference &curve25519_dalek::scalar::Scalar

Cargo.tml
...
[dependencies]
zkp = "0.8.0"
rand = "0.7"
curve25519-dalek = { version = "2", default-features = false, features = ["serde", "std"] }

[features]
default = ["u64_backend"]
u32_backend = ["curve25519-dalek/u32_backend"]
u64_backend = ["curve25519-dalek/u64_backend"]
simd_backend = ["curve25519-dalek/simd_backend"]

ERROR 2
Also, if trying using the latest version of rand and curve25519, get a different error:
error[E0277]: the trait bound R: zkp::rand::RngCore is not satisfied
--> src/main.rs:49:34
|
49 | SecretKey(Scalar::random(rng))
| ^^^ the trait zkp::rand::RngCore is not implemented for R
|
::: /home/oracle/.cargo/registry/src/github.com-1ecc6299db9ec823/curve25519-dalek-3.0.2/src/scalar.rs:558:22
|
558 | pub fn random<R: RngCore + CryptoRng>(rng: &mut R) -> Self {
| ------- required by this bound in curve25519_dalek::scalar::Scalar::random
|
help: consider further restricting this bound
|
48 | fn new<R: RngCore + CryptoRng + zkp::rand::RngCore>(rng: &mut R) -> SecretKey {
| ^^^^^^^^^^^^^^^^^^^^

Cargo.toml
...
[dependencies]
zkp = "0.8.0"
rand = "0.8.3"
curve25519-dalek = "3.0.2"

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

No branches or pull requests

1 participant