SNARK-friendly Symmetric Encryption
Last updated
Last updated
We want an encryption scheme that would work well in arithmetic circuits (for SNARKS). So both the key and the input to the encryption should be vectors (with being the field).
Keygen: generate key uniformly at random
Encrypt:
Input: message , key
Sample a nonce uniformly at random. Compute
Compute for and let be the resulting vector
Compute (note )
Output
Decrypt:
Input: ciphertext , key ,
Compute based on as above
compute
Output
Total cost for encryption and decryption is: where is the number of gates one hashing costs.