BLAKE3-team / BLAKE3

the official Rust and C implementations of the BLAKE3 cryptographic hash function
Apache License 2.0
4.71k stars 315 forks source link

Implement compress for NEON #369

Closed silvanshade closed 3 weeks ago

silvanshade commented 5 months ago

This implements the compress functionality for Neon so that it has feature parity with the other SIMD backends.

Unfortunately, as suggested in the comment in the source, it seems to be no faster than the scalar implementation.

However, I figured it would at least be worth creating the PR in case someone can figure out a way to improve it.

I did try a few different techniques for implementing various parts but none of them seemed to help, or they were sometimes slower. I'm no Neon expert either so mostly this was just a naive attempt to see what the end result would be.

EDIT: I should note that I only tested this on an M3 Max MacBook Pro so it might have different performance on another platform if someone can give it a try.