11use midnight_circuits:: instructions:: { HashToCurveCPU , hash:: HashCPU } ;
22pub use midnight_curves:: {
3- Fq as JubjubBase , Fr as JubjubScalar , JubjubExtended as Jubjub , JubjubExtended , JubjubSubgroup ,
3+ Fq as JubjubBase , Fr as JubjubScalar , JubjubSubgroup ,
44} ;
55
66use ff:: Field ;
77use group:: Group ;
88use rand_core:: { CryptoRng , RngCore } ;
9- use subtle:: CtOption ;
10- use thiserror:: Error ;
119
1210use crate :: schnorr_signatures:: signature:: * ;
1311use crate :: schnorr_signatures:: verification_key:: * ;
1412use crate :: {
1513 error:: MultiSignatureError ,
16- schnorr_signatures:: helper:: { get_coordinates, is_on_curve , jubjub_base_to_scalar} ,
14+ schnorr_signatures:: helper:: { get_coordinates, jubjub_base_to_scalar} ,
1715} ;
1816
19- use crate :: schnorr_signatures:: { DST_SIGNATURE , JubjubHashToCurve , PoseidonHash , SignatureError } ;
17+ use crate :: schnorr_signatures:: { DST_SIGNATURE , JubjubHashToCurve , PoseidonHash } ;
2018
2119/// The signing key is a scalar from the Jubjub scalar field
2220#[ derive( Debug , Clone ) ]
@@ -34,13 +32,13 @@ impl SchnorrSigningKey {
3432 /// and the secret key as it is used for the lottery process
3533 pub fn sign ( & self , msg : JubjubBase , rng : & mut ( impl RngCore + CryptoRng ) ) -> SchnorrSignature {
3634 let g = JubjubSubgroup :: generator ( ) ;
37- let vk = & g * & self . 0 ;
35+ let vk = g * self . 0 ;
3836
3937 let hash = JubjubHashToCurve :: hash_to_curve ( & [ msg] ) ;
40- let sigma = & hash * & self . 0 ;
38+ let sigma = hash * self . 0 ;
4139 let r = JubjubScalar :: random ( rng) ;
42- let cap_r_1 = & hash * & r;
43- let cap_r_2 = & g * & r;
40+ let cap_r_1 = hash * r;
41+ let cap_r_2 = g * r;
4442
4543 let ( hx, hy) = get_coordinates ( hash) ;
4644 let ( vk_x, vk_y) = get_coordinates ( vk) ;
@@ -100,7 +98,7 @@ impl SchnorrSigningKey {
10098impl From < & SchnorrSigningKey > for SchnorrVerificationKey {
10199 fn from ( sk : & SchnorrSigningKey ) -> Self {
102100 let g = JubjubSubgroup :: generator ( ) ;
103- let vk = & g * & sk. 0 ;
101+ let vk = g * sk. 0 ;
104102 SchnorrVerificationKey ( vk)
105103 }
106104}
0 commit comments