@@ -6,8 +6,10 @@ use crate::crypto_helper::ProtocolPartyId;
6
6
7
7
use bech32:: { self , ToBase32 , Variant } ;
8
8
use blake2:: { digest:: consts:: U28 , Blake2b , Digest } ;
9
- use ed25519_dalek:: { Signature as EdSignature , Verifier , VerifyingKey as EdPublicKey } ;
10
- use ed25519_dalek:: { Signer , SigningKey as EdKeypair } ;
9
+ use ed25519_dalek:: {
10
+ Signature as EdSignature , Signer , SigningKey as EdSecretKey , Verifier ,
11
+ VerifyingKey as EdVerificationKey ,
12
+ } ;
11
13
use kes_summed_ed25519:: PublicKey as KesPublicKey ;
12
14
use nom:: AsBytes ;
13
15
use serde:: de:: Error ;
@@ -34,7 +36,7 @@ struct RawFields(
34
36
35
37
/// Raw Operational Certificate
36
38
#[ derive( Clone , Debug , Deserialize , PartialEq , Eq , Serialize ) ]
37
- struct RawOpCert ( RawFields , EdPublicKey ) ;
39
+ struct RawOpCert ( RawFields , EdVerificationKey ) ;
38
40
39
41
/// Parsed Operational Certificate
40
42
#[ derive( Clone , Debug , PartialEq , Eq ) ]
@@ -44,7 +46,7 @@ pub struct OpCert {
44
46
/// KES period at which KES key is initalized
45
47
pub start_kes_period : u64 ,
46
48
pub ( crate ) cert_sig : EdSignature ,
47
- pub ( crate ) cold_vk : EdPublicKey ,
49
+ pub ( crate ) cold_vk : EdVerificationKey ,
48
50
}
49
51
50
52
impl SerDeShelleyFileFormat for OpCert {
@@ -58,14 +60,15 @@ impl OpCert {
58
60
kes_vk : KesPublicKey ,
59
61
issue_number : u64 ,
60
62
start_kes_period : u64 ,
61
- cold_keypair : EdKeypair ,
63
+ cold_secret_key : EdSecretKey ,
62
64
) -> Self {
63
- let cold_vk: EdPublicKey = cold_keypair . verifying_key ( ) ;
64
- let cert_sig = cold_keypair . sign ( & Self :: compute_message_to_sign (
65
+ let cold_vk: EdVerificationKey = cold_secret_key . verifying_key ( ) ;
66
+ let cert_sig = cold_secret_key . sign ( & Self :: compute_message_to_sign (
65
67
& kes_vk,
66
68
issue_number,
67
69
start_kes_period,
68
70
) ) ;
71
+
69
72
Self {
70
73
kes_vk,
71
74
issue_number,
0 commit comments