0xPolygonZero / plonky2

Apache License 2.0
745 stars 270 forks source link

change `set_stark_proof_target`'s witness to `WitnessWrite` #1592

Closed qope closed 1 month ago

qope commented 1 month ago

The witness used in set_stark_proof_target is sufficient with WitnessWrite. Witness (which inherits from WitnessWrite) cannot be used in cases like run_once of SimpleGenerator.

qope commented 1 month ago

I am writing a generator that automatically generates and verifies a starky proof. I need to set the starky proof in the out_buffer, but GeneratedValues<F> only implements WitnessWrite<F> and does not implement Witness<F>. The link below shows the usage of Starky after applying this PR: https://github.com/InternetMaximalism/plonky2_keccak/blob/5aecea14a6325f21b57e22e072fd2051bffc0607/src/generators/stark_proof_generator.rs#L155-L251

Even aside from the above issue, I believe it is desirable to change set_stark_proof_target to use WitnessWrite<F> instead of Witness<F> since it does not utilize the Witness<F> trait.