Skip to content

Commit

Permalink
Renamings
Browse files Browse the repository at this point in the history
Signed-off-by: lovesh <[email protected]>
  • Loading branch information
lovesh committed Jul 2, 2024
1 parent b3d5405 commit 5eeffde
Show file tree
Hide file tree
Showing 21 changed files with 92 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ impl<G: AffineRepr> ProofOfInvalidityOfKeyedProof<G> {
#[cfg(test)]
mod tests {
use super::*;
use crate::bddt_2016::setup::{MACParams, PublicKey, SecretKey};
use crate::bbdt_2016::setup::{MACParams, PublicKey, SecretKey};
use ark_bls12_381::{Bls12_381, G1Affine};
use ark_ec::CurveGroup;
use ark_ff::Field;
Expand Down
2 changes: 1 addition & 1 deletion kvac/src/bddt_2016/mac.rs → kvac/src/bbdt_2016/mac.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! MAC_BB - A MAC based on Boneh-Boyen Signatures. Follows section 3.2 of the paper
use crate::{
bddt_2016::setup::{MACParams, PublicKey, SecretKey},
bbdt_2016::setup::{MACParams, PublicKey, SecretKey},
error::KVACError,
};
use ark_ec::{AffineRepr, CurveGroup};
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Protocol to prove knowledge of the MAC. This is the "Show" protocol described in Fig.2 (2) in the paper
use crate::{
bddt_2016::{
bbdt_2016::{
keyed_proof::KeyedProof,
mac::MAC,
setup::{MACParams, SecretKey},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//! 5. Verifier uses the secret key `y` to check `C = B_0 * y` and the proofs of knowledge.
use crate::{
bddt_2016::{
bbdt_2016::{
keyed_proof::KeyedProof,
mac::MAC,
setup::{MACParams, SecretKey},
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion kvac/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
//! (eg. to get paid by the verifier) while still not harming the user's privacy as it doesn't learn any revealed attributes. The first
//! verifier, i.e. the issuer can also provide a proof of validity or invalidity to the second verifier.
pub mod bddt_2016;
pub mod bbdt_2016;
pub mod cddh_2019;
pub mod error;
2 changes: 1 addition & 1 deletion proof_system/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ pub const KB_UNI_ACCUM_CDH_NON_MEM_LABEL: &'static [u8; 43] =
pub const KB_POS_ACCUM_MEM_LABEL: &'static [u8; 34] = b"KB-positive-accumulator-membership";
pub const KB_POS_ACCUM_CDH_MEM_LABEL: &'static [u8; 38] = b"KB-positive-accumulator-CDH-membership";

pub const BDDT16_KVAC_LABEL: &'static [u8; 14] = b"BDDT-2016-KVAC";
pub const BBDT16_KVAC_LABEL: &'static [u8; 14] = b"BDDT-2016-KVAC";
4 changes: 2 additions & 2 deletions proof_system/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ pub enum ProofSystemError {
IncorrectEncryptedAccumulator,
KBAccumProofContributionFailed(u32, VBAccumulatorError),
KVACError(KVACError),
BDDT16KVACProtocolInvalidMessageCount(usize, usize),
BDDT16KVACProofContributionFailed(u32, KVACError),
BBDT16KVACProtocolInvalidMessageCount(usize, usize),
BBDT16KVACProofContributionFailed(u32, KVACError),
}

impl From<SchnorrError> for ProofSystemError {
Expand Down
14 changes: 7 additions & 7 deletions proof_system/src/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use legogroth16::aggregation::srs::PreparedProverSRS;

use crate::{
constants::{
BBS_23_LABEL, BBS_PLUS_LABEL, BDDT16_KVAC_LABEL, COMPOSITE_PROOF_CHALLENGE_LABEL,
BBS_23_LABEL, BBS_PLUS_LABEL, BBDT16_KVAC_LABEL, COMPOSITE_PROOF_CHALLENGE_LABEL,
COMPOSITE_PROOF_LABEL, CONTEXT_LABEL, KB_POS_ACCUM_CDH_MEM_LABEL, KB_POS_ACCUM_MEM_LABEL,
KB_UNI_ACCUM_CDH_MEM_LABEL, KB_UNI_ACCUM_CDH_NON_MEM_LABEL, KB_UNI_ACCUM_MEM_LABEL,
KB_UNI_ACCUM_NON_MEM_LABEL, NONCE_LABEL, PS_LABEL, VB_ACCUM_CDH_MEM_LABEL,
Expand Down Expand Up @@ -51,7 +51,7 @@ use crate::{
bbs_23::PoKBBSSigG1SubProtocol,
bbs_23_ietf::PoKBBSSigIETFG1SubProtocol,
bbs_plus::PoKBBSSigG1SubProtocol as PoKBBSPlusSigG1SubProtocol,
bddt16_kvac::PoKOfMACSubProtocol,
bbdt16_kvac::PoKOfMACSubProtocol,
bound_check_bpp::BoundCheckBppProtocol,
bound_check_legogroth16::BoundCheckLegoGrothProtocol,
bound_check_smc::BoundCheckSmcProtocol,
Expand Down Expand Up @@ -708,16 +708,16 @@ impl<E: Pairing> Proof<E> {
}
_ => err_incompat_witness!(s_idx, s, witness),
},
Statement::PoKBDDT16MAC(s) => match witness {
Witness::PoKOfBDDT16MAC(w) => {
Statement::PoKBBDT16MAC(s) => match witness {
Witness::PoKOfBBDT16MAC(w) => {
sig_protocol_init!(
s,
s_idx,
w,
PoKOfMACSubProtocol,
new,
PoKOfBDDT16MAC,
BDDT16_KVAC_LABEL
PoKOfBBDT16MAC,
BBDT16_KVAC_LABEL
);
}
_ => err_incompat_witness!(s_idx, s, witness),
Expand Down Expand Up @@ -843,7 +843,7 @@ impl<E: Pairing> Proof<E> {
SubProtocol::KBPositiveAccumulatorMembershipCDH(mut sp) => {
sp.gen_proof_contribution(&challenge)?
}
SubProtocol::PoKOfBDDT16MAC(mut sp) => sp.gen_proof_contribution(&challenge)?,
SubProtocol::PoKOfBBDT16MAC(mut sp) => sp.gen_proof_contribution(&challenge)?,
SubProtocol::VBAccumulatorMembershipKV(mut sp) => {
sp.gen_proof_contribution(&challenge)?
}
Expand Down
8 changes: 4 additions & 4 deletions proof_system/src/setup_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use bbs_plus::prelude::{
};
use bulletproofs_plus_plus::setup::SetupParams as BppSetupParams;
use dock_crypto_utils::{commitment::PedersenCommitmentKey, serde_utils::ArkObjectBytes};
use kvac::bddt_2016::setup::MACParams;
use kvac::bbdt_2016::setup::MACParams;
use legogroth16::{
circom::R1CS,
data_structures::{ProvingKey as LegoSnarkProvingKey, VerifyingKey as LegoSnarkVerifyingKey},
Expand Down Expand Up @@ -71,7 +71,7 @@ pub enum SetupParams<E: Pairing> {
BBSigProvingKey(ProvingKey<E::G1Affine>),
KBPositiveAccumulatorParams(KBAccumParams<E>),
KBPositiveAccumulatorPublicKey(KBAccumPublicKey<E>),
BDDT16MACParams(MACParams<E::G1Affine>),
BBDT16MACParams(MACParams<E::G1Affine>),
PedersenCommitmentKeyG2(#[serde_as(as = "Vec<ArkObjectBytes>")] Vec<E::G2Affine>),
CommitmentKeyG2(#[serde_as(as = "ArkObjectBytes")] PedersenCommitmentKey<E::G2Affine>),
}
Expand Down Expand Up @@ -107,7 +107,7 @@ macro_rules! delegate {
BBSigProvingKey,
KBPositiveAccumulatorParams,
KBPositiveAccumulatorPublicKey,
BDDT16MACParams,
BBDT16MACParams,
PedersenCommitmentKeyG2,
CommitmentKeyG2
: $($tt)+
Expand Down Expand Up @@ -146,7 +146,7 @@ macro_rules! delegate_reverse {
BBSigProvingKey,
KBPositiveAccumulatorParams,
KBPositiveAccumulatorPublicKey,
BDDT16MACParams,
BBDT16MACParams,
PedersenCommitmentKeyG2,
CommitmentKeyG2
: $($tt)+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use ark_ec::{pairing::Pairing, AffineRepr};
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::{collections::BTreeMap, vec::Vec};
use dock_crypto_utils::serde_utils::ArkObjectBytes;
use kvac::bddt_2016::setup::{MACParams, SecretKey};
use kvac::bbdt_2016::setup::{MACParams, SecretKey};
use serde::{Deserialize, Serialize};
use serde_with::{serde_as, Same};

Expand Down Expand Up @@ -39,7 +39,7 @@ impl<G: AffineRepr> PoKOfMAC<G> {
params: MACParams<G>,
revealed_messages: BTreeMap<usize, G::ScalarField>,
) -> Statement<E> {
Statement::PoKBDDT16MAC(Self {
Statement::PoKBBDT16MAC(Self {
revealed_messages,
mac_params: Some(params),
mac_params_ref: None,
Expand All @@ -50,7 +50,7 @@ impl<G: AffineRepr> PoKOfMAC<G> {
params_ref: usize,
revealed_messages: BTreeMap<usize, G::ScalarField>,
) -> Statement<E> {
Statement::PoKBDDT16MAC(Self {
Statement::PoKBBDT16MAC(Self {
revealed_messages,
mac_params: None,
mac_params_ref: Some(params_ref),
Expand All @@ -66,7 +66,7 @@ impl<G: AffineRepr> PoKOfMAC<G> {
setup_params,
&self.mac_params,
self.mac_params_ref,
BDDT16MACParams,
BBDT16MACParams,
IncompatibleBBSPlusSetupParamAtIndex,
st_idx
)
Expand All @@ -79,7 +79,7 @@ impl<G: AffineRepr> PoKOfMACFullVerifier<G> {
params: MACParams<G>,
revealed_messages: BTreeMap<usize, G::ScalarField>,
) -> Statement<E> {
Statement::PoKBDDT16MACFullVerifier(Self {
Statement::PoKBBDT16MACFullVerifier(Self {
revealed_messages,
mac_params: Some(params),
mac_params_ref: None,
Expand All @@ -92,7 +92,7 @@ impl<G: AffineRepr> PoKOfMACFullVerifier<G> {
params_ref: usize,
revealed_messages: BTreeMap<usize, G::ScalarField>,
) -> Statement<E> {
Statement::PoKBDDT16MACFullVerifier(Self {
Statement::PoKBBDT16MACFullVerifier(Self {
revealed_messages,
mac_params: None,
mac_params_ref: Some(params_ref),
Expand All @@ -109,7 +109,7 @@ impl<G: AffineRepr> PoKOfMACFullVerifier<G> {
setup_params,
&self.mac_params,
self.mac_params_ref,
BDDT16MACParams,
BBDT16MACParams,
IncompatibleBBSPlusSetupParamAtIndex,
st_idx
)
Expand Down
18 changes: 9 additions & 9 deletions proof_system/src/statement/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub mod bbs_23;
pub mod bbs_23_ietf;
#[macro_use]
pub mod bbs_plus;
pub mod bddt16_kvac;
pub mod bbdt16_kvac;
pub mod bound_check_bpp;
pub mod bound_check_legogroth16;
pub mod bound_check_smc;
Expand Down Expand Up @@ -92,10 +92,10 @@ pub enum Statement<E: Pairing> {
PoKBBSSignatureG1Verifier(bbs_plus::PoKBBSSignatureG1Verifier<E>),
/// Statement used by verifier for proof of knowledge of BBS signature
PoKBBSSignature23G1Verifier(bbs_23::PoKBBSSignature23G1Verifier<E>),
/// For proof of knowledge of BDDT16 MAC.
PoKBDDT16MAC(bddt16_kvac::PoKOfMAC<E::G1Affine>),
/// Statement used by verifier for proof of knowledge of BDDT16 MAC when it knows the secret key
PoKBDDT16MACFullVerifier(bddt16_kvac::PoKOfMACFullVerifier<E::G1Affine>),
/// For proof of knowledge of BBDT16 MAC.
PoKBBDT16MAC(bbdt16_kvac::PoKOfMAC<E::G1Affine>),
/// Statement used by verifier for proof of knowledge of BBDT16 MAC when it knows the secret key
PoKBBDT16MACFullVerifier(bbdt16_kvac::PoKOfMACFullVerifier<E::G1Affine>),
/// For proof of knowledge of committed elements in a Pedersen commitment in group G1
PedersenCommitmentG2(ped_comm::PedersenCommitment<E::G2Affine>),
/// For proof of membership in VB accumulator in keyed verification model.
Expand Down Expand Up @@ -195,8 +195,8 @@ macro_rules! delegate {
KBPositiveAccumulatorMembershipCDH,
PoKBBSSignatureG1Verifier,
PoKBBSSignature23G1Verifier,
PoKBDDT16MAC,
PoKBDDT16MACFullVerifier,
PoKBBDT16MAC,
PoKBBDT16MACFullVerifier,
PedersenCommitmentG2,
VBAccumulatorMembershipKV,
VBAccumulatorMembershipKVFullVerifier,
Expand Down Expand Up @@ -250,8 +250,8 @@ macro_rules! delegate_reverse {
KBPositiveAccumulatorMembershipCDH,
PoKBBSSignatureG1Verifier,
PoKBBSSignature23G1Verifier,
PoKBDDT16MAC,
PoKBDDT16MACFullVerifier,
PoKBBDT16MAC,
PoKBBDT16MACFullVerifier,
PedersenCommitmentG2,
VBAccumulatorMembershipKV,
VBAccumulatorMembershipKVFullVerifier,
Expand Down
8 changes: 4 additions & 4 deletions proof_system/src/statement_proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use bbs_plus::prelude::{PoKOfSignature23G1Proof, PoKOfSignatureG1Proof};
use bulletproofs_plus_plus::prelude::ProofArbitraryRange;
use coconut_crypto::SignaturePoK as PSSignaturePoK;
use dock_crypto_utils::{ecies, serde_utils::ArkObjectBytes};
use kvac::bddt_2016::proof_cdh::PoKOfMAC;
use kvac::bbdt_2016::proof_cdh::PoKOfMAC;
use saver::encryption::Ciphertext;
use schnorr_pok::SchnorrResponse;
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -57,7 +57,7 @@ pub enum StatementProof<E: Pairing> {
KBUniversalAccumulatorNonMembershipCDH(vb_accumulator::kb_universal_accumulator::proofs_cdh::KBUniversalAccumulatorNonMembershipProof<E>),
KBPositiveAccumulatorMembership(#[serde_as(as = "ArkObjectBytes")] KBPositiveAccumulatorMembershipProof<E>),
KBPositiveAccumulatorMembershipCDH(#[serde_as(as = "ArkObjectBytes")] KBPositiveAccumulatorMembershipProofCDH<E>),
PoKOfBDDT16MAC(PoKOfMAC<E::G1Affine>),
PoKOfBBDT16MAC(PoKOfMAC<E::G1Affine>),
PedersenCommitmentG2(PedersenCommitmentProof<E::G2Affine>),
VBAccumulatorMembershipKV(vb_accumulator::proofs_keyed_verification::MembershipProof<E::G1Affine>),
KBUniversalAccumulatorMembershipKV(vb_accumulator::kb_universal_accumulator::proofs_keyed_verification::KBUniversalAccumulatorMembershipProof<E::G1Affine>),
Expand Down Expand Up @@ -96,7 +96,7 @@ macro_rules! delegate {
KBUniversalAccumulatorNonMembershipCDH,
KBPositiveAccumulatorMembership,
KBPositiveAccumulatorMembershipCDH,
PoKOfBDDT16MAC,
PoKOfBBDT16MAC,
PedersenCommitmentG2,
VBAccumulatorMembershipKV,
KBUniversalAccumulatorMembershipKV,
Expand Down Expand Up @@ -137,7 +137,7 @@ macro_rules! delegate_reverse {
KBUniversalAccumulatorNonMembershipCDH,
KBPositiveAccumulatorMembership,
KBPositiveAccumulatorMembershipCDH,
PoKOfBDDT16MAC,
PoKOfBBDT16MAC,
PedersenCommitmentG2,
VBAccumulatorMembershipKV,
KBUniversalAccumulatorMembershipKV,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use dock_crypto_utils::{
};
use itertools::Itertools;
use kvac::{
bddt_2016::{
bbdt_2016::{
proof_cdh::{PoKOfMAC, PoKOfMACProtocol},
setup::{MACParams, SecretKey},
},
Expand Down Expand Up @@ -46,7 +46,7 @@ impl<'a, G: AffineRepr> PoKOfMACSubProtocol<'a, G> {
&mut self,
rng: &mut R,
blindings: BTreeMap<usize, G::ScalarField>,
witness: crate::witness::PoKOfBDDT16MAC<G>,
witness: crate::witness::PoKOfBBDT16MAC<G>,
) -> Result<(), ProofSystemError> {
if self.protocol.is_some() {
return Err(ProofSystemError::SubProtocolAlreadyInitialized(self.id));
Expand All @@ -55,7 +55,7 @@ impl<'a, G: AffineRepr> PoKOfMACSubProtocol<'a, G> {
expect_equality!(
total_message_count,
self.mac_params.supported_message_count(),
ProofSystemError::BDDT16KVACProtocolInvalidMessageCount
ProofSystemError::BBDT16KVACProtocolInvalidMessageCount
);

// Create messages from revealed messages in statement and unrevealed in witness
Expand Down Expand Up @@ -120,7 +120,7 @@ impl<'a, G: AffineRepr> PoKOfMACSubProtocol<'a, G> {
}
let protocol = self.protocol.take().unwrap();
let proof = protocol.gen_proof(challenge)?;
Ok(StatementProof::PoKOfBDDT16MAC(proof))
Ok(StatementProof::PoKOfBBDT16MAC(proof))
}

pub fn verify_proof_contribution(
Expand Down
8 changes: 4 additions & 4 deletions proof_system/src/sub_protocols/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pub mod accumulator;
pub mod bbs_plus;
pub mod bbs_23;
pub mod bbs_23_ietf;
pub mod bddt16_kvac;
pub mod bbdt16_kvac;
pub mod bound_check_bpp;
pub mod bound_check_legogroth16;
pub mod bound_check_smc;
Expand Down Expand Up @@ -37,7 +37,7 @@ use crate::sub_protocols::{
KBPositiveAccumulatorMembershipSubProtocol, KBUniversalAccumulatorMembershipSubProtocol,
KBUniversalAccumulatorNonMembershipSubProtocol,
},
bddt16_kvac::PoKOfMACSubProtocol,
bbdt16_kvac::PoKOfMACSubProtocol,
bound_check_bpp::BoundCheckBppProtocol,
bound_check_legogroth16::BoundCheckLegoGrothProtocol,
bound_check_smc::BoundCheckSmcProtocol,
Expand Down Expand Up @@ -90,7 +90,7 @@ pub enum SubProtocol<'a, E: Pairing> {
),
KBPositiveAccumulatorMembership(KBPositiveAccumulatorMembershipSubProtocol<'a, E>),
KBPositiveAccumulatorMembershipCDH(KBPositiveAccumulatorMembershipCDHSubProtocol<'a, E>),
PoKOfBDDT16MAC(PoKOfMACSubProtocol<'a, E::G1Affine>),
PoKOfBBDT16MAC(PoKOfMACSubProtocol<'a, E::G1Affine>),
PoKDiscreteLogsG2(schnorr::SchnorrProtocol<'a, E::G2Affine>),
VBAccumulatorMembershipKV(VBAccumulatorMembershipKVSubProtocol<E::G1Affine>),
KBUniversalAccumulatorMembershipKV(KBUniversalAccumulatorMembershipKVSubProtocol<E::G1Affine>),
Expand Down Expand Up @@ -127,7 +127,7 @@ macro_rules! delegate {
KBUniversalAccumulatorNonMembershipCDH,
KBPositiveAccumulatorMembership,
KBPositiveAccumulatorMembershipCDH,
PoKOfBDDT16MAC,
PoKOfBBDT16MAC,
PoKDiscreteLogsG2,
VBAccumulatorMembershipKV,
KBUniversalAccumulatorMembershipKV,
Expand Down
Loading

0 comments on commit 5eeffde

Please sign in to comment.