Encrypted Modular Addition
encrypted-addmod · spec v0.1.0 · 0 implementations · 6 runners
DESCRIPTION
Computes (a + b) mod m with all three operands encrypted.
The EVM defines this as a single opcode precisely because the intermediate sum may exceed the word width, and the answer must be computed as though it had not. Under encryption that guarantee has to hold without anyone being able to check whether the overflow occurred.
INTERFACE
encrypted_addmod( in ct : Ciphertext // the encrypted first operand in ct_b : Ciphertext // the encrypted second addend, with the modulus alongside out ct : Ciphertext // the encrypted result of the opcode ... // anything else the realization needs — keys, context, encoding — is its own concern )
PARAMETER SCHEMA
The schema belongs to the kernel. Each implementation declares which part of it it supports.
CORRECTNESS
An opcode is exact by definition. Where the scheme is approximate, the precision threshold is what stands in for exactness, and it has to hold at every integer in range.
SECURITY PROPERTIES
Operands and result stay encrypted throughout. Nothing about the values may be observable through timing or control flow, which rules out any realization that branches on a decrypted intermediate.
ASSUMPTIONS
Operands are integers held exactly at the point of encryption.