Skip to content
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

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

Conversation

VanhGer
Copy link
Contributor

@VanhGer VanhGer commented Feb 3, 2025

let mut state_values = vec![];

for i in 0..8 {
let addr = MemoryAddress::new(0, Segment::Code, h_ptr + i * 4);
Copy link
Member

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.

Copy link
Contributor Author

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.


(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);
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants