-
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 blake opcode in runner #1922
Closed
Closed
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 24, 2025 18:23
|
Benchmark Results for unmodified programs 🚀
|
ohad-nir-starkware
force-pushed
the
ohadn/blake-runner
branch
2 times, most recently
from
January 25, 2025 09:04
00b734b
to
f634f80
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1922 +/- ##
========================================
Coverage 96.34% 96.34%
========================================
Files 102 103 +1
Lines 40830 41012 +182
========================================
+ Hits 39336 39513 +177
- Misses 1494 1499 +5 ☔ View full report in Codecov by Sentry. |
ohad-nir-starkware
force-pushed
the
ohadn/blake-runner
branch
from
January 25, 2025 10:03
f634f80
to
bc57aa5
Compare
ohad-nir-starkware
force-pushed
the
ohadn/blake-runner
branch
from
January 25, 2025 18:24
bc57aa5
to
61bc111
Compare
ohad-nir-starkware
requested review from
YairVaknin-starkware
and removed request for
YairVaknin-starkware
January 25, 2025 20:23
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 two opcodes for Blake2s: Blake2s and Blake2sLastBlock.
Both expect 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 appropriate Blake2s compression (either of a final block or a non final block) and the 9th is the updated counter.
in both cases 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 Blake2sLastBlock assumes that [op1]!=0 and if 0<=j<=15 is the last index for which [op1+j]!=0 then the final block of the message is only 4*(j+1) bytes long.
Currently Blake2s and Blake2sLastBlock have opcode_num 8 and 16 respectively, 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 Blake2s is to be implemented at an opcode, thus it needs to be supported by the runner.
Checklist