From 83c41869e160d7632bb5164775b6bd840fc9c6be Mon Sep 17 00:00:00 2001 From: Deirdre Connolly Date: Sun, 26 Jul 2020 13:34:58 -0400 Subject: [PATCH] Improve docs --- zebra-chain/src/notes.rs | 2 +- zebra-chain/src/notes/sapling.rs | 2 +- zebra-chain/src/notes/sapling/commitments.rs | 10 ++++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/zebra-chain/src/notes.rs b/zebra-chain/src/notes.rs index 9ba290897..319a1cb3a 100644 --- a/zebra-chain/src/notes.rs +++ b/zebra-chain/src/notes.rs @@ -1,4 +1,4 @@ -//! Note encryption types. +//! Notes, note and value commitments, note encryption, and nullifier types. mod memo; diff --git a/zebra-chain/src/notes/sapling.rs b/zebra-chain/src/notes/sapling.rs index 180dcb8b8..1189ca235 100644 --- a/zebra-chain/src/notes/sapling.rs +++ b/zebra-chain/src/notes/sapling.rs @@ -1,4 +1,4 @@ -//! Sprout notes +//! Sapling notes #![allow(clippy::unit_arg)] #![allow(dead_code)] diff --git a/zebra-chain/src/notes/sapling/commitments.rs b/zebra-chain/src/notes/sapling/commitments.rs index e69f5bce7..afe551a3f 100644 --- a/zebra-chain/src/notes/sapling/commitments.rs +++ b/zebra-chain/src/notes/sapling/commitments.rs @@ -16,6 +16,16 @@ use crate::{ // exported. type Scalar = jubjub::Fr; +/// "...an algebraic hash function with collision resistance (for +/// fixed input length) derived from assumed hardness of the Discrete +/// Logarithm Problem on the Jubjub curve." +/// +/// PedersenHash is used in the definitions of Pedersen commitments (§ +/// 5.4.7.2‘Windowed Pedersen commitments’), and of the Pedersen hash +/// for the Sapling incremental Merkle tree (§ +/// 5.4.1.3 ‘MerkleCRH^Sapling Hash Function’). +/// +/// https://zips.z.cash/protocol/protocol.pdf#concretepedersenhash #[allow(non_snake_case)] pub fn pedersen_hash_to_point(domain: [u8; 8], M: &BitVec) -> jubjub::ExtendedPoint { // Expects i to be 0-indexed