cairo-lang icon indicating copy to clipboard operation
cairo-lang copied to clipboard

Restriction on the prime used not matching the paper

Open Nashtare opened this issue 2 years ago • 0 comments

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?

Nashtare avatar Mar 30 '22 11:03 Nashtare