You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Investigate using blake2s logic from types-rs repo #2159
Moving blake2s logic from the VM to types-rs implies removing the blake2s_compress function which is public and not intended to be removed in the next releases.
Activity
[-]Use blake2s logic from `types-rs` repo[/-][+]Investigate using blake2s logic from `types-rs` repo[/+]JulianGCalderon commentedon Aug 13, 2025
The current types-rs API does not work for our use case. Currently, it exposes:
It hashes all the data at once, which is not what we need.
From the Cairo VM (and also in Cairo Native), we need a much low-level API for Blake2. We would need something like this:
As this API requires the user to know the initial state, we also also need a way to obtain either the IV, or the initial state.
The Rust crate
blake2does not expose this functionality, so we would need to implement it manually. See blake2s_hash.rs.In addition to the mentioned functions, the following utilities would come in handy:
The following utilities are already implemented, and can be used:
gabrielbosio commentedon Sep 16, 2025
Moving blake2s logic from the VM to types-rs implies removing the
blake2s_compressfunction which is public and not intended to be removed in the next releases.