diff --git a/src/bridge_info.rs b/src/bridge_verification_info.rs similarity index 64% rename from src/bridge_info.rs rename to src/bridge_verification_info.rs index 84f6e7a..8337303 100644 --- a/src/bridge_info.rs +++ b/src/bridge_verification_info.rs @@ -4,11 +4,9 @@ use lox_library::bridge_table::BridgeLine; use serde::{Deserialize, Serialize}; use std::collections::HashSet; -// TODO: Rename this. We already have a different BridgeInfo in lib.rs. - /// Information that needs to be known to verify a Troll Patrol report #[derive(Debug, Serialize, Deserialize)] -pub struct BridgeInfo { +pub struct BridgeVerificationInfo { /// BridgeLine for this bridge pub bridge_line: BridgeLine, @@ -18,13 +16,3 @@ pub struct BridgeInfo { /// Key used to verify bridge tokens pub pubkey: Option, } - -impl BridgeInfo { - pub fn new(bl: BridgeLine) -> Self { - BridgeInfo { - bridge_line: bl, - buckets: HashSet::::new(), - pubkey: None, - } - } -} diff --git a/src/lib.rs b/src/lib.rs index e7a7565..645671b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,7 +8,7 @@ use std::{ io::BufReader, }; -pub mod bridge_info; +pub mod bridge_verification_info; pub mod extra_info; pub mod negative_report; pub mod positive_report; diff --git a/src/negative_report.rs b/src/negative_report.rs index 15d65ef..95d8095 100644 --- a/src/negative_report.rs +++ b/src/negative_report.rs @@ -1,4 +1,6 @@ -use crate::{bridge_info::BridgeInfo, get_date, BridgeDistributor, COUNTRY_CODES}; +use crate::{ + bridge_verification_info::BridgeVerificationInfo, get_date, BridgeDistributor, COUNTRY_CODES, +}; use curve25519_dalek::scalar::Scalar; use lox_library::{bridge_table::BridgeLine, cred::Lox}; @@ -101,7 +103,7 @@ impl NegativeReport { } /// Verify the report - pub fn verify(self, bridge_info: &BridgeInfo) -> bool { + pub fn verify(self, bridge_info: &BridgeVerificationInfo) -> bool { match self.bridge_pok { ProofOfBridgeKnowledge::HashOfBridgeLine(pok) => { let hash = HashOfBridgeLine::new(&bridge_info.bridge_line); diff --git a/src/positive_report.rs b/src/positive_report.rs index 2cc01c8..3f2e4a2 100644 --- a/src/positive_report.rs +++ b/src/positive_report.rs @@ -1,7 +1,7 @@ // For Lox-related code where points are uppercase and scalars are lowercase #![allow(non_snake_case)] -use crate::{bridge_info::BridgeInfo, get_date, CONFIG, COUNTRY_CODES}; +use crate::{bridge_verification_info::BridgeVerificationInfo, get_date, CONFIG, COUNTRY_CODES}; use curve25519_dalek::ristretto::RistrettoBasepointTable; use ed25519_dalek::{Signature, Signer, SigningKey, Verifier}; @@ -106,7 +106,7 @@ impl PositiveReport { pub fn verify( self, la: &mut BridgeAuth, - bridge_info: &BridgeInfo, + bridge_info: &BridgeVerificationInfo, Htable: &RistrettoBasepointTable, ) -> bool { // Verify bridge token