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

Blake3 CPU support #733

Merged
merged 25 commits into from
Jan 14, 2025
Merged

Blake3 CPU support #733

merged 25 commits into from
Jan 14, 2025

Conversation

aviadingo
Copy link
Contributor

@aviadingo aviadingo commented Jan 12, 2025

adding Blake3 support in C, RUST and GO.
Including unit tests in all 3 frontends

cuda-backend-branch: aviad/blake3_cuda

@@ -40,6 +41,10 @@ Keccak can take input messages of any length and produce a fixed-size hash. It u

[Blake2s](https://www.rfc-editor.org/rfc/rfc7693.txt) is an optimized cryptographic hash function that provides high performance while ensuring strong security. Blake2s is ideal for hashing small data (such as field elements), especially when speed is crucial. It produces a 256-bit (32-byte) output and is often used in cryptographic protocols.

### Blake3

[Blake3](https://www.ietf.org/archive/id/draft-aumasson-blake3-00.html) is a high-performance cryptographic hash function designed for both small and large data. With variable-length output (default 256 bits) and a tree-based design for efficient parallelism, it offers strong security, speed, and scalability for modern cryptographic applications.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we support the variable input size?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assuming you mean output as stated in the phrase, we technically support variable output-size but it is not tested and not really common. I'll remove this line.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I asked about any input size.
Do we support any size of input?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Copy link
Contributor

@mickeyasa mickeyasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some comments

@@ -371,7 +371,7 @@ class VectorOpTask : public TaskBase
public:
T m_intermidiate_res; // pointer to the output. Can be a vector or scalar pointer
uint64_t m_idx_in_batch; // index in the batch. Used in intermediate res tasks
};
}; // class VectorOpTask
Copy link
Collaborator

@yshekel yshekel Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this comment is causing issues for formatters (they format it differently for some reason) so I suggest removing it

@yshekel yshekel merged commit 488421b into main Jan 14, 2025
16 checks passed
@yshekel yshekel deleted the aviad/blake3 branch January 14, 2025 12:59
mickeyasa pushed a commit that referenced this pull request Jan 20, 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.

4 participants