Skip to content

Commit b47dfad

Browse files
committed
fmt and clippy.
1 parent 0b12f01 commit b47dfad

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

mithril-stm/src/schnorr_signature/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use dusk_jubjub::Fq as JubjubBase;
1414

1515
/// A DST (Domain Separation Tag) to distinguish between use of Poseidon hash
1616
pub(crate) const DST_SIGNATURE: JubjubBase = JubjubBase::from_raw([0u64, 0, 0, 0]);
17-
pub(crate) const DST_LOTTERY: JubjubBase = JubjubBase::from_raw([1u64, 0, 0, 0]);
1817

1918
#[cfg(test)]
2019
mod tests {

mithril-stm/src/schnorr_signature/signature.rs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
use anyhow::{Result, anyhow};
22

33
use dusk_jubjub::{
4-
ExtendedPoint as JubjubExtended, Fq as JubjubBase, Fr as JubjubScalar,
5-
SubgroupPoint as JubjubSubgroup,
4+
ExtendedPoint as JubjubExtended, Fr as JubjubScalar, SubgroupPoint as JubjubSubgroup,
65
};
76
use dusk_poseidon::{Domain, Hash};
87
use group::{Group, GroupEncoding};
98

10-
use crate::{
11-
Index,
12-
schnorr_signature::{
13-
DST_LOTTERY, DST_SIGNATURE, SchnorrVerificationKey, get_coordinates_extended,
14-
get_coordinates_subgroup,
15-
},
9+
use crate::schnorr_signature::{
10+
DST_SIGNATURE, SchnorrVerificationKey, get_coordinates_extended, get_coordinates_subgroup,
1611
};
1712

1813
/// Structure of the Schnorr signature to use with the SNARK
@@ -73,14 +68,16 @@ impl SchnorrSignature {
7368

7469
// Computing R2 = g * s + vk * c
7570
let generator_times_s = generator * self.signature;
76-
let vk_times_challenge = vk.0 * self.challenge;
71+
let vk_times_challenge = verification_key.0 * self.challenge;
7772
let random_value_2_recomputed = generator_times_s + vk_times_challenge;
7873

7974
let (hash_msg_x, hash_msg_y) = get_coordinates_extended(hash_msg);
8075
let (verification_key_x, verification_key_y) = get_coordinates_subgroup(verification_key.0);
8176
let (sigma_x, sigma_y) = get_coordinates_extended(self.sigma);
82-
let (random_value_1_recomputed_x, random_value_1_recomputed_y) = get_coordinates_extended(random_value_1_recomputed);
83-
let (random_value_2_recomputed_x, random_value_2_recomputed_y) = get_coordinates_subgroup(random_value_2_recomputed);
77+
let (random_value_1_recomputed_x, random_value_1_recomputed_y) =
78+
get_coordinates_extended(random_value_1_recomputed);
79+
let (random_value_2_recomputed_x, random_value_2_recomputed_y) =
80+
get_coordinates_subgroup(random_value_2_recomputed);
8481
let challenge_recomputed = Hash::digest_truncated(
8582
Domain::Other,
8683
&[
@@ -106,7 +103,6 @@ impl SchnorrSignature {
106103
Ok(())
107104
}
108105

109-
110106
/// Convert an `SchnorrSignature` to a byte representation.
111107
pub fn to_bytes(self) -> [u8; 96] {
112108
let mut out = [0; 96];

0 commit comments

Comments
 (0)