arecibo icon indicating copy to clipboard operation
arecibo copied to clipboard

Supernova: better slices handling

Open tchataigner opened this issue 11 months ago • 2 comments

While trying to further my understanding of how to handle the program counter I have encountered a case where we have a panic in supernova::snark::CompressedSNARK::verify.

It happened a conversation I had with @adr1anh about what value should the program counter of the last StepCircuit of a NIVC computation. After the discussion, I tried to set the pc to -F::ONE and I ended up with a panic as I was trying to access an index out of bounds.

This is due to the fact that in the supernova codebase there are a few places (1 , 2, ...) where we try to access indexes without ensuring they exist.

I suggest to use a .get method to return a proper error.

tchataigner avatar Mar 08 '24 12:03 tchataigner