cairo-lang
cairo-lang copied to clipboard
Restriction on the prime used not matching the paper
The Cairo paper stipulates that the prime to be used needs to be greater than 2^63 (i.e. be of 64 bits at least), for proper instruction decoding. This check is done in src/starkware/cairo/lang/compiler/program.py, line 68.
However I came accross this additional check in src/starkware/cairo/lang/compiler/encode.py, line 38 that prevents the use of any prime below 2^64. The last bit, called RESERVED_BIT
, is commented out, and I couldn't find where this discrepancy with the Cairo paper was actually being leveraged. Couldn't this check be relaxed to match the paper? Or are there modifications I missed requiring this?