From 2c69abe268e65034da183fc2b46b5be47c13f542 Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Fri, 9 Mar 2018 14:17:45 -0700 Subject: [PATCH] Add Uncommitted^Sapling. --- src/primitives/mod.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/primitives/mod.rs b/src/primitives/mod.rs index 6ac1040..2ac43b1 100644 --- a/src/primitives/mod.rs +++ b/src/primitives/mod.rs @@ -1,4 +1,5 @@ use pairing::{ + Field, PrimeField, PrimeFieldRepr }; @@ -165,6 +166,15 @@ pub struct Note { } impl Note { + pub fn uncommitted() -> E::Fr { + // The smallest u-coordinate that is not on the curve + // is one. + // TODO: This should be relocated to JubjubEngine as + // it's specific to the curve we're using, not all + // twisted edwards curves. + E::Fr::one() + } + /// Computes the note commitment, returning the full point. fn cm_full_point(&self, params: &E::Params) -> edwards::Point {