Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

md5: add inline assembly support for x86_64 and x86 #447

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/md5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,20 @@ jobs:
toolchain: ${{ matrix.rust }}
override: true
- run: cargo test --features oid

# TODO: merge with test on MSRV bump to 1.59 or higher
test-inline-asm:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- 1.59.0 # MSRV
steps:
- uses: actions/checkout@v3
- uses: RustCrypto/actions/cargo-cache@master
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- run: cargo test --features inline-asm
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions md5/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ digest = "0.10.4"

[target.'cfg(any(target_arch = "x86", target_arch = "x86_64"))'.dependencies]
md5-asm = { version = "0.5", optional = true }
asm_block = { version = "0.1.3", optional = true }

[dev-dependencies]
digest = { version = "0.10.4", features = ["dev"] }
Expand All @@ -28,4 +29,5 @@ hex-literal = "0.2.2"
default = ["std"]
std = ["digest/std"]
asm = ["md5-asm"] # WARNING: this feature SHOULD NOT be enabled by library crates
inline-asm = ["asm_block"] # Enable inline assembly support. WARNING: Bumps MSRV to 1.59
oid = ["digest/oid"] # Enable OID support. WARNING: Bumps MSRV to 1.57
2 changes: 2 additions & 0 deletions md5/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ including HMAC-MD5.

Rust **1.41** or higher.

Enabling feature flag `inline-asm` requires Rust **1.59** or higher.

Minimum supported Rust version can be changed in the future, but it will be
done with a minor version bump.

Expand Down
5 changes: 5 additions & 0 deletions md5/src/asm/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
mod x86;

#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
pub use x86::compress;