Add some comments

This commit is contained in:
Brian Lawrence
2024-09-30 15:53:38 -07:00
parent 2fe154cb66
commit e6ee839a25
3 changed files with 15 additions and 0 deletions

View File

@@ -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,

View File

@@ -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,

View File

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