lambdaclass / cairo-vm

cairo-vm is a Rust implementation of the Cairo VM. Cairo (CPU Algebraic Intermediate Representation) is a programming language for writing provable programs, where one party can prove to another that a certain computation was executed correctly without the need for this party to re-execute the same program.
https://lambdaclass.github.io/cairo-vm
Apache License 2.0
509 stars 142 forks source link

Make sure all `mod_floor` and `div_mod` calls have divisor checks #1434

Closed Juan-M-V closed 1 year ago

Juan-M-V commented 1 year ago

Describe the bug Some hints call mod_floor, div_mod and other functions that divide two numbers and are missing checks to ensure the divisors are never zero. They should be listed and the error fixed.

Juan-M-V commented 1 year ago

I was suspicious of UINT384_DIV but after testing it, realized it throws an error when attempting to divide by 0