mirror of
https://github.com/arnaucube/schnorr.git
synced 2026-01-12 17:01:29 +01:00
Add some comments
This commit is contained in:
@@ -19,6 +19,8 @@ use crate::schnorr::{SchnorrPublicKey, SchnorrSignature};
|
|||||||
|
|
||||||
type GoldF = GoldilocksField;
|
type GoldF = GoldilocksField;
|
||||||
|
|
||||||
|
// Helper function to constrain r = a % 65537 in a plonky2 circuit.
|
||||||
|
|
||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default)]
|
||||||
pub struct Mod65537Generator {
|
pub struct Mod65537Generator {
|
||||||
a: Target,
|
a: Target,
|
||||||
|
|||||||
@@ -8,6 +8,13 @@ use rand::Rng;
|
|||||||
|
|
||||||
const BIG_GROUP_GEN: GoldilocksField = GoldilocksField(14293326489335486720);
|
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)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub struct SchnorrSigner {
|
pub struct SchnorrSigner {
|
||||||
PRIME_GROUP_GEN: GoldilocksField,
|
PRIME_GROUP_GEN: GoldilocksField,
|
||||||
|
|||||||
@@ -21,6 +21,12 @@ use crate::{
|
|||||||
|
|
||||||
type GoldF = GoldilocksField;
|
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 {
|
pub struct MessageTarget {
|
||||||
msg: Vec<Target>,
|
msg: Vec<Target>,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user