Skip to content

Can not compile rsa with debian-based linux #633

@eribol

Description

@eribol

I am using manjaro at home and debian at work. Project compiles all fine but in debian based system, it cant compiles. Same cargo.toml, same version but still no compile.

[dependencies]
rsa = {version="0.10.0-rc.12"}
rand = "0.10.0-rc.5"
env_logger = "*"
log = { version = "0.4.8",  features = ["max_level_debug", "release_max_level_info", "std"] }

This is errors;

rror[E0277]: the trait bound `DummyRng: DerefMut` is not satisfied
  --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.12/src/dummy_rng.rs:8:18
   |
 8 | impl RngCore for DummyRng {
   |                  ^^^^^^^^ unsatisfied trait bound
   |
help: the trait `DerefMut` is not implemented for `DummyRng`
  --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.12/src/dummy_rng.rs:6:1
   |
 6 | pub(crate) struct DummyRng;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
   = help: the trait `TryRngCore` is implemented for `UnwrapErr<R>`
   = note: required for `DummyRng` to implement `TryRngCore`
note: required by a bound in `RngCore`
  --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand_core-0.10.0-rc-5/src/lib.rs:46:31
   |
46 | pub trait RngCore: TryRngCore<Error = Infallible> {
   |                               ^^^^^^^^^^^^^^^^^^ required by this bound in `RngCore`

error[E0277]: the trait bound `DummyRng: DerefMut` is not satisfied
  --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.12/src/dummy_rng.rs:22:20
   |
22 | impl CryptoRng for DummyRng {}
   |                    ^^^^^^^^ unsatisfied trait bound
   |
help: the trait `DerefMut` is not implemented for `DummyRng`
  --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.12/src/dummy_rng.rs:6:1
   |
 6 | pub(crate) struct DummyRng;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
   = help: the trait `TryRngCore` is implemented for `UnwrapErr<R>`
   = note: required for `DummyRng` to implement `TryRngCore`
note: required by a bound in `CryptoRng`
  --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand_core-0.10.0-rc-5/src/lib.rs:92:45
   |
92 | pub trait CryptoRng: RngCore + TryCryptoRng<Error = Infallible> {}
   |                                             ^^^^^^^^^^^^^^^^^^ required by this bound in `CryptoRng`

error[E0599]: no method named `ct_assign` found for type `u32` in the current scope
   --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.12/src/algorithms/oaep.rs:252:15
    |
252 |         index.ct_assign(&(i as u32), looking_for_index & equals1);
    |               ^^^^^^^^^
    |
   ::: /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ctutils-0.4.0/src/traits/ct_assign.rs:30:8
    |
 30 |     fn ct_assign(&mut self, src: &Rhs, choice: Choice);
    |        --------- the method is available for `u32` here
    |
    = help: items from traits can only be used if the trait is in scope
help: there is a method `ct_neg_assign` with a similar name, but with different arguments
   --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ctutils-0.4.0/src/traits/ct_neg.rs:16:5
    |
 16 |     fn ct_neg_assign(&mut self, choice: Choice) {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: trait `CtAssign` which provides `ct_assign` is implemented but not in scope; perhaps you want to import it
    |
  3 + use crypto_bigint::CtAssign;
    |

error[E0599]: no method named `ct_assign` found for type `u32` in the current scope
   --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.12/src/algorithms/pkcs1v15.rs:102:15
    |
102 |         index.ct_assign(&(i as u32), looking_for_index & equals0);
    |               ^^^^^^^^^
    |
   ::: /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ctutils-0.4.0/src/traits/ct_assign.rs:30:8
    |
 30 |     fn ct_assign(&mut self, src: &Rhs, choice: Choice);
    |        --------- the method is available for `u32` here
    |
    = help: items from traits can only be used if the trait is in scope
help: there is a method `ct_neg_assign` with a similar name, but with different arguments
   --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ctutils-0.4.0/src/traits/ct_neg.rs:16:5
    |
 16 |     fn ct_neg_assign(&mut self, choice: Choice) {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: trait `CtAssign` which provides `ct_assign` is implemented but not in scope; perhaps you want to import it
    |
  9 + use crypto_bigint::CtAssign;
    |

error[E0277]: the trait bound `DummyRng: TryCryptoRng` is not satisfied
   --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.12/src/oaep/decrypting_key.rs:63:26
    |
 63 |         decrypt_digest::<DummyRng, D, MGD>(None, &self.inner, ciphertext, self.label.clone())
    |                          ^^^^^^^^ unsatisfied trait bound
    |
help: the trait `DerefMut` is not implemented for `DummyRng`
   --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.12/src/dummy_rng.rs:6:1
    |
  6 | pub(crate) struct DummyRng;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: the trait `TryCryptoRng` is implemented for `UnwrapErr<R>`
    = note: required for `DummyRng` to implement `TryCryptoRng`
note: required by a bound in `decrypt_digest`
   --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.12/src/oaep.rs:305:8
    |
298 | fn decrypt_digest<R, D, MGD>(
    |    -------------- required by a bound in this function
...
305 |     R: TryCryptoRng + ?Sized,
    |        ^^^^^^^^^^^^ required by this bound in `decrypt_digest`

error[E0277]: the trait bound `DummyRng: TryCryptoRng` is not satisfied
   --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.12/src/pkcs1v15/decrypting_key.rs:31:19
    |
 31 |         decrypt::<DummyRng>(None, &self.inner, ciphertext)
    |                   ^^^^^^^^ unsatisfied trait bound
    |
help: the trait `DerefMut` is not implemented for `DummyRng`
   --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.12/src/dummy_rng.rs:6:1
    |
  6 | pub(crate) struct DummyRng;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: the trait `TryCryptoRng` is implemented for `UnwrapErr<R>`
    = note: required for `DummyRng` to implement `TryCryptoRng`
note: required by a bound in `pkcs1v15::decrypt`
   --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.12/src/pkcs1v15.rs:152:15
    |
152 | fn decrypt<R: TryCryptoRng + ?Sized>(
    |               ^^^^^^^^^^^^ required by this bound in `decrypt`

error[E0277]: the trait bound `DummyRng: TryCryptoRng` is not satisfied
   --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.12/src/pkcs1v15/signing_key.rs:106:16
    |
106 |         sign::<DummyRng>(None, &self.inner, &self.prefix, &digest.finalize_fixed())?
    |                ^^^^^^^^ unsatisfied trait bound
    |
help: the trait `DerefMut` is not implemented for `DummyRng`
   --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.12/src/dummy_rng.rs:6:1
    |
  6 | pub(crate) struct DummyRng;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: the trait `TryCryptoRng` is implemented for `UnwrapErr<R>`
    = note: required for `DummyRng` to implement `TryCryptoRng`
note: required by a bound in `pkcs1v15::sign`
   --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.12/src/pkcs1v15.rs:180:12
    |
180 | fn sign<R: TryCryptoRng + ?Sized>(
    |            ^^^^^^^^^^^^ required by this bound in `sign`

error[E0277]: the trait bound `DummyRng: TryCryptoRng` is not satisfied
   --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.12/src/pkcs1v15/signing_key.rs:117:16
    |
117 |         sign::<DummyRng>(None, &self.inner, &self.prefix, prehash)?
    |                ^^^^^^^^ unsatisfied trait bound
    |
help: the trait `DerefMut` is not implemented for `DummyRng`
   --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.12/src/dummy_rng.rs:6:1
    |
  6 | pub(crate) struct DummyRng;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: the trait `TryCryptoRng` is implemented for `UnwrapErr<R>`
    = note: required for `DummyRng` to implement `TryCryptoRng`
note: required by a bound in `pkcs1v15::sign`
   --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.12/src/pkcs1v15.rs:180:12
    |
180 | fn sign<R: TryCryptoRng + ?Sized>(
    |            ^^^^^^^^^^^^ required by this bound in `sign`

error[E0277]: the trait bound `DummyRng: TryCryptoRng` is not satisfied
   --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.12/src/pkcs1v15/signing_key.rs:194:16
    |
194 |         sign::<DummyRng>(None, &self.inner, &self.prefix, &digest.finalize())?
    |                ^^^^^^^^ unsatisfied trait bound
    |
help: the trait `DerefMut` is not implemented for `DummyRng`
   --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.12/src/dummy_rng.rs:6:1
    |
  6 | pub(crate) struct DummyRng;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: the trait `TryCryptoRng` is implemented for `UnwrapErr<R>`
    = note: required for `DummyRng` to implement `TryCryptoRng`
note: required by a bound in `pkcs1v15::sign`
   --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.12/src/pkcs1v15.rs:180:12
    |
180 | fn sign<R: TryCryptoRng + ?Sized>(
    |            ^^^^^^^^^^^^ required by this bound in `sign`

error[E0277]: the trait bound `DummyRng: TryCryptoRng` is not satisfied
   --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.12/src/key.rs:600:25
    |
600 |         padding.decrypt(Option::<&mut DummyRng>::None, self, ciphertext)
    |                 ------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
    |                 |
    |                 required by a bound introduced by this call
    |
help: the trait `DerefMut` is not implemented for `DummyRng`
   --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.12/src/dummy_rng.rs:6:1
    |
  6 | pub(crate) struct DummyRng;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: the trait `TryCryptoRng` is implemented for `UnwrapErr<R>`
    = note: required for `DummyRng` to implement `TryCryptoRng`
note: required by a bound in `PaddingScheme::decrypt`
   --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.12/src/traits/padding.rs:16:21
    |
 16 |     fn decrypt<Rng: TryCryptoRng + ?Sized>(
    |                     ^^^^^^^^^^^^ required by this bound in `PaddingScheme::decrypt`

error[E0277]: the trait bound `DummyRng: TryCryptoRng` is not satisfied
   --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.12/src/key.rs:617:22
    |
617 |         padding.sign(Option::<&mut DummyRng>::None, self, digest_in)
    |                 ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
    |                 |
    |                 required by a bound introduced by this call
    |
help: the trait `DerefMut` is not implemented for `DummyRng`
   --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.12/src/dummy_rng.rs:6:1
    |
  6 | pub(crate) struct DummyRng;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: the trait `TryCryptoRng` is implemented for `UnwrapErr<R>`
    = note: required for `DummyRng` to implement `TryCryptoRng`
note: required by a bound in `SignatureScheme::sign`
   --> /home/ogrenci/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.12/src/traits/padding.rs:35:18
    |
 35 |     fn sign<Rng: TryCryptoRng + ?Sized>(
    |                  ^^^^^^^^^^^^ required by this bound in `SignatureScheme::sign`

Some errors have detailed explanations: E0277, E0599.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `rsa` (lib) due to 11 previous errors
warning: build failed, waiting for other jobs to finish...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions