Leave a comment explaining why we derive Default.

This commit is contained in:
Isis Lovecruft 2018-07-26 20:15:13 +00:00
parent 6513d4980a
commit 81a3d3298b
Failed to extract signature

View file

@ -168,7 +168,7 @@ impl<'d> Deserialize<'d> for Signature {
/// An EdDSA secret key. /// An EdDSA secret key.
#[repr(C)] #[repr(C)]
#[derive(Default)] #[derive(Default)] // we derive Default in order to use the clear() method in Drop
pub struct SecretKey(pub (crate) [u8; SECRET_KEY_LENGTH]); pub struct SecretKey(pub (crate) [u8; SECRET_KEY_LENGTH]);
impl Debug for SecretKey { impl Debug for SecretKey {
@ -381,7 +381,7 @@ impl<'d> Deserialize<'d> for SecretKey {
// better-designed, Schnorr-based signature scheme, see Trevor Perrin's work on // better-designed, Schnorr-based signature scheme, see Trevor Perrin's work on
// "generalised EdDSA" and "VXEdDSA". // "generalised EdDSA" and "VXEdDSA".
#[repr(C)] #[repr(C)]
#[derive(Default)] #[derive(Default)] // we derive Default in order to use the clear() method in Drop
pub struct ExpandedSecretKey { pub struct ExpandedSecretKey {
pub (crate) key: Scalar, pub (crate) key: Scalar,
pub (crate) nonce: [u8; 32], pub (crate) nonce: [u8; 32],
@ -914,7 +914,7 @@ impl<'d> Deserialize<'d> for PublicKey {
} }
/// An ed25519 keypair. /// An ed25519 keypair.
#[derive(Debug, Default)] #[derive(Debug, Default)] // we derive Default in order to use the clear() method in Drop
#[repr(C)] #[repr(C)]
pub struct Keypair { pub struct Keypair {
/// The secret half of this keypair. /// The secret half of this keypair.