|
@@ -22,15 +22,16 @@ use zkp::CompactProof;
|
|
|
use zkp::ProofError;
|
|
|
use zkp::Transcript;
|
|
|
|
|
|
-use super::bridge_table;
|
|
|
-use super::cred;
|
|
|
-use super::dup_filter::SeenType;
|
|
|
-use super::{BridgeAuth, IssuerPubKey};
|
|
|
-use super::{CMZ_A, CMZ_A_TABLE, CMZ_B, CMZ_B_TABLE};
|
|
|
+use super::super::bridge_table;
|
|
|
+use super::super::cred;
|
|
|
+use super::super::dup_filter::SeenType;
|
|
|
+use super::super::OPENINV_LENGTH;
|
|
|
+use super::super::{BridgeAuth, BridgeDb, IssuerPubKey};
|
|
|
+use super::super::{CMZ_A, CMZ_A_TABLE, CMZ_B, CMZ_B_TABLE};
|
|
|
|
|
|
/// The request message for this protocol
|
|
|
pub struct Request {
|
|
|
- invite: [u8; super::OPENINV_LENGTH],
|
|
|
+ invite: [u8; OPENINV_LENGTH],
|
|
|
D: RistrettoPoint,
|
|
|
EncIdClient: (RistrettoPoint, RistrettoPoint),
|
|
|
piUserBlinding: CompactProof,
|
|
@@ -104,7 +105,7 @@ define_proof! {
|
|
|
|
|
|
/// Submit an open invitation issued by the BridgeDb to receive your
|
|
|
/// first Lox credential
|
|
|
-pub fn request(invite: &[u8; super::OPENINV_LENGTH]) -> (Request, State) {
|
|
|
+pub fn request(invite: &[u8; OPENINV_LENGTH]) -> (Request, State) {
|
|
|
let B: &RistrettoPoint = &CMZ_B;
|
|
|
let Btable: &RistrettoBasepointTable = &CMZ_B_TABLE;
|
|
|
|
|
@@ -159,11 +160,10 @@ impl BridgeAuth {
|
|
|
// Check the signature on the open_invite. We manually match
|
|
|
// here because we're changing the Err type from SignatureError
|
|
|
// to ProofError
|
|
|
- let (invite_id, bucket_id_u32) =
|
|
|
- match super::BridgeDb::verify(req.invite, self.bridgedb_pub) {
|
|
|
- Ok(res) => res,
|
|
|
- Err(_) => return Err(ProofError::VerificationFailure),
|
|
|
- };
|
|
|
+ let (invite_id, bucket_id_u32) = match BridgeDb::verify(req.invite, self.bridgedb_pub) {
|
|
|
+ Ok(res) => res,
|
|
|
+ Err(_) => return Err(ProofError::VerificationFailure),
|
|
|
+ };
|
|
|
let bucket_id: usize = bucket_id_u32 as usize;
|
|
|
|
|
|
// Only proceed if the invite_id is fresh
|