Open WeeknightMVP opened 1 year ago
Indeed, this would be nice to have. Currently, all of the IntMod
operations are implemented as SAWCore primitives, such as the ones here:
At first blush, adding recip
support for IntMod
would mean adding a new intModRecip
primitive and giving it appropriate semantics in each of the SAW simulator backends. This might not be entirely as straightforward to do for recip
as the other IntMod
primitives, since some of the backends (e.g., What4) lack direct counterparts to Cryptol's recip
function.
There is also the question about how to translate recip
over IntMod
s in the Coq translation. I image that ZModulo
in the Coq standard library would give us the tools we need to implement a version of recip
in Coq, but I haven't looked deeply at it.
While attempting to use SAW to verify the correctness of a Cryptol
property
that uses prime modular integer fields (prime p => Z p
), SAW's translation of the property to SAWCore included the assignmentx@... = error x@... "Unimplemented: recip IntMod"
, indicating thatIntMod
operatorrecip
is currently unimplemented.