-
Notifications
You must be signed in to change notification settings - Fork 54
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
feat: add Sha256 precompile #222
base: main
Are you sure you want to change the base?
Conversation
072ddfa
to
02d59f1
Compare
02d59f1
to
c241bc5
Compare
let mut state_values = vec![]; | ||
|
||
for i in 0..8 { | ||
let addr = MemoryAddress::new(0, Segment::Code, h_ptr + i * 4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use Segment::Code here?
The code segment is only used for loading program into memory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the implementation of Angel. I saw the same code in the generate_keccak
function implementation.
178644a
to
1fe7734
Compare
|
||
(row.temp1, row.carry_4) = wrapping_add(row.inter_3, row.w_i); | ||
|
||
row.a_rr_2 = rotate_right(row.input_state[get_input_range(0)].try_into().unwrap(), 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just keep track of row.input_state's [0..2], [2..13], [13..22], [22..256] ? This also means a_rr_13 is not necessary to be tracked by each row.
so we don't need input_state to be of size 256? this can significantly reduce the cells scale.
Implement Issue 213: Support SHA256 precompile