Merge pull request #351 from jarys/pub-value-commit-derive

Publicize `ValueCommitment::derive` constructor
This commit is contained in:
Daira Hopwood 2022-10-18 20:19:19 +01:00 committed by GitHub
commit 591c4b89b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -288,13 +288,13 @@ impl<'a> Sum<&'a ValueCommitment> for ValueCommitment {
}
impl ValueCommitment {
/// $ValueCommit^Orchard$.
/// Derives a `ValueCommitment` by $\mathsf{ValueCommit^{Orchard}}$.
///
/// Defined in [Zcash Protocol Spec § 5.4.8.3: Homomorphic Pedersen commitments (Sapling and Orchard)][concretehomomorphiccommit].
///
/// [concretehomomorphiccommit]: https://zips.z.cash/protocol/nu5.pdf#concretehomomorphiccommit
#[allow(non_snake_case)]
pub(crate) fn derive(value: ValueSum, rcv: ValueCommitTrapdoor) -> Self {
pub fn derive(value: ValueSum, rcv: ValueCommitTrapdoor) -> Self {
let hasher = pallas::Point::hash_to_curve(VALUE_COMMITMENT_PERSONALIZATION);
let V = hasher(&VALUE_COMMITMENT_V_BYTES);
let R = hasher(&VALUE_COMMITMENT_R_BYTES);