From af68c8818dd3ab252eb80296e6a492a45f03146b Mon Sep 17 00:00:00 2001 From: Vecna Date: Mon, 26 Feb 2024 17:37:56 -0500 Subject: [PATCH] Have LA recompute H rather than accepting it from user --- crates/lox-library/src/proto/positive_report.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/crates/lox-library/src/proto/positive_report.rs b/crates/lox-library/src/proto/positive_report.rs index 26b31d5..6e36b09 100644 --- a/crates/lox-library/src/proto/positive_report.rs +++ b/crates/lox-library/src/proto/positive_report.rs @@ -44,7 +44,7 @@ pub struct Request { CQ: RistrettoPoint, // Fields for proving which bucket we have - pub H: RistrettoPoint, + pub date: u32, // date is used to compute H pub BP: RistrettoPoint, // Fields for proving 3 <= trust_level <= 4 @@ -86,13 +86,13 @@ pub fn request(lox_cred: &cred::Lox, lox_pub: &IssuerPubKey) -> Result( - format!("PR Generator H for {}", today).as_bytes(), + format!("PR Generator H for {}", date).as_bytes(), ); let Htable: RistrettoBasepointTable = RistrettoBasepointTable::create(&H); @@ -223,7 +223,7 @@ pub fn request(lox_cred: &cred::Lox, lox_pub: &IssuerPubKey) -> Result Result<(), ProofError> { let A: &RistrettoPoint = &CMZ_A; + let H: RistrettoPoint = RistrettoPoint::hash_from_bytes::( + format!("PR Generator H for {}", req.date).as_bytes(), + ); - if req.P.is_identity() || req.H.is_identity() { + if req.P.is_identity() { return Err(ProofError::VerificationFailure); } @@ -275,7 +278,7 @@ impl BridgeAuth { Xsince: &self.lox_pub.X[4].compress(), Xinvremain: &self.lox_pub.X[5].compress(), Xblockages: &self.lox_pub.X[6].compress(), - H: &req.H.compress(), + H: &H.compress(), BP: &req.BP.compress(), CG: &CG.compress(), CGsq: &req.CGsq.compress(),