diff --git a/lib/tools/crypto/src/keys/bin_signable.rs b/lib/tools/crypto/src/keys/bin_signable.rs index 0e74c553b90fa72a86ccd527654f3f5d8d3d65d6..79d2a02f30292ced17c3e1a960c77b46efff2e18 100644 --- a/lib/tools/crypto/src/keys/bin_signable.rs +++ b/lib/tools/crypto/src/keys/bin_signable.rs @@ -22,19 +22,19 @@ use serde::{Deserialize, Serialize}; /// Signatureable in binary format pub trait BinSignable<'de>: Serialize + Deserialize<'de> { - /// Return message issuer pubkey + /// Return entity issuer pubkey fn issuer_pubkey(&self) -> PubKey; - /// Return true if message store is hash + /// Return true if entity store is hash fn store_hash(&self) -> bool { false } - /// Return message hash + /// Return entity hash fn hash(&self) -> Option<Hash> { None } - /// Change hash (redefinely by messages with hash field) + /// Change hash (redefinely by entities with hash field) fn set_hash(&mut self, _hash: Hash) {} - /// Return message signature + /// Return signature fn signature(&self) -> Option<Sig>; /// Change signature fn set_signature(&mut self, _signature: Sig); @@ -57,7 +57,7 @@ pub trait BinSignable<'de>: Serialize + Deserialize<'de> { let hash = Hash::compute(&bin_msg); Ok((hash, bin_msg)) } - /// Sign bin message + /// Sign entity with a private key fn sign(&mut self, priv_key: PrivKey) -> Result<Vec<u8>, SignError> { if self.signature().is_some() { return Err(SignError::AlreadySign()); @@ -92,7 +92,7 @@ pub trait BinSignable<'de>: Serialize + Deserialize<'de> { _ => Err(SignError::WrongAlgo()), } } - /// Check signature of bin message + /// Check signature of entity fn verify(&self) -> Result<(), SigError> { if let Some(signature) = self.signature() { match self.issuer_pubkey() { diff --git a/lib/tools/crypto/src/keys/mod.rs b/lib/tools/crypto/src/keys/mod.rs index 9a660fec16dbedb48bcf5278c1263455bfadcfb5..5f9c9ba91f7e67aff8debd4a7c06db2b62f96784 100644 --- a/lib/tools/crypto/src/keys/mod.rs +++ b/lib/tools/crypto/src/keys/mod.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2018 The Duniter Project Developers. +// Copyright (C) 2018 The Durs Project Developers. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as diff --git a/lib/tools/crypto/src/keys/text_signable.rs b/lib/tools/crypto/src/keys/text_signable.rs index 43c02f062a63a9c65c10ad028dafd0cd597aa17e..6d27da100a8f6c0d62e8e1324d0f5533d5b40b87 100644 --- a/lib/tools/crypto/src/keys/text_signable.rs +++ b/lib/tools/crypto/src/keys/text_signable.rs @@ -21,13 +21,13 @@ use super::*; pub trait TextSignable: Debug + Clone { /// Return signable text fn as_signable_text(&self) -> String; - /// Return message issuer pubkey + /// Return entity issuer pubkey fn issuer_pubkey(&self) -> PubKey; - /// Return message signature + /// Return entity signature fn signature(&self) -> Option<Sig>; /// Change signature fn set_signature(&mut self, _signature: Sig); - /// Sign text message + /// Sign entity fn sign(&mut self, priv_key: PrivKey) -> Result<String, SignError> { if self.signature().is_some() { return Err(SignError::AlreadySign()); @@ -46,7 +46,7 @@ pub trait TextSignable: Debug + Clone { _ => Err(SignError::WrongAlgo()), } } - /// Check signature of text message + /// Check signature of entity fn verify(&self) -> Result<(), SigError> { if let Some(signature) = self.signature() { match self.issuer_pubkey() {