RustCrypto / asm-hashes

Assembly implementations of cryptographic hash functions
46 stars 26 forks source link

sha1: Add extra .S for AArch64 on macOS (Fixing building on M1 Macs) #38

Closed tlercher closed 3 years ago

tlercher commented 3 years ago

I applied the same fix as in #35 to the sha1 version with @PAGE for addressing and @PAGEOFF for loading.

It might not be an ideal solution, but it works for me and fixes #28 on my machine.

tarcieri commented 3 years ago

I'm on vacation and away from my M1, so I'm unable to confirm this works correctly at this time.

I'd prefer to wait until I can do that (or another projector contributor can) before merging this.

tarcieri commented 3 years ago

I’ll be able to test it in a few days

Absolucy commented 3 years ago

Is there any reason why target_os == "macos" is used instead of target_vendor == "apple"? The build error is also present on iOS targets.

tarcieri commented 3 years ago

I can confirm it builds. I would suggest adopting @Absolucy's suggestion to use target_vendor == "apple" so it works on iOS as well

tlercher commented 3 years ago

Quite the nice solution, thanks for the Input! I added a commit which is also renaming the files (+ fixing sha2 too)

newpavlov commented 3 years ago

@tarcieri No objections. Feel free to merge and cut a release.

tarcieri commented 3 years ago

Okay, sha1-asm v0.5.1 has been released. However, the sha-1 crate still needs to be bumped to use v0.5.x of sha1-asm.