This repository contains the source code and necessary files to implement verifiable encryption using Halo2. This work solves a task that allows a prover to prove some property of a message m, while the message is given in an encrypted form.
[verifiable_encryption.rs] implements a system for the prover to prove to the verifier that she knows the knowledge of a message m that encrypts to a cipehrtext C. [doc, Section 3.2]
[verifiable_encryption_with_relation.rs] implements a system for the prover to prove to the verifier that she knows the knowledge of a message m that encrypts to a cipehrtext C. Additionally, the message is a private key of a digital signature scheme. [doc, Section 3.3]
To run the round trip test:
cargo test --package halo2_verifiable_encryption --lib circuits::verifiable_encryption::tests::round_trip
To run the round trip test:
cargo test --package halo2_verifiable_encryption --lib circuits::verifiable_encryption_with_relation::tests::round_trip
To run the negative test with tampered public input:
cargo test --package halo2_verifiable_encryption --lib circuits::verifiable_encryption_with_relation::tests::negative_test
To run the negative test with tampered witness:
cargo test --package halo2_verifiable_encryption --lib circuits::verifiable_encryption_with_relation::tests::negative_witness_test