Skip to content

Commit dbf3157

Browse files
committed
Spell check typos.
1 parent 67a4f7f commit dbf3157

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

src/toolbox/sigma/group_morphism.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pub struct LinearCombination {
66
}
77

88
pub struct Morphism<G: Group> {
9-
pub linear_combinaison: Vec<LinearCombination>,
9+
pub linear_combination: Vec<LinearCombination>,
1010
pub group_elements: Vec<G>,
1111
pub num_scalars: usize,
1212
pub num_elements: usize,
@@ -23,23 +23,23 @@ fn msm_pr<G: Group>(scalars: &[G::Scalar], bases: &[G]) -> G {
2323
impl<G: Group> Morphism<G> {
2424
pub fn new() -> Self {
2525
Self {
26-
linear_combinaison: Vec::new(),
26+
linear_combination: Vec::new(),
2727
group_elements: Vec::new(),
2828
num_scalars: 0,
2929
num_elements: 0,
3030
}
3131
}
3232

3333
pub fn append(&mut self, lc: LinearCombination) {
34-
self.linear_combinaison.push(lc);
34+
self.linear_combination.push(lc);
3535
}
3636

3737
pub fn num_statements(&self) -> usize {
38-
self.linear_combinaison.len()
38+
self.linear_combination.len()
3939
}
4040

4141
pub fn evaluate(&self, scalars: &[<G as Group>::Scalar]) -> Vec<G> {
42-
self.linear_combinaison.iter().map(|lc| {
42+
self.linear_combination.iter().map(|lc| {
4343
let coefficients: Vec<_> = lc.scalar_indices.iter().map(|&i| scalars[i].clone()).collect();
4444
let elements: Vec<_> = lc.element_indices.iter().map(|&i| self.group_elements[i].clone()).collect();
4545
msm_pr(&coefficients, &elements)

tests/non_interactive_protocol.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fn fiat_shamir_schnorr_proof_ristretto() {
3232
let mut witness = Vec::new();
3333
witness.push(w.clone());
3434

35-
// The H = z * G equeation where z is the unique scalar variable
35+
// The H = z * G equation where z is the unique scalar variable
3636
morphismp.append_equation(1, &[(0, 0)]);
3737

3838
// The SigmaProtocol induced by morphismp

tests/proof_composition_test.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ use rand::{rngs::OsRng, CryptoRng, Rng};
44
use sigma_rs::toolbox::sigma::{proof_composition::OrEnum, AndProtocol, OrProtocol, SigmaProtocol};
55
use curve25519_dalek::{ristretto::RistrettoPoint, scalar::Scalar};
66

7-
pub struct LokZkpSchnorr {
7+
pub struct SchnorrZkp {
88
pub generator: RistrettoPoint,
99
pub target: RistrettoPoint
1010
}
1111

1212
#[allow(non_snake_case)]
13-
impl SigmaProtocol for LokZkpSchnorr {
13+
impl SigmaProtocol for SchnorrZkp {
1414
type Witness = Scalar;
1515
type Commitment = RistrettoPoint;
1616
type ProverState = (Scalar, Scalar);
@@ -79,8 +79,8 @@ fn andproof_schnorr_correct() {
7979
let H1 = w1 * G1;
8080
let H2 = w2 * G2;
8181

82-
let p1 = LokZkpSchnorr { generator: G1, target: H1 };
83-
let p2 = LokZkpSchnorr { generator: G2, target: H2 };
82+
let p1 = SchnorrZkp { generator: G1, target: H1 };
83+
let p2 = SchnorrZkp { generator: G2, target: H2 };
8484

8585
let and_proof = AndProtocol::new(p1, p2);
8686

@@ -116,8 +116,8 @@ fn andproof_schnorr_incorrect() {
116116
let H1 = w1 * G1;
117117
let H2 = w2 * G2;
118118

119-
let p1 = LokZkpSchnorr { generator: G1, target: H1 };
120-
let p2 = LokZkpSchnorr { generator: G2, target: H2 };
119+
let p1 = SchnorrZkp { generator: G1, target: H1 };
120+
let p2 = SchnorrZkp { generator: G2, target: H2 };
121121

122122
let and_proof = AndProtocol::new(p1, p2);
123123

@@ -151,8 +151,8 @@ fn orproof_schnorr_correct() {
151151
let H1 = w1 * G1;
152152
let H2 = RistrettoPoint::random(&mut rng); // The witness for this point is unknown
153153

154-
let p1 = LokZkpSchnorr { generator: G1, target: H1 };
155-
let p2 = LokZkpSchnorr { generator: G2, target: H2 };
154+
let p1 = SchnorrZkp { generator: G1, target: H1 };
155+
let p2 = SchnorrZkp { generator: G2, target: H2 };
156156

157157
let or_proof = OrProtocol::new(p1, p2);
158158

@@ -186,8 +186,8 @@ fn orproof_schnorr_incorrect() {
186186
let H1 = RistrettoPoint::random(&mut rng); // The witness for this point is unknown
187187
let H2 = RistrettoPoint::random(&mut rng); // The witness for this point is unknown
188188

189-
let p1 = LokZkpSchnorr { generator: G1, target: H1 };
190-
let p2 = LokZkpSchnorr { generator: G2, target: H2 };
189+
let p1 = SchnorrZkp { generator: G1, target: H1 };
190+
let p2 = SchnorrZkp { generator: G2, target: H2 };
191191

192192
let or_proof = OrProtocol::new(p1, p2);
193193

0 commit comments

Comments
 (0)