-
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
Support SHA256 precompile #213
Comments
Because there are 2 phases in the Sha256: extend and compress, we need to create 2 tables for each: ShaExtend and ShaCompress Here is the definition: ShaExtendCols: number of rounds: 48
constraints:
ShaExtendSpongeCols: handle the input/output of ShaExtend for each block:
constraints:
ShaCompressCols: input: a,b,c,.., h, SHA_COMPRESS_K[i]
constraints:
ShaCompressSponge
constraints:
// Execute the "finalize" phase.
let v = [a, b, c, d, e, f, g, h];
let mut cpu_row = CpuColumnsView::default();
cpu_row.clock = F::from_canonical_usize(state.traces.clock());
for i in 0..8 {
let addr = MemoryAddress::new(0, Segment::Code, h_ptr + i * 4);
let mem_op =
mem_write_gp_log_and_fill(i, addr, state, &mut cpu_row, hx[i].wrapping_add(v[i]));
state.traces.push_memory(mem_op);
} I do not know how to handle this. |
SHA256 starky reference: https://github.com/succinctlabs/starkyx/blob/1644af58bfc7d305c0066597c303a129fec7f427/starkyx/src/machine/hash/sha/sha256/register.rs
The text was updated successfully, but these errors were encountered: