11use anyhow:: { Result , anyhow} ;
22
33use 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} ;
76use dusk_poseidon:: { Domain , Hash } ;
87use 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