akosba / jsnark

A Java library for zk-SNARK circuits
MIT License
207 stars 85 forks source link

Using AES128CipherCircuitGenerator with plaintexts of size more than 16 bytes #12

Closed hasinitg closed 5 years ago

hasinitg commented 5 years ago

Hi Ahmed @akosba

Could you please clarify if we have to run the AES128CipherCircuit multiple times (from generateCircuit()->evalCircuit()->prepFiles()->runLibsnark()) for plain texts of size more than 16 bytes? Or could there be a better way to use this circuit for larger plaintext sizes?

Thank you very much.

akosba commented 5 years ago

The AES128CipherGadget is for a single block only. There is already another example gadget for using a block cipher gadget in CBC mode. It should be straightforward to modify that to support the AES block cipher or to change the mode.

hasinitg commented 5 years ago

Than you Ahmed @akosba for the clarification and pointing out the other gadget in CBC mode. I will look into SymmetricEncryptionCBCGadget.