elliptic-curves icon indicating copy to clipboard operation
elliptic-curves copied to clipboard

`elliptic-curve`: build error due to [email protected]

Open cxw620 opened this issue 3 months ago • 1 comments

When using with hkdf, build error:

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 [email protected] --precise 0.13.0-rc.2

cxw620 avatar Nov 10 '25 07:11 cxw620

Yes, unfortunately we're doing a big rand_core v0.10 update and while the git repo is updated, we can't cut a release until we land this PR:

  • https://github.com/zkcrypto/group/pull/69

Which is in turn blocked on this PR:

  • https://github.com/rust-random/rngs/pull/71

tarcieri avatar Nov 10 '25 14:11 tarcieri