Browse Source

Add some comments

master
Brian Lawrence 6 months ago
parent
commit
e6ee839a25
3 changed files with 15 additions and 0 deletions
  1. +2
    -0
      src/mod65537.rs
  2. +7
    -0
      src/schnorr.rs
  3. +6
    -0
      src/schnorr_prover.rs

+ 2
- 0
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,

+ 7
- 0
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,

+ 6
- 0
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<Target>,
}

Loading…
Cancel
Save