Skip to content

Commit d7ab9f7

Browse files
committed
Documentation tweaks for common crypto helper
1 parent 96c05a1 commit d7ab9f7

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

mithril-common/src/crypto_helper/cardano/opcert.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub enum OpCertError {
2323
PoolAddressEncoding,
2424
}
2525

26-
/// Raw Fields of the operational certificates (without incluiding the cold VK)
26+
/// Raw Fields of the operational certificates (without including the cold VK)
2727
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)]
2828
struct RawFields(
2929
#[serde(with = "serde_bytes")] Vec<u8>,

mithril-common/src/crypto_helper/era.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ use thiserror::Error;
66

77
use super::ProtocolKey;
88

9-
/// Alias of [Ed25519:PublicKey](https://docs.rs/ed25519-dalek/latest/ed25519_dalek/struct.VerifyingKey.html).
9+
/// Wrapper of [Ed25519:PublicKey](https://docs.rs/ed25519-dalek/latest/ed25519_dalek/struct.VerifyingKey.html).
1010
pub type EraMarkersVerifierVerificationKey = ProtocolKey<ed25519_dalek::VerifyingKey>;
1111

12-
/// Alias of [Ed25519:SigningKey](https://docs.rs/ed25519-dalek/latest/ed25519_dalek/struct.SigningKey.html).
12+
/// Wrapper of [Ed25519:SigningKey](https://docs.rs/ed25519-dalek/latest/ed25519_dalek/struct.SigningKey.html).
1313
pub type EraMarkersVerifierSecretKey = ProtocolKey<ed25519_dalek::SigningKey>;
1414

15-
/// Alias of [Ed25519:Signature](https://docs.rs/ed25519-dalek/latest/ed25519_dalek/struct.Signature.html).
15+
/// Wrapper of [Ed25519:Signature](https://docs.rs/ed25519-dalek/latest/ed25519_dalek/struct.Signature.html).
1616
pub type EraMarkersVerifierSignature = ProtocolKey<ed25519_dalek::Signature>;
1717

1818
#[derive(Error, Debug)]
@@ -30,7 +30,7 @@ pub struct EraMarkersSigner {
3030
}
3131

3232
impl EraMarkersSigner {
33-
/// EraMarkersSigner factory
33+
/// [EraMarkersSigner] factory
3434
pub fn create_test_signer<R>(mut rng: R) -> Self
3535
where
3636
R: CryptoRng + RngCore,
@@ -39,29 +39,29 @@ impl EraMarkersSigner {
3939
Self::from_secret_key(secret_key.into())
4040
}
4141

42-
/// EraMarkersSigner deterministic
42+
/// [EraMarkersSigner] deterministic
4343
pub fn create_deterministic_signer() -> Self {
4444
let rng = ChaCha20Rng::from_seed([0u8; 32]);
4545
Self::create_test_signer(rng)
4646
}
4747

48-
/// EraMarkersSigner non deterministic
48+
/// [EraMarkersSigner] non deterministic
4949
pub fn create_non_deterministic_signer() -> Self {
5050
let rng = rand_core::OsRng;
5151
Self::create_test_signer(rng)
5252
}
5353

54-
/// EraMarkersSigner from EraMarkersVerifierSecretKey
54+
/// [EraMarkersSigner] from [EraMarkersVerifierSecretKey]
5555
pub fn from_secret_key(secret_key: EraMarkersVerifierSecretKey) -> Self {
5656
Self { secret_key }
5757
}
5858

59-
/// Create a EraMarkersVerifier
59+
/// Create a [EraMarkersVerifier]
6060
pub fn create_verifier(&self) -> EraMarkersVerifier {
6161
EraMarkersVerifier::from_verification_key(self.secret_key.verifying_key().into())
6262
}
6363

64-
/// Signs a message and returns a EraMarkersVerifierSignature
64+
/// Signs a message and returns a [EraMarkersVerifierSignature]
6565
pub fn sign(&self, message: &[u8]) -> EraMarkersVerifierSignature {
6666
self.secret_key.sign(message).into()
6767
}
@@ -74,12 +74,12 @@ pub struct EraMarkersVerifier {
7474
}
7575

7676
impl EraMarkersVerifier {
77-
/// EraMarkersVerifier from EraMarkersVerifierVerificationKey
77+
/// [EraMarkersVerifier] from [EraMarkersVerifierVerificationKey]
7878
pub fn from_verification_key(verification_key: EraMarkersVerifierVerificationKey) -> Self {
7979
Self { verification_key }
8080
}
8181

82-
/// EraMarkersVerifier to EraMarkersVerifierVerificationKey
82+
/// [EraMarkersVerifier] to [EraMarkersVerifierVerificationKey]
8383
pub fn to_verification_key(&self) -> EraMarkersVerifierVerificationKey {
8484
self.verification_key
8585
}

mithril-common/src/crypto_helper/genesis.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub struct ProtocolGenesisSigner {
2525
}
2626

2727
impl ProtocolGenesisSigner {
28-
/// ProtocolGenesisSigner factory
28+
/// [ProtocolGenesisSigner] factory
2929
pub fn create_test_genesis_signer<R>(mut rng: R) -> Self
3030
where
3131
R: CryptoRng + RngCore,
@@ -34,29 +34,29 @@ impl ProtocolGenesisSigner {
3434
Self::from_secret_key(secret_key.into())
3535
}
3636

37-
/// ProtocolGenesisSigner deterministic
37+
/// [ProtocolGenesisSigner] deterministic
3838
pub fn create_deterministic_genesis_signer() -> Self {
3939
let rng = ChaCha20Rng::from_seed([0u8; 32]);
4040
Self::create_test_genesis_signer(rng)
4141
}
4242

43-
/// ProtocolGenesisSigner non deterministic
43+
/// [ProtocolGenesisSigner] non deterministic
4444
pub fn create_non_deterministic_genesis_signer() -> Self {
4545
let rng = rand_core::OsRng;
4646
Self::create_test_genesis_signer(rng)
4747
}
4848

49-
/// ProtocolGenesisSigner from ProtocolGenesisSecretKey
49+
/// [ProtocolGenesisSigner] from [ProtocolGenesisSecretKey]
5050
pub fn from_secret_key(secret_key: ProtocolGenesisSecretKey) -> Self {
5151
Self { secret_key }
5252
}
5353

54-
/// Create a ProtocolGenesisVerifier
54+
/// Create a [ProtocolGenesisVerifier]
5555
pub fn create_genesis_verifier(&self) -> ProtocolGenesisVerifier {
5656
ProtocolGenesisVerifier::from_verification_key(self.secret_key.verifying_key().into())
5757
}
5858

59-
/// Signs a message and returns a ProtocolGenesisSignature
59+
/// Signs a message and returns a [ProtocolGenesisSignature]
6060
pub fn sign(&self, message: &[u8]) -> ProtocolGenesisSignature {
6161
self.secret_key.sign(message).into()
6262
}
@@ -79,12 +79,12 @@ pub struct ProtocolGenesisVerifier {
7979
}
8080

8181
impl ProtocolGenesisVerifier {
82-
/// ProtocolGenesisVerifier from ProtocolGenesisVerificationKey
82+
/// [ProtocolGenesisVerifier] from [ProtocolGenesisVerificationKey]
8383
pub fn from_verification_key(verification_key: ProtocolGenesisVerificationKey) -> Self {
8484
Self { verification_key }
8585
}
8686

87-
/// ProtocolGenesisVerifier to ProtocolGenesisVerificationKey
87+
/// [ProtocolGenesisVerifier] to [ProtocolGenesisVerificationKey]
8888
pub fn to_verification_key(&self) -> ProtocolGenesisVerificationKey {
8989
self.verification_key
9090
}

mithril-common/src/crypto_helper/types/wrappers.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ pub type ProtocolGenesisSignature = ProtocolKey<ed25519_dalek::Signature>;
2626
/// Wrapper of [OpCert] to add serialization utilities.
2727
pub type ProtocolOpCert = ProtocolKey<OpCert>;
2828

29-
/// Alias of [Ed25519:PublicKey](https://docs.rs/ed25519-dalek/latest/ed25519_dalek/struct.VerifyingKey.html).
29+
/// Wrapper of [Ed25519:PublicKey](https://docs.rs/ed25519-dalek/latest/ed25519_dalek/struct.VerifyingKey.html).
3030
pub type ProtocolGenesisVerificationKey = ProtocolKey<ed25519_dalek::VerifyingKey>;
3131

32-
/// Alias of [Ed25519:SigningKey](https://docs.rs/ed25519-dalek/latest/ed25519_dalek/struct.SigningKey.html).
32+
/// Wrapper of [Ed25519:SigningKey](https://docs.rs/ed25519-dalek/latest/ed25519_dalek/struct.SigningKey.html).
3333
pub type ProtocolGenesisSecretKey = ProtocolKey<ed25519_dalek::SigningKey>;
3434

35-
/// Alias of [MithrilStm:StmAggrVerificationKey](struct@mithril_stm::stm::StmAggrVerificationKey).
35+
/// Wrapper of [MithrilStm:StmAggrVerificationKey](struct@StmAggrVerificationKey).
3636
pub type ProtocolAggregateVerificationKey = ProtocolKey<StmAggrVerificationKey<D>>;
3737

3838
impl ProtocolGenesisSignature {

0 commit comments

Comments
 (0)