From 72139d2787998bbbc112c55bf8f3c38e43678042 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Sun, 5 May 2024 17:05:18 +0300 Subject: [PATCH] Emit compilation error when compiled for Windows targets --- Cargo.lock | 21 ++++++--------------- md5/CHANGELOG.md | 6 ++++++ md5/Cargo.toml | 2 +- md5/src/lib.rs | 3 +++ sha1/CHANGELOG.md | 8 +++++++- sha1/Cargo.toml | 2 +- sha1/src/lib.rs | 3 +++ sha2/CHANGELOG.md | 8 +++++++- sha2/Cargo.toml | 2 +- sha2/src/lib.rs | 3 +++ whirlpool/CHANGELOG.md | 6 ++++++ whirlpool/Cargo.toml | 2 +- whirlpool/src/lib.rs | 3 +++ 13 files changed, 48 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ccdc5e6..d18e991 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5,43 +5,34 @@ version = 3 [[package]] name = "cc" -version = "1.0.82" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01" -dependencies = [ - "libc", -] - -[[package]] -name = "libc" -version = "0.2.147" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "065a29261d53ba54260972629f9ca6bffa69bac13cd1fed61420f7fa68b9f8bd" [[package]] name = "md5-asm" -version = "0.5.1" +version = "0.5.2" dependencies = [ "cc", ] [[package]] name = "sha1-asm" -version = "0.5.2" +version = "0.5.3" dependencies = [ "cc", ] [[package]] name = "sha2-asm" -version = "0.6.3" +version = "0.6.4" dependencies = [ "cc", ] [[package]] name = "whirlpool-asm" -version = "0.6.1" +version = "0.6.2" dependencies = [ "cc", ] diff --git a/md5/CHANGELOG.md b/md5/CHANGELOG.md index 99ee0f6..1974e88 100644 --- a/md5/CHANGELOG.md +++ b/md5/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.5.2 (2024-05-06) +### Changed +- Emit compilation error when compiled for Windows targets. ([#79]) + +[#79]: https://github.com/RustCrypto/asm-hashes/pull/79 + ## 0.5.1 (2023-08-07) ### Changed - Prefix x86 asm symbols with `_`` on Windows like on Apple ([#61]) diff --git a/md5/Cargo.toml b/md5/Cargo.toml index 0daf0e4..ad3bef7 100644 --- a/md5/Cargo.toml +++ b/md5/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "md5-asm" -version = "0.5.1" +version = "0.5.2" authors = ["RustCrypto Developers"] license = "MIT" description = "Assembly implementation of MD5 compression function" diff --git a/md5/src/lib.rs b/md5/src/lib.rs index 95d2b58..51ac020 100644 --- a/md5/src/lib.rs +++ b/md5/src/lib.rs @@ -12,6 +12,9 @@ #[cfg(not(any(target_arch = "x86_64", target_arch = "x86")))] compile_error!("crate can only be used on x86 and x86-64 architectures"); +#[cfg(target_os = "windows")] +compile_error!("crate does not support Windows targets"); + #[link(name = "md5", kind = "static")] extern "C" { fn md5_compress(state: &mut [u32; 4], block: &[u8; 64]); diff --git a/sha1/CHANGELOG.md b/sha1/CHANGELOG.md index a8baaf6..fcd5dd2 100644 --- a/sha1/CHANGELOG.md +++ b/sha1/CHANGELOG.md @@ -4,9 +4,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.5.3 (2024-05-06) +### Changed +- Emit compilation error when compiled for Windows targets. ([#79]) + +[#79]: https://github.com/RustCrypto/asm-hashes/pull/79 + ## 0.5.2 (2023-08-07) ### Changed -- Prefix x86 asm symbols with `_`` on Windows like on Apple ([#61]) +- Prefix x86 asm symbols with `_` on Windows like on Apple ([#61]) - Fix deprecated use of `cc::Build::compile` ([#59]) [#61]: https://github.com/RustCrypto/asm-hashes/pull/61 diff --git a/sha1/Cargo.toml b/sha1/Cargo.toml index abb9239..a23b96b 100644 --- a/sha1/Cargo.toml +++ b/sha1/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sha1-asm" -version = "0.5.2" +version = "0.5.3" authors = ["RustCrypto Developers"] license = "MIT" description = "Assembly implementation of SHA-1 compression function" diff --git a/sha1/src/lib.rs b/sha1/src/lib.rs index 850458c..489b50c 100644 --- a/sha1/src/lib.rs +++ b/sha1/src/lib.rs @@ -12,6 +12,9 @@ #[cfg(not(any(target_arch = "x86_64", target_arch = "x86", target_arch = "aarch64")))] compile_error!("crate can only be used on x86, x86_64 and AArch64 architectures"); +#[cfg(target_os = "windows")] +compile_error!("crate does not support Windows targets"); + #[link(name = "sha1", kind = "static")] extern "C" { fn sha1_compress(state: &mut [u32; 5], block: &[u8; 64]); diff --git a/sha2/CHANGELOG.md b/sha2/CHANGELOG.md index e1f1778..4413aa0 100644 --- a/sha2/CHANGELOG.md +++ b/sha2/CHANGELOG.md @@ -5,9 +5,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.6.4 (2024-05-06) +### Changed +- Emit compilation error when compiled for Windows targets. ([#79]) + +[#79]: https://github.com/RustCrypto/asm-hashes/pull/79 + ## 0.6.3 (2023-08-07) ### Changed -- Prefix x86 asm symbols with `_`` on Windows like on Apple ([#61]) +- Prefix x86 asm symbols with `_` on Windows like on Apple ([#61]) [#61]: https://github.com/RustCrypto/asm-hashes/pull/61 diff --git a/sha2/Cargo.toml b/sha2/Cargo.toml index 1a82b43..48dcbe5 100644 --- a/sha2/Cargo.toml +++ b/sha2/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sha2-asm" -version = "0.6.3" +version = "0.6.4" authors = ["RustCrypto Developers"] license = "MIT" description = "Assembly implementation of SHA-2 compression functions" diff --git a/sha2/src/lib.rs b/sha2/src/lib.rs index c01bd96..0a0f32c 100644 --- a/sha2/src/lib.rs +++ b/sha2/src/lib.rs @@ -13,6 +13,9 @@ #[cfg(not(any(target_arch = "x86_64", target_arch = "x86", target_arch = "aarch64")))] compile_error!("crate can only be used on x86, x86-64 and aarch64 architectures"); +#[cfg(target_os = "windows")] +compile_error!("crate does not support Windows targets"); + #[link(name = "sha256", kind = "static")] extern "C" { fn sha256_compress(state: &mut [u32; 8], block: &[u8; 64]); diff --git a/whirlpool/CHANGELOG.md b/whirlpool/CHANGELOG.md index c334349..0a06ac8 100644 --- a/whirlpool/CHANGELOG.md +++ b/whirlpool/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.6.2 (2024-05-06) +### Changed +- Emit compilation error when compiled for Windows targets. ([#79]) + +[#79]: https://github.com/RustCrypto/asm-hashes/pull/79 + ## 0.6.1 (2023-08-07) ### Changed - Prefix x86 asm symbols with `_`` on Windows like on Apple ([#61]) diff --git a/whirlpool/Cargo.toml b/whirlpool/Cargo.toml index 81fe0d7..df48c3b 100644 --- a/whirlpool/Cargo.toml +++ b/whirlpool/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "whirlpool-asm" -version = "0.6.1" +version = "0.6.2" authors = ["RustCrypto Developers"] license = "MIT" description = "Assembly implementation of Whirlpool compression function" diff --git a/whirlpool/src/lib.rs b/whirlpool/src/lib.rs index 2b21501..4de48af 100644 --- a/whirlpool/src/lib.rs +++ b/whirlpool/src/lib.rs @@ -12,6 +12,9 @@ #[cfg(not(any(target_arch = "x86_64", target_arch = "x86")))] compile_error!("crate can only be used on x86 and x86-64 architectures"); +#[cfg(target_os = "windows")] +compile_error!("crate does not support Windows targets"); + #[link(name = "whirlpool", kind = "static")] extern "C" { fn whirlpool_compress(state: &mut [u64; 8], block: &[u8; 64]);