-
Notifications
You must be signed in to change notification settings - Fork 164
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
implement Blake2s opcode in runner #1927
Open
ohad-nir-starkware
wants to merge
1
commit into
main
Choose a base branch
from
ohadn/blake2s_opcode_runner
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+312
−48
Conversation
This file contains 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
ohad-nir-starkware
requested review from
igaray,
Oppen,
fmoletta,
juanbono,
pefontana and
gabrielbosio
as code owners
January 26, 2025 18:46
ohad-nir-starkware
force-pushed
the
ohadn/blake2s_opcode_runner
branch
from
January 26, 2025 18:47
b3b5246
to
4f6a596
Compare
|
ohad-nir-starkware
force-pushed
the
ohadn/blake2s_opcode_runner
branch
from
January 26, 2025 19:06
4f6a596
to
13d5632
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1927 +/- ##
==========================================
- Coverage 96.34% 96.33% -0.01%
==========================================
Files 102 102
Lines 40830 40894 +64
==========================================
+ Hits 39336 39397 +61
- Misses 1494 1497 +3 ☔ View full report in Codecov by Sentry. |
ohad-nir-starkware
force-pushed
the
ohadn/blake2s_opcode_runner
branch
from
January 27, 2025 10:12
13d5632
to
6738a48
Compare
Benchmark Results for unmodified programs 🚀
|
ohad-nir-starkware
force-pushed
the
ohadn/blake2s_opcode_runner
branch
from
January 27, 2025 12:44
6738a48
to
da32b91
Compare
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.
Blake2s opcode runner
Description
Adding the opcode Blake2s to the VM.
Expects op0 to be a pointer to a sequence of 9 felts and and op1 to be a pointer to a sequence of 16 felts.
Said felts should represent u32 integers, i.e. have value of at most 2**32-1.
The first 8 felts of op0 represent a state and the 9th represents a counter.
The 16 felts of op1 represent a message.
The "output" consists of 9 felts representing u32 numbers. The first 8 are the output of the (non last block) Blake2s compression and the 9th is the updated counter.
dst should be a pointer, it points to a sequence of 9 cells which each should either be uninitialised or already contain a value matching that of the output at the same index.
The opcode inserts the aforementioned output into the 9 cells [dst], [dst+1], ... [dst+8] (and yields an error if one of said cells already contains a value differing from the output).
Currently Blake2s has opcode_num 8, meaning encoded_instr can use all 64 bits and InstructionNonZeroHighBits is no longer needed as an error.
The motivation is that it has been decided at Starkware that Blake2s is to be implemented at an opcode, thus it needs to be supported by the runner.
Checklist