Skip to content

elliptic-curve: apply digest API breaking changes#1859

Closed
baloo wants to merge 1 commit into
RustCrypto:masterfrom
baloo:baloo/elliptic-curve/digest-breaking-changes
Closed

elliptic-curve: apply digest API breaking changes#1859
baloo wants to merge 1 commit into
RustCrypto:masterfrom
baloo:baloo/elliptic-curve/digest-breaking-changes

Conversation

@baloo
Copy link
Copy Markdown
Member

@baloo baloo commented May 27, 2025

No description provided.

@baloo
Copy link
Copy Markdown
Member Author

baloo commented May 27, 2025

This is going to break tests.

I'm not sure how to deal with it, I think I might suggest we add a:

#[deprecated("core_api moved to block_api")]
pub use block_api as core_api;

In digest to pass the hump.

But anything that pulls both digest and elliptic-curve is going to break.

@tarcieri
Copy link
Copy Markdown
Member

Shouldn't this pull in digest from the local repo?

@baloo
Copy link
Copy Markdown
Member Author

baloo commented May 27, 2025

No it doesn't do that, and there is no easy way to do it either as it has dev-dependencies on sha2, which would in turn need a patch.crates-io

@tarcieri
Copy link
Copy Markdown
Member

So you're saying you want this merged even though it breaks the build?

@baloo
Copy link
Copy Markdown
Member Author

baloo commented May 27, 2025

I actually don't know what's the best option here.

The alternative is a release of digest with the buffering macros and then a release of sha1, sha2, hmac, pkcs5 and hkdf

Then we will be able to merge this with the tests passing.

@baloo
Copy link
Copy Markdown
Member Author

baloo commented May 27, 2025

Or split elliptic-curve integration tests in a crate outside the workspace in an unpublished crate that way we have more freedom to patch.crates-io and pull git dependencies.

@tarcieri
Copy link
Copy Markdown
Member

tarcieri commented May 27, 2025

Why can't you just add path/git dependencies for those?

Edit: seems to work: #1860

@tarcieri
Copy link
Copy Markdown
Member

Note: I would also be a fan of adding a #[deprecated] re-export of digest::block_api as core_api

@baloo
Copy link
Copy Markdown
Member Author

baloo commented May 27, 2025

Why can't you just add path/git dependencies for those?

diff --git a/Cargo.toml b/Cargo.toml
index 6d87a02f9c..3035948e4a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -15,4 +15,12 @@
 ]

 [patch.crates-io]
+digest = { path = "digest" }
 signature = { path = "signature" }
+
+sha2 = { git = "https://github.com/RustCrypto/hashes.git" }
+sha3 = { git = "https://github.com/RustCrypto/hashes.git" }
+
+hmac = { git = "https://github.com/RustCrypto/MACs.git" }
+
+hkdf = { git = "https://github.com/RustCrypto/KDFs.git" }

This would work for now, but the moment you bump the version of digest to anything else than 0.11.0-pre.10 this renders the patch.crates-io inactive and you will get:

    Checking hmac v0.13.0-pre.5 (https://github.com/RustCrypto/MACs.git#64d671d5)
error[E0432]: unresolved import `digest::block_api`
 --> $HOME/.cargo/git/checkouts/macs-9d164d3a4d163fe0/64d671d/hmac/src/block_api.rs:5:5
  |
5 |     block_api::{
  |     ^^^^^^^^^ could not find `block_api` in `digest`

@tarcieri
Copy link
Copy Markdown
Member

Well we wouldn't bump it until a release, when the patch.crates-io directive can be removed

@tarcieri
Copy link
Copy Markdown
Member

Closing in favor of #1860

@tarcieri tarcieri closed this May 27, 2025
@baloo baloo deleted the baloo/elliptic-curve/digest-breaking-changes branch May 27, 2025 19:51
tarcieri pushed a commit that referenced this pull request May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants