diff --git a/src/mod65537.rs b/src/mod65537.rs index d901b02..56a4117 100644 --- a/src/mod65537.rs +++ b/src/mod65537.rs @@ -19,6 +19,8 @@ use crate::schnorr::{SchnorrPublicKey, SchnorrSignature}; type GoldF = GoldilocksField; +// Helper function to constrain r = a % 65537 in a plonky2 circuit. + #[derive(Debug, Default)] pub struct Mod65537Generator { a: Target, diff --git a/src/schnorr.rs b/src/schnorr.rs index 39acec6..7ff038b 100644 --- a/src/schnorr.rs +++ b/src/schnorr.rs @@ -8,6 +8,13 @@ use rand::Rng; const BIG_GROUP_GEN: GoldilocksField = GoldilocksField(14293326489335486720); +// No ZK here. +// This is just a simple implementation of Schnorr signatures: +// keygen, sign, and verify. + +// 8-bit security (i.e. totally insecure, DO NOT USE if you want any security at all) +// because it uses the multiplicative group of the Goldilocks field + #[derive(Copy, Clone, Debug)] pub struct SchnorrSigner { PRIME_GROUP_GEN: GoldilocksField, diff --git a/src/schnorr_prover.rs b/src/schnorr_prover.rs index 0a48e14..47742ba 100644 --- a/src/schnorr_prover.rs +++ b/src/schnorr_prover.rs @@ -21,6 +21,12 @@ use crate::{ type GoldF = GoldilocksField; +// Functions to verify a Schnorr signature in a plonky2 circuit. + +// 8-bit security (i.e. totally insecure, DO NOT USE if you want any security at all) +// because it uses the multiplicative group of the Goldilocks field +// This is intended solely as a proof of concept. + pub struct MessageTarget { msg: Vec, }