zkevm-circuits
zkevm-circuits copied to clipboard
Migrate multi-packed keccak witness assignment to `Value<F>` API
I made an effort to migrate Part<F> and PartValue<F> and the witness assignment/generation in general to use the Value<F> struct from halo2 API in https://github.com/privacy-scaling-explorations/zkevm-circuits/pull/925.
During the process, I found several problems on the path that discouraged me from continuing with the task although I think is doable without changes to the Halo2 Value API.
- It feels really tricky to extract the byte representation from a Value<F>. It feels like if you're cheating to the API constantly (using
.map()to gain access to the underlyingFso that you can do extra things with it such as decompose it into bytes actually). - Since the struct doesn't implement
PartialEqit's challenging to perform some sanity checks. - IIRC,
XOR/ANDare not implemented forValue. And that also complicates certain things as you need again to nest multiplemap()s to perform the operations with the underlying F's.
For these reasons, right now extract_field function was added. And the goal is to get ridd of it fixing the witness assignment/generation to be done with the Value<F> API.