Skip to content

elliptic-curve: build error due to hmac@0.13.0-rc.3 #1523

@cxw620

Description

@cxw620

When using with hkdf, build error:

Details
error[E0107]: type alias takes 1 generic argument but 2 generic arguments were supplied
   --> /home/hantong/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/elliptic-curve-0.14.0-rc.16/src/ecdh.rs:210:54
    |
210 |     pub fn extract<D>(&self, salt: Option<&[u8]>) -> Hkdf<D, SimpleHmac<D>>
    |                                                      ^^^^  --------------- help: remove the unnecessary generic argument
    |                                                      |
    |                                                      expected 1 generic argument
    |
note: type alias defined here, with 1 generic parameter: `H`
   --> /home/hantong/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hkdf-0.13.0-rc.3/src/lib.rs:26:10
    |
 26 | pub type Hkdf<H> = GenericHkdf<Hmac<H>>;
    |          ^^^^ -

error[E0277]: the trait bound `D: CoreProxy` is not satisfied
   --> /home/hantong/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/elliptic-curve-0.14.0-rc.16/src/ecdh.rs:210:54
    |
210 |     pub fn extract<D>(&self, salt: Option<&[u8]>) -> Hkdf<D, SimpleHmac<D>>
    |                                                      ^^^^^^^^^^^^^^^^^^^^^^ the trait `CoreProxy` is not implemented for `D`
    |
    = note: required for `D` to implement `EagerHash`
note: required by a bound in `Hmac`
   --> /home/hantong/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hmac-0.13.0-rc.3/src/lib.rs:38:24
    |
 38 |     pub struct Hmac<D: EagerHash>(block_api::HmacCore<D>);
    |                        ^^^^^^^^^ required by this bound in `Hmac`
help: consider further restricting type parameter `D` with trait `CoreProxy`
    |
212 |         D: BlockSizeUser + Clone + Digest + digest::block_api::CoreProxy,
    |                                           ++++++++++++++++++++++++++++++

error[E0277]: the trait bound `D: CoreProxy` is not satisfied
   --> /home/hantong/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/elliptic-curve-0.14.0-rc.16/src/ecdh.rs:214:9
    |
214 |         Hkdf::new(salt, &self.secret_bytes)
    |         ^^^^ the trait `CoreProxy` is not implemented for `D`
    |
    = note: required for `D` to implement `EagerHash`
note: required by a bound in `Hmac`
   --> /home/hantong/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hmac-0.13.0-rc.3/src/lib.rs:38:24
    |
 38 |     pub struct Hmac<D: EagerHash>(block_api::HmacCore<D>);
    |                        ^^^^^^^^^ required by this bound in `Hmac`
help: consider further restricting type parameter `D` with trait `CoreProxy`
    |
212 |         D: BlockSizeUser + Clone + Digest + digest::block_api::CoreProxy,
    |                                           ++++++++++++++++++++++++++++++

Some errors have detailed explanations: E0107, E0277.
For more information about an error, try `rustc --explain E0107`.
error: could not compile `elliptic-curve` (lib) due to 3 previous errors

A temporal solution:


cargo update -p hmac@0.13.0-rc.3 --precise 0.13.0-rc.2

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