Orchard: tidy

This commit is contained in:
Deirdre Connolly 2021-03-14 05:56:38 -04:00 committed by Deirdre Connolly
parent d3f0b226e6
commit e85359c756
2 changed files with 7 additions and 1 deletions

View File

@ -143,6 +143,12 @@ impl From<[u8; 32]> for SpendingKey {
}
}
impl From<SpendingKey> for [u8; 32] {
fn from(sk: SpendingKey) -> Self {
sk.bytes
}
}
impl fmt::Display for SpendingKey {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let hrp = match self.network {

View File

@ -87,7 +87,7 @@ pub fn sinsemilla_hash_to_point(D: &[u8], M: &BitVec<Lsb0, u8>) -> pallas::Point
.for_each(|(i, bit)| bits.set(i, *bit));
// An instance of LEBS2IP_k
let j = &bits.iter().fold(0u16, |j, &bit| j * *2 + bit as u16);
let j = &bits.iter().fold(0u16, |j, &bit| j * 2 + bit as u16);
acc += acc + S(j.to_le_bytes());
}