Merge pull request #202 from nuttycom/trivial_cleanup

Minor cleanup addressing issues found while performing review for zcash/zcash#5024
This commit is contained in:
Daira Hopwood 2022-04-15 05:25:20 +01:00 committed by GitHub
commit a1aa5bb12e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

View File

@ -33,7 +33,7 @@ const ZIP32_PURPOSE: u32 = 32;
/// A spending key, from which all key material is derived. /// A spending key, from which all key material is derived.
/// ///
/// Defined in [Zcash Protocol Spec § 4.2.3: Orchard Key Components][orchardkeycomponents]. /// $\mathsf{sk}$ as defined in [Zcash Protocol Spec § 4.2.3: Orchard Key Components][orchardkeycomponents].
/// ///
/// [orchardkeycomponents]: https://zips.z.cash/protocol/nu5.pdf#orchardkeycomponents /// [orchardkeycomponents]: https://zips.z.cash/protocol/nu5.pdf#orchardkeycomponents
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
@ -107,7 +107,7 @@ impl SpendingKey {
/// A spend authorizing key, used to create spend authorization signatures. /// A spend authorizing key, used to create spend authorization signatures.
/// This type enforces that the corresponding public point (ak^) has ỹ = 0. /// This type enforces that the corresponding public point (ak^) has ỹ = 0.
/// ///
/// Defined in [Zcash Protocol Spec § 4.2.3: Orchard Key Components][orchardkeycomponents]. /// $\mathsf{ask}$ as defined in [Zcash Protocol Spec § 4.2.3: Orchard Key Components][orchardkeycomponents].
/// ///
/// [orchardkeycomponents]: https://zips.z.cash/protocol/nu5.pdf#orchardkeycomponents /// [orchardkeycomponents]: https://zips.z.cash/protocol/nu5.pdf#orchardkeycomponents
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
@ -207,7 +207,7 @@ impl SpendValidatingKey {
/// A key used to derive [`Nullifier`]s from [`Note`]s. /// A key used to derive [`Nullifier`]s from [`Note`]s.
/// ///
/// Defined in [Zcash Protocol Spec § 4.2.3: Orchard Key Components][orchardkeycomponents]. /// $\mathsf{nk}$ as defined in [Zcash Protocol Spec § 4.2.3: Orchard Key Components][orchardkeycomponents].
/// ///
/// [`Nullifier`]: crate::note::Nullifier /// [`Nullifier`]: crate::note::Nullifier
/// [`Note`]: crate::note::Note /// [`Note`]: crate::note::Note
@ -250,7 +250,7 @@ impl NullifierDerivingKey {
/// The randomness for $\mathsf{Commit}^\mathsf{ivk}$. /// The randomness for $\mathsf{Commit}^\mathsf{ivk}$.
/// ///
/// Defined in [Zcash Protocol Spec § 4.2.3: Orchard Key Components][orchardkeycomponents]. /// $\mashsf{rivk}$ as defined in [Zcash Protocol Spec § 4.2.3: Orchard Key Components][orchardkeycomponents].
/// ///
/// [orchardkeycomponents]: https://zips.z.cash/protocol/nu5.pdf#orchardkeycomponents /// [orchardkeycomponents]: https://zips.z.cash/protocol/nu5.pdf#orchardkeycomponents
#[derive(Copy, Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] #[derive(Copy, Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
@ -479,7 +479,7 @@ impl FullViewingKey {
/// A key that provides the capability to derive a sequence of diversifiers. /// A key that provides the capability to derive a sequence of diversifiers.
/// ///
/// Defined in [Zcash Protocol Spec § 4.2.3: Orchard Key Components][orchardkeycomponents]. /// $\mathsf{dk}$ as defined in [Zcash Protocol Spec § 4.2.3: Orchard Key Components][orchardkeycomponents].
/// ///
/// [orchardkeycomponents]: https://zips.z.cash/protocol/nu5.pdf#orchardkeycomponents /// [orchardkeycomponents]: https://zips.z.cash/protocol/nu5.pdf#orchardkeycomponents
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
@ -550,7 +550,7 @@ impl DiversifierKey {
/// A diversifier that can be used to derive a specific [`Address`] from a /// A diversifier that can be used to derive a specific [`Address`] from a
/// [`FullViewingKey`] or [`IncomingViewingKey`]. /// [`FullViewingKey`] or [`IncomingViewingKey`].
/// ///
/// Defined in [Zcash Protocol Spec § 4.2.3: Orchard Key Components][orchardkeycomponents]. /// $\mathsf{d}$ as defined in [Zcash Protocol Spec § 4.2.3: Orchard Key Components][orchardkeycomponents].
/// ///
/// [orchardkeycomponents]: https://zips.z.cash/protocol/nu5.pdf#orchardkeycomponents /// [orchardkeycomponents]: https://zips.z.cash/protocol/nu5.pdf#orchardkeycomponents
#[derive(Clone, Copy, Debug, PartialEq, Eq)] #[derive(Clone, Copy, Debug, PartialEq, Eq)]
@ -777,6 +777,7 @@ impl DiversifiedTransmissionKey {
} }
} }
// Required for CtOption operations.
impl Default for DiversifiedTransmissionKey { impl Default for DiversifiedTransmissionKey {
fn default() -> Self { fn default() -> Self {
DiversifiedTransmissionKey(NonIdentityPallasPoint::default()) DiversifiedTransmissionKey(NonIdentityPallasPoint::default())

View File

@ -39,7 +39,8 @@ lazy_static! {
}; };
} }
/// The root of an Orchard commitment tree. /// The root of an Orchard commitment tree. This must be a value
/// in the range {0..=q_-1}
#[derive(Eq, PartialEq, Clone, Copy, Debug)] #[derive(Eq, PartialEq, Clone, Copy, Debug)]
pub struct Anchor(pallas::Base); pub struct Anchor(pallas::Base);