From 2a7838d8e529a1ebfd53745458fb761289736fe3 Mon Sep 17 00:00:00 2001 From: Deirdre Connolly Date: Sat, 28 Mar 2020 02:01:10 -0400 Subject: [PATCH] Clear up doc comments on SpendingKey --- zebra-chain/src/keys/sprout.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/zebra-chain/src/keys/sprout.rs b/zebra-chain/src/keys/sprout.rs index 48f1af48..248f8e24 100644 --- a/zebra-chain/src/keys/sprout.rs +++ b/zebra-chain/src/keys/sprout.rs @@ -26,8 +26,8 @@ use sha2; pub struct SpendingKey(pub [u8; 32]); impl SpendingKey { - /// Generate a new _SpendingKey_ with the highest 4 bits set to - /// zero (ie, 256 random bits, clamped to 252). + /// Generate a new _SpendingKey_ with the high 4 bits of the first + /// byte set to zero (ie, 256 random bits, clamped to 252). pub fn new(csprng: &mut T) -> Self where T: RngCore + CryptoRng, @@ -40,8 +40,9 @@ impl SpendingKey { } impl From<[u8; 32]> for SpendingKey { - /// Generate a _SpendingKey_ from existing bytes, with the highest - /// 4 bits set to zero (ie, 256 bits clamped to 252). + /// Generate a _SpendingKey_ from existing bytes, with the high 4 + /// bits of the first byte set to zero (ie, 256 bits clamped to + /// 252). fn from(mut bytes: [u8; 32]) -> SpendingKey { bytes[0] &= 0b0000_1111; // Force the 4 high-order bits to zero. SpendingKey(bytes)