arnaucube
arnaucube/schnorrPublic Self-hosted repository
Add some comments
Brian Lawrence tideofwords@gmail.com
Mon, 30 Sep 2024 15:53:38 -0700
commit

e6ee839a252e0ad72555d96841280f1723466f65

parent

2fe154cb66eeda31ffaa35cf99294d072f8275bc

3 files changed, 15 insertions(+), 0 deletions(-)

jump to
M src/mod65537.rs → 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,
M src/schnorr.rs → 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,
M src/schnorr_prover.rs → src/schnorr_prover.rs

@@ -21,6 +21,12 @@ };

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<Target>, }