Add documentation to secret keys pointing to SerdeSecret

master
Sebastian Geisler 6 years ago
parent ce1c30f9b4
commit 7a077846c9
  1. 10
      src/lib.rs

@ -254,6 +254,11 @@ impl SignatureShare {
/// A secret key; wraps a single prime field element. The field element is /// A secret key; wraps a single prime field element. The field element is
/// heap allocated to avoid any stack copying that result when passing /// heap allocated to avoid any stack copying that result when passing
/// `SecretKey`s between stack frames. /// `SecretKey`s between stack frames.
///
/// # Serde integration
/// `SecretKey` implements `Deserialize` but not `Serialize` to avoid accidental
/// serialization in insecure contexts. To enable both use the `::serde_impl::SerdeSecret`
/// wrapper which implements both `Deserialize` and `Serialize`.
#[derive(PartialEq, Eq)] #[derive(PartialEq, Eq)]
pub struct SecretKey(Box<Fr>); pub struct SecretKey(Box<Fr>);
@ -364,6 +369,11 @@ impl SecretKey {
} }
/// A secret key share. /// A secret key share.
///
/// # Serde integration
/// `SecretKeyShare` implements `Deserialize` but not `Serialize` to avoid accidental
/// serialization in insecure contexts. To enable both use the `::serde_impl::SerdeSecret`
/// wrapper which implements both `Deserialize` and `Serialize`.
#[derive(Clone, PartialEq, Eq, Default)] #[derive(Clone, PartialEq, Eq, Default)]
pub struct SecretKeyShare(SecretKey); pub struct SecretKeyShare(SecretKey);

Loading…
Cancel
Save