Skip to content

rc.4 crypto-bigint compat regression: NonZero missing for invert_mod #567

@pinkforest

Description

@pinkforest

Just checked from rustls-rustcrypto downstream trying to use rc.4:

$ cargo tree -i -p [email protected]

crypto-bigint v0.7.0-rc.1
├── crypto-primes v0.7.0-pre.1
│   └── rsa v0.10.0-rc.4
│       └── rustls-rustcrypto v0.0.2-alpha (/home/foobar/code2/fork/rustls-rustcrypto)
└── rsa v0.10.0-rc.4 (*)
error[E0308]: mismatched types
   --> /home/foobar/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.4/src/algorithms/rsa.rs:351:26
    |
351 |     match exp.invert_mod(&totient).into_option() {
    |               ---------- ^^^^^^^^ expected `&NonZero<BoxedUint>`, found `&BoxedUint`
    |               |
    |               arguments to this method are incorrect
    |
    = note: expected reference `&crypto_bigint::NonZero<BoxedUint>`
               found reference `&BoxedUint`
note: method defined here
   --> /home/foobar/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/crypto-bigint-0.7.0-rc.1/src/uint/boxed/invert_mod.rs:138:12
    |
138 |     pub fn invert_mod(&self, modulus: &NonZero<Self>) -> CtOption<Self> {
    |            ^^^^^^^^^^

error[E0308]: mismatched types
   --> /home/foobar/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.4/src/algorithms/rsa.rs:379:37
    |
379 |     if let Some(d) = exp.invert_mod(&lcm).into() {
    |                          ---------- ^^^^ expected `&NonZero<BoxedUint>`, found `&BoxedUint`
    |                          |
    |                          arguments to this method are incorrect
    |
    = note: expected reference `&crypto_bigint::NonZero<BoxedUint>`
               found reference `&BoxedUint`
note: method defined here
   --> /home/foobar/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/crypto-bigint-0.7.0-rc.1/src/uint/boxed/invert_mod.rs:138:12
    |
138 |     pub fn invert_mod(&self, modulus: &NonZero<Self>) -> CtOption<Self> {
    |            ^^^^^^^^^^

   Compiling ed25519-dalek v2.1.1
error[E0308]: mismatched types
   --> /home/foobar/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rsa-0.10.0-rc.4/src/key.rs:507:35
    |
507 |         Option::from(q.invert_mod(p))
    |                        ---------- ^ expected `&NonZero<BoxedUint>`, found `&BoxedUint`
    |                        |
    |                        arguments to this method are incorrect
    |
    = note: expected reference `&crypto_bigint::NonZero<BoxedUint>`
               found reference `&BoxedUint`
note: method defined here
   --> /home/foobar/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/crypto-bigint-0.7.0-rc.1/src/uint/boxed/invert_mod.rs:138:12
    |
138 |     pub fn invert_mod(&self, modulus: &NonZero<Self>) -> CtOption<Self> {
    |            ^^^^^^^^^^

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions