-
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
Ohadn/blake2s last block opcode vm #1932
Open
ohad-nir-starkware
wants to merge
2
commits into
ohadn/blake2s_opcode_runner
Choose a base branch
from
ohadn/blake2s_last_block_opcode_VM
base: ohadn/blake2s_opcode_runner
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
Ohadn/blake2s last block opcode vm #1932
ohad-nir-starkware
wants to merge
2
commits into
ohadn/blake2s_opcode_runner
from
ohadn/blake2s_last_block_opcode_VM
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 29, 2025 14:39
ohad-nir-starkware
changed the base branch from
main
to
ohadn/blake2s_opcode_runner
January 29, 2025 14:48
|
Benchmark Results for unmodified programs 🚀
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## ohadn/blake2s_opcode_runner #1932 +/- ##
===============================================================
- Coverage 96.35% 96.34% -0.02%
===============================================================
Files 102 102
Lines 41071 41087 +16
===============================================================
+ Hits 39574 39585 +11
- Misses 1497 1502 +5 ☔ View full report in Codecov by Sentry. |
ohad-nir-starkware
force-pushed
the
ohadn/blake2s_last_block_opcode_VM
branch
from
January 29, 2025 16:43
bcf7dc5
to
4919048
Compare
ohad-nir-starkware
force-pushed
the
ohadn/blake2s_opcode_runner
branch
from
January 30, 2025 12:27
912b050
to
2ce852d
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.
Blake2sLastBlock opcode runner
Description
Adding the opcode Blake2sLastBlock 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, the 9th represents the counter and the 10th represents counter+n_bytes i.e. the total length of the entire message.
The 16 felts of op1 represent a message.
The "output" consists of 8 felts representing u32 numbers of the Blake2s compression of the last block.
dst should be a pointer, it points to a sequence of 8 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 8 cells [dst], [dst+1], ... [dst+7] (and yields an error if one of said cells already contains a value differing from the output).
Currently Blake2sLastBlock has opcode_num 16, meaning encoded_instr is expanded to 128 bits with the 63 most significant bits expected to be 0 (otherwise yield an error).
The motivation is that it has been decided at Starkware that Blake2sLastBlock is to be implemented at an opcode, thus it needs to be supported by the runner.
Checklist