-
Notifications
You must be signed in to change notification settings - Fork 89
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
Fix communication channel for the hash digest between syscall and keccak #2278
base: zkvm/syscalls/bytelength-lookups
Are you sure you want to change the base?
Fix communication channel for the hash digest between syscall and keccak #2278
Conversation
…x-preimagekey-lookup
Looks like the oracle will read the 0x02 byte, so I need to adapt the communication channel to look only at the 31 bytes.
|
…x-preimagekey-lookup
…re only in the final step before keccak is triggered
I just learnt that the preimage key chunks were not being stored at all in the witness columns (meaning |
Checked demo, this does not halt the VM and the SyscallReadPreimage constraints hold. |
While debugging
SyscallReadPreimage
I realized that the content of the RAM lookup on the MIPS side and the Keccak side for the hash digest (aka preimage key) was not aligned. Meaning, on the MIPS side the whole 256 bits were being taken into account for the vector lookup (32 bytes) whereas in the Keccak side it was ignoring the leading MSB (because it is meant to be substituted with a file descriptor at some point), so it was just computing the lookup with 31 bytes.Because the preimage key bytes are stored in the registers in 8 columns of 4 bytes each, it was easier to unify the lookup so the 32 bytes are considered. Then, other parts of the system are in charge of "removing" the leading byte.NOTE: this was not spotted before because we don't have tests for ram lookups yet, only fixed table lookups.