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

Error while building #33

Open
ehanoc opened this issue Feb 15, 2025 · 0 comments
Open

Error while building #33

ehanoc opened this issue Feb 15, 2025 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@ehanoc
Copy link

ehanoc commented Feb 15, 2025

From a fresh clone of the repo; while running cargo build i'm getting:

....


error[E0277]: the trait bound `R: ark_std::rand::Rng` is not satisfied
  --> src/secret_sharing/shamir.rs:54:26
   |
54 |         .map(|_| F::rand(rng))
   |                  ------- ^^^ the trait `ark_std::rand::RngCore` is not implemented for `R`
   |                  |
   |                  required by a bound introduced by this call
   |
   = note: required for `R` to implement `ark_std::rand::Rng`
note: required by a bound in `ark_std::UniformRand::rand`
  --> /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ark-std-0.5.0/src/rand_helper.rs:12:16
   |
12 |     fn rand<R: Rng + ?Sized>(rng: &mut R) -> Self;
   |                ^^^ required by this bound in `UniformRand::rand`
help: consider further restricting this bound
   |
39 | pub fn share<R: Rng + ark_std::rand::RngCore>(
   |                     ++++++++++++++++++++++++

error[E0277]: the trait bound `R: ark_std::rand::Rng` is not satisfied
  --> src/secret_sharing/shamir.rs:78:33
   |
78 |                 let x = F::rand(rng);
   |                         ------- ^^^ the trait `ark_std::rand::RngCore` is not implemented for `R`
   |                         |
   |                         required by a bound introduced by this call
   |
   = note: required for `R` to implement `ark_std::rand::Rng`
note: required by a bound in `ark_std::UniformRand::rand`
  --> /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ark-std-0.5.0/src/rand_helper.rs:12:16
   |
12 |     fn rand<R: Rng + ?Sized>(rng: &mut R) -> Self;
   |                ^^^ required by this bound in `UniformRand::rand`
help: consider further restricting this bound
   |
39 | pub fn share<R: Rng + ark_std::rand::RngCore>(
   |                     ++++++++++++++++++++++++

error[E0277]: the trait bound `rand_chacha::rand_core::OsRng: ark_std::rand::Rng` is not satisfied
   --> src/secure_channel/sign.rs:34:32
    |
34  |     let sk = SecretKey::random(&mut OsRng);
    |              ----------------- ^^^^^^^^^^ the trait `ark_std::rand::RngCore` is not implemented for `rand_chacha::rand_core::OsRng`
    |              |
    |              required by a bound introduced by this call
    |
note: there are multiple different versions of crate `rand_core` in the dependency graph
   --> /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rand_core-0.6.4/src/lib.rs:142:1
    |
142 | pub trait RngCore {
    | ^^^^^^^^^^^^^^^^^ this is the required trait
    |
   ::: src/secret_sharing/shamir.rs:21:5
    |
21  | use ark_poly::{Polynomial, univariate::DensePolynomial};
    |     -------- one version of crate `rand_core` is used here, as a dependency of crate `rand`
    |
   ::: src/secret_sharing/vss.rs:23:5
    |
23  | use rand_chacha::rand_core::SeedableRng;
    |     ----------- one version of crate `rand_core` is used here, as a dependency of crate `rand_chacha`
    |
   ::: /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rand_core-0.9.0/src/os.rs:47:1
    |
47  | pub struct OsRng;
    | ---------------- this type doesn't implement the required trait
    |
   ::: /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rand_core-0.6.4/src/os.rs:48:1
    |
48  | pub struct OsRng;
    | ---------------- this type implements the required trait
    |
   ::: /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rand_core-0.9.0/src/block.rs:67:1
    |
67  | pub trait BlockRngCore {
    | ---------------------- this is the found trait
    = note: two types coming from two different versions of the same crate are different types even if they look the same
    = help: you can use `cargo tree` to explore your dependency tree
    = note: required for `rand_chacha::rand_core::OsRng` to implement `ark_std::rand::Rng`
note: required by a bound in `SecretKey::random`
   --> /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libsecp256k1-0.7.1/src/lib.rs:430:22
    |
430 |     pub fn random<R: Rng>(rng: &mut R) -> SecretKey {
    |                      ^^^ required by this bound in `SecretKey::random`

error[E0277]: the trait bound `rand_chacha::rand_core::OsRng: ark_std::rand::Rng` is not satisfied
   --> src/secure_channel/encrypt.rs:24:32
    |
24  |     let sk = SecretKey::random(&mut OsRng);
    |              ----------------- ^^^^^^^^^^ the trait `ark_std::rand::RngCore` is not implemented for `rand_chacha::rand_core::OsRng`
    |              |
    |              required by a bound introduced by this call
    |
note: there are multiple different versions of crate `rand_core` in the dependency graph
   --> /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rand_core-0.6.4/src/lib.rs:142:1
    |
142 | pub trait RngCore {
    | ^^^^^^^^^^^^^^^^^ this is the required trait
    |
   ::: src/secret_sharing/shamir.rs:21:5
    |
21  | use ark_poly::{Polynomial, univariate::DensePolynomial};
    |     -------- one version of crate `rand_core` is used here, as a dependency of crate `rand`
    |
   ::: src/secret_sharing/vss.rs:23:5
    |
23  | use rand_chacha::rand_core::SeedableRng;
    |     ----------- one version of crate `rand_core` is used here, as a dependency of crate `rand_chacha`
    |
   ::: /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rand_core-0.9.0/src/os.rs:47:1
    |
47  | pub struct OsRng;
    | ---------------- this type doesn't implement the required trait
    |
   ::: /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rand_core-0.6.4/src/os.rs:48:1
    |
48  | pub struct OsRng;
    | ---------------- this type implements the required trait
    |
   ::: /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rand_core-0.9.0/src/block.rs:67:1
    |
67  | pub trait BlockRngCore {
    | ---------------------- this is the found trait
    = note: two types coming from two different versions of the same crate are different types even if they look the same
    = help: you can use `cargo tree` to explore your dependency tree
    = note: required for `rand_chacha::rand_core::OsRng` to implement `ark_std::rand::Rng`
note: required by a bound in `SecretKey::random`
   --> /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libsecp256k1-0.7.1/src/lib.rs:430:22
    |
430 |     pub fn random<R: Rng>(rng: &mut R) -> SecretKey {
    |                      ^^^ required by this bound in `SecretKey::random`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `derec-crypto` (lib) due to 4 previous errors
warning: build failed, waiting for other jobs to finish...
➜  cryptography git:(main) git status
On branch main
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean

System:

  • Debian 12
@ehanoc ehanoc added bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed labels Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant