Repository navigation
blake2s: BLAKE2s-256 on the round-function delegation for ZKsync OS guests - #14
Merged
Merged
Conversation
…uests Adds airbender_blake2s256 and airbender_blake2s_compress, which run ten rounds per delegation call on CSR 0x7c7 (the round count the current transpiler accepts). Host harness vectors cover both entry points.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
src/blake2s.cwith two entry points for ZKsync OS guests:airbender_blake2s256(data, len, out): BLAKE2s-256 of a buffer.airbender_blake2s_compress(state, block, counter, final): one compression.0x7c7), ten rounds per compression, which is the round count the7a147datranspiler accepts.build/build.shbuilds and exports both;tests/harness.candtests/run.pyadd vectors for both entry points; README lists them.Measured on the Nethermind ZKsync OS Airbender guest (Airbender CLI
7a147da, raw cycles), with the guest'sBlake2s256moved from managed code to these entry points. Public input is unchanged on every block:The guest's BLAKE2s round counts are within 1% of zksync-os's own program on the same blocks.
Testing
build/ci.sh: all 1569 vectors and the existing host, platform and ISA checks pass.Remarks
The Nethermind side (
Blake2s256zkevm variant and its binding) waits for a release with these entry points.🤖 AI agent (Claude Code / Opus 5.5) on behalf of @LukaszRozmej