Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
Signed-off-by: lovesh <[email protected]>
  • Loading branch information
lovesh committed Jul 18, 2024
1 parent 0405015 commit 1929e47
Show file tree
Hide file tree
Showing 35 changed files with 169 additions and 90 deletions.
10 changes: 5 additions & 5 deletions bbs_plus/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bbs_plus"
version = "0.21.0"
version = "0.22.0"
edition.workspace = true
authors.workspace = true
license.workspace = true
Expand All @@ -23,10 +23,10 @@ sha3 = { version = "0.10.6", default-features = false }
serde.workspace = true
serde_with.workspace = true
zeroize.workspace = true
schnorr_pok = { version = "0.19.0", default-features = false, path = "../schnorr_pok" }
dock_crypto_utils = { version = "0.19.0", default-features = false, path = "../utils" }
oblivious_transfer_protocols = { version = "0.8.0", default-features = false, path = "../oblivious_transfer" }
secret_sharing_and_dkg = { version = "0.12.0", default-features = false, path = "../secret_sharing_and_dkg" }
schnorr_pok = { version = "0.20.0", default-features = false, path = "../schnorr_pok" }
dock_crypto_utils = { version = "0.20.0", default-features = false, path = "../utils" }
oblivious_transfer_protocols = { version = "0.9.0", default-features = false, path = "../oblivious_transfer" }
secret_sharing_and_dkg = { version = "0.13.0", default-features = false, path = "../secret_sharing_and_dkg" }

[dev-dependencies]
blake2.workspace = true
Expand Down
7 changes: 7 additions & 0 deletions bbs_plus/src/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ impl<E: Pairing> PoKOfSignatureG1Protocol<E> {
})
}

/// Generate a partial proof, i.e. don't generate responses for message indices in `skip_responses_for` as these will be
/// generated by some other protocol.
pub fn gen_partial_proof(
mut self,
challenge: &E::ScalarField,
Expand All @@ -307,6 +309,7 @@ impl<E: Pairing> PoKOfSignatureG1Protocol<E> {
}
// Schnorr response for relation `A_bar - d == A'*{-e} + h_0*r2`
let sc_resp_1 = mem::take(&mut self.sc_comm_1).gen_proof(challenge);

let wits = schnorr_responses_to_msg_index_map(
mem::take(&mut self.sc_wits_2),
revealed_msg_ids,
Expand Down Expand Up @@ -386,6 +389,8 @@ impl<E: Pairing> PoKOfSignatureG1Proof<E> {
)
}

/// Similar to `Self::verify` but responses for some messages (witnesses) are provided in `missing_responses`.
/// The keys of the map are message indices.
pub fn verify_partial(
&self,
revealed_msgs: &BTreeMap<usize, E::ScalarField>,
Expand All @@ -403,6 +408,8 @@ impl<E: Pairing> PoKOfSignatureG1Proof<E> {
)
}

/// Similar to `Self::verify_with_randomized_pairing_checker` but responses for some messages (witnesses) are provided in `missing_responses`.
/// The keys of the map are message indices.
pub fn verify_partial_with_randomized_pairing_checker(
&self,
revealed_msgs: &BTreeMap<usize, E::ScalarField>,
Expand Down
6 changes: 6 additions & 0 deletions bbs_plus/src/proof_23_cdl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ impl<E: Pairing> PoKOfSignature23G1Protocol<E> {
})
}

/// Generate a partial proof, i.e. don't generate responses for message indices in `skip_responses_for` as these will be
/// generated by some other protocol.
pub fn gen_partial_proof(
mut self,
challenge: &E::ScalarField,
Expand Down Expand Up @@ -331,6 +333,8 @@ impl<E: Pairing> PoKOfSignature23G1Proof<E> {
)
}

/// Similar to `Self::verify` but responses for some messages (witnesses) are provided in `missing_responses`.
/// The keys of the map are message indices.
pub fn verify_partial(
&self,
revealed_msgs: &BTreeMap<usize, E::ScalarField>,
Expand All @@ -348,6 +352,8 @@ impl<E: Pairing> PoKOfSignature23G1Proof<E> {
)
}

/// Similar to `Self::verify_with_randomized_pairing_checker` but responses for some messages (witnesses) are provided in `missing_responses`.
/// The keys of the map are message indices.
pub fn verify_partial_with_randomized_pairing_checker(
&self,
revealed_msgs: &BTreeMap<usize, E::ScalarField>,
Expand Down
6 changes: 6 additions & 0 deletions bbs_plus/src/proof_23_ietf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ impl<E: Pairing> PoKOfSignature23G1Protocol<E> {
})
}

/// Generate a partial proof, i.e. don't generate responses for message indices in `skip_responses_for` as these will be
/// generated by some other protocol.
pub fn gen_partial_proof(
mut self,
challenge: &E::ScalarField,
Expand Down Expand Up @@ -273,6 +275,8 @@ impl<E: Pairing> PoKOfSignature23G1Proof<E> {
)
}

/// Similar to `Self::verify` but responses for some messages (witnesses) are provided in `missing_responses`.
/// The keys of the map are message indices.
pub fn verify_partial(
&self,
revealed_msgs: &BTreeMap<usize, E::ScalarField>,
Expand All @@ -290,6 +294,8 @@ impl<E: Pairing> PoKOfSignature23G1Proof<E> {
)
}

/// Similar to `Self::verify_with_randomized_pairing_checker` but responses for some messages (witnesses) are provided in `missing_responses`.
/// The keys of the map are message indices.
pub fn verify_partial_with_randomized_pairing_checker(
&self,
revealed_msgs: &BTreeMap<usize, E::ScalarField>,
Expand Down
4 changes: 2 additions & 2 deletions bulletproofs_plus_plus/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bulletproofs_plus_plus"
version = "0.5.0"
version = "0.6.0"
edition.workspace = true
authors.workspace = true
license.workspace = true
Expand All @@ -18,7 +18,7 @@ serde.workspace = true
serde_with.workspace = true
zeroize.workspace = true
rayon = { workspace = true, optional = true }
dock_crypto_utils = { version = "0.19.0", default-features = false, path = "../utils" }
dock_crypto_utils = { version = "0.20.0", default-features = false, path = "../utils" }

[dev-dependencies]
blake2.workspace = true
Expand Down
8 changes: 4 additions & 4 deletions coconut/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "coconut-crypto"
version = "0.10.0"
version = "0.11.0"
edition.workspace = true
authors.workspace = true
license.workspace = true
Expand All @@ -22,9 +22,9 @@ itertools.workspace = true
zeroize.workspace = true
serde_with.workspace = true
rayon = { workspace = true, optional = true }
utils = { package = "dock_crypto_utils", version = "0.19.0", default-features = false, path = "../utils" }
schnorr_pok = { version = "0.19.0", default-features = false, path = "../schnorr_pok" }
secret_sharing_and_dkg = { version = "0.12.0", default-features = false, path = "../secret_sharing_and_dkg" }
utils = { package = "dock_crypto_utils", version = "0.20.0", default-features = false, path = "../utils" }
schnorr_pok = { version = "0.20.0", default-features = false, path = "../schnorr_pok" }
secret_sharing_and_dkg = { version = "0.13.0", default-features = false, path = "../secret_sharing_and_dkg" }

[dev-dependencies]
blake2.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions compressed_sigma/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "compressed_sigma"
version = "0.0.10"
version = "0.0.11"
edition.workspace = true
authors.workspace = true
license.workspace = true
Expand All @@ -15,7 +15,7 @@ ark-std.workspace = true
ark-poly.workspace = true
rayon = {workspace = true, optional = true}
digest.workspace = true
dock_crypto_utils = { version = "0.19.0", default-features = false, path = "../utils" }
dock_crypto_utils = { version = "0.20.0", default-features = false, path = "../utils" }

[dev-dependencies]
blake2.workspace = true
Expand Down
6 changes: 3 additions & 3 deletions delegatable_credentials/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "delegatable_credentials"
version = "0.9.0"
version = "0.10.0"
edition.workspace = true
authors.workspace = true
license.workspace = true
Expand All @@ -20,8 +20,8 @@ serde.workspace = true
serde_with.workspace = true
zeroize.workspace = true
num-bigint = { version = "0.4.0", default-features = false }
schnorr_pok = { version = "0.19.0", default-features = false, path = "../schnorr_pok" }
dock_crypto_utils = { version = "0.19.0", default-features = false, path = "../utils" }
schnorr_pok = { version = "0.20.0", default-features = false, path = "../schnorr_pok" }
dock_crypto_utils = { version = "0.20.0", default-features = false, path = "../utils" }

[dependencies.num-integer]
version = "0.1.42"
Expand Down
6 changes: 3 additions & 3 deletions kvac/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kvac"
version = "0.4.0"
version = "0.5.0"
edition.workspace = true
authors.workspace = true
license.workspace = true
Expand All @@ -18,8 +18,8 @@ rayon = {workspace = true, optional = true}
serde.workspace = true
serde_with.workspace = true
itertools.workspace = true
dock_crypto_utils = { version = "0.19.0", default-features = false, path = "../utils" }
schnorr_pok = { version = "0.19.0", default-features = false, path = "../schnorr_pok" }
dock_crypto_utils = { version = "0.20.0", default-features = false, path = "../utils" }
schnorr_pok = { version = "0.20.0", default-features = false, path = "../schnorr_pok" }

[dev-dependencies]
blake2.workspace = true
Expand Down
6 changes: 6 additions & 0 deletions kvac/src/bbdt_2016/proof_cdh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ impl<G: AffineRepr> PoKOfMACProtocol<G> {
})
}

/// Generate a partial proof, i.e. don't generate responses for message indices in `skip_responses_for` as these will be
/// generated by some other protocol.
pub fn gen_partial_proof(
mut self,
challenge: &G::ScalarField,
Expand Down Expand Up @@ -282,6 +284,8 @@ impl<G: AffineRepr> PoKOfMAC<G> {
self._verify(revealed_msgs, challenge, secret_key, params, None)
}

/// Similar to `Self::verify` but responses for some messages (witnesses) are provided in `missing_responses`.
/// The keys of the map are message indices.
pub fn verify_partial(
&self,
revealed_msgs: &BTreeMap<usize, G::ScalarField>,
Expand All @@ -308,6 +312,8 @@ impl<G: AffineRepr> PoKOfMAC<G> {
self._verify_schnorr_proof(revealed_msgs, challenge, params, None)
}

/// Similar to `Self::verify_schnorr_proof` but responses for some messages (witnesses) are provided in `missing_responses`.
/// The keys of the map are message indices.
pub fn verify_partial_schnorr_proof(
&self,
revealed_msgs: &BTreeMap<usize, G::ScalarField>,
Expand Down
4 changes: 2 additions & 2 deletions legogroth16/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "legogroth16"
version = "0.14.0"
version = "0.15.0"
authors = [ "arkworks contributors", "Dock.io" ]
description = "An implementation of the LegoGroth16, the Legosnark variant of Groth16 zkSNARK proof system"
repository.workspace = true
Expand Down Expand Up @@ -29,7 +29,7 @@ num-bigint = { version = "0.4", default-features = false, optional = true }
log = "0.4"
ark-groth16 = { workspace = true, optional = true }
ark-snark = { version = "^0.4.0", default-features = false, optional = true }
dock_crypto_utils = { version = "0.19.0", default-features = false, path = "../utils" }
dock_crypto_utils = { version = "0.20.0", default-features = false, path = "../utils" }

[dev-dependencies]
csv = { version = "1" }
Expand Down
6 changes: 3 additions & 3 deletions oblivious_transfer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "oblivious_transfer_protocols"
version = "0.8.0"
version = "0.9.0"
edition.workspace = true
authors.workspace = true
license.workspace = true
Expand All @@ -23,8 +23,8 @@ sha3 = { version = "0.10.6", default-features = false }
aes = { version = "0.8.2", default-features = false }
itertools.workspace = true
byteorder = { version = "1.4", default-features = false }
dock_crypto_utils = { version = "0.19.0", default-features = false, path = "../utils" }
schnorr_pok = { version = "0.19.0", default-features = false, path = "../schnorr_pok" }
dock_crypto_utils = { version = "0.20.0", default-features = false, path = "../utils" }
schnorr_pok = { version = "0.20.0", default-features = false, path = "../schnorr_pok" }

[dev-dependencies]
blake2.workspace = true
Expand Down
24 changes: 12 additions & 12 deletions proof_system/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "proof_system"
version = "0.30.0"
version = "0.31.0"
edition.workspace = true
authors.workspace = true
license.workspace = true
Expand All @@ -27,18 +27,18 @@ zeroize.workspace = true
itertools.workspace = true
aead = {version = "0.5.2", default-features = false, features = [ "alloc" ]}
chacha20poly1305 = {version = "0.10.1", default-features = false}
bbs_plus = { version = "0.21.0", default-features = false, path = "../bbs_plus" }
schnorr_pok = { version = "0.19.0", default-features = false, path = "../schnorr_pok" }
vb_accumulator = { version = "0.25.0", default-features = false, path = "../vb_accumulator" }
dock_crypto_utils = { version = "0.19.0", default-features = false, path = "../utils" }
saver = { version = "0.17.0", default-features = false, path = "../saver" }
coconut-crypto = { version = "0.10.0", default-features = false, path = "../coconut" }
bbs_plus = { version = "0.22.0", default-features = false, path = "../bbs_plus" }
schnorr_pok = { version = "0.20.0", default-features = false, path = "../schnorr_pok" }
vb_accumulator = { version = "0.26.0", default-features = false, path = "../vb_accumulator" }
dock_crypto_utils = { version = "0.20.0", default-features = false, path = "../utils" }
saver = { version = "0.18.0", default-features = false, path = "../saver" }
coconut-crypto = { version = "0.11.0", default-features = false, path = "../coconut" }
merlin = { package = "dock_merlin", version = "3.0.0", default-features = false, path = "../merlin" }
legogroth16 = { version = "0.14.0", default-features = false, features = ["circom", "aggregation"], path = "../legogroth16" }
bulletproofs_plus_plus = { version = "0.5.0", default-features = false, path = "../bulletproofs_plus_plus" }
smc_range_proof = { version = "0.5.0", default-features = false, path = "../smc_range_proof" }
short_group_sig = { version = "0.3.0", default-features = false, path = "../short_group_sig" }
kvac = { version = "0.4.0", default-features = false, path = "../kvac" }
legogroth16 = { version = "0.15.0", default-features = false, features = ["circom", "aggregation"], path = "../legogroth16" }
bulletproofs_plus_plus = { version = "0.6.0", default-features = false, path = "../bulletproofs_plus_plus" }
smc_range_proof = { version = "0.6.0", default-features = false, path = "../smc_range_proof" }
short_group_sig = { version = "0.4.0", default-features = false, path = "../short_group_sig" }
kvac = { version = "0.5.0", default-features = false, path = "../kvac" }

[dev-dependencies]
ark-bls12-381.workspace = true
Expand Down
2 changes: 2 additions & 0 deletions proof_system/src/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,8 @@ impl<E: Pairing> Proof<E> {
}
}

/// Get indices of witnesses of statement index `s_id` for which response should not be generated since it already exists.
/// If the response didn't exists, then the given `resp_generated` will be updated
fn get_responses_to_skip(
s_id: usize,
total_msgs: usize,
Expand Down
1 change: 1 addition & 0 deletions proof_system/src/sub_protocols/bound_check_bpp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ impl<'a, G: AffineRepr> BoundCheckBppProtocol<'a, G> {
self.bpp_randomness.take().unwrap(),
)?;
let proof = prover.prove(rng, self.setup_params.clone(), transcript)?;
// Don't generated response for index 0 since its response will come from proofs of one of the signatures.
let skip_for = BTreeSet::from([0]);
Ok(StatementProof::BoundCheckBpp(BoundCheckBppProof {
bpp_proof: ProofArbitraryRange {
Expand Down
1 change: 1 addition & 0 deletions proof_system/src/sub_protocols/bound_check_legogroth16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ impl<'a, E: Pairing> BoundCheckLegoGrothProtocol<'a, E> {
self.id,
));
}
// Don't generated response for index 0 since its response will come from proofs of one of the signatures.
let skip_for = BTreeSet::from([0]);
Ok(StatementProof::BoundCheckLegoGroth16(
BoundCheckLegoGroth16Proof {
Expand Down
1 change: 1 addition & 0 deletions proof_system/src/sub_protocols/bound_check_smc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ impl<'a, E: Pairing> BoundCheckSmcProtocol<'a, E> {
BoundCheckSmcInnerProof::CLS(p)
}
};
// Don't generated response for index 0 since its response will come from proofs of one of the signatures.
let skip_for = BTreeSet::from([0]);
Ok(StatementProof::BoundCheckSmc(BoundCheckSmcProof {
proof,
Expand Down
1 change: 1 addition & 0 deletions proof_system/src/sub_protocols/bound_check_smc_with_kv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ impl<'a, E: Pairing> BoundCheckSmcWithKVProtocol<'a, E> {
BoundCheckSmcWithKVInnerProof::CLS(p)
}
};
// Don't generated response for index 0 since its response will come from proofs of one of the signatures.
let skip_for = BTreeSet::from([0]);
Ok(StatementProof::BoundCheckSmcWithKV(
BoundCheckSmcWithKVProof {
Expand Down
1 change: 1 addition & 0 deletions proof_system/src/sub_protocols/inequality.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ impl<'a, G: AffineRepr> InequalityProtocol<'a, G> {
.take()
.unwrap()
.gen_proof(challenge);
// Don't generated response for index 0 since its response will come from proofs of one of the signatures.
let skip_for = BTreeSet::from([0]);
Ok(StatementProof::Inequality(InequalityProof {
proof,
Expand Down
1 change: 1 addition & 0 deletions proof_system/src/sub_protocols/saver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ impl<'a, E: Pairing> SaverProtocol<'a, E> {
let mut sp_chunks = self.sp_chunks.take().unwrap();
let mut sp_combined = self.sp_combined.take().unwrap();
let skip_for_chunks = BTreeSet::from_iter(0..ciphertext.enc_chunks.len());
// Don't generated response for index 0 since its response will come from proofs of one of the signatures.
let skip_for_message = BTreeSet::from([0]);
Ok(StatementProof::Saver(SaverProof {
ciphertext,
Expand Down
3 changes: 3 additions & 0 deletions proof_system/src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1762,6 +1762,9 @@ impl<E: Pairing> Proof<E> {
Ok(())
}

/// Get the response for a witness from the tracked responses of witness equalities. Expects the response
/// to exists else throws error. This is not to be called for signature proof protocols but others whose
/// responses are expected to come from them or pedersen commitment protocols.
fn get_resp_for_message(
s_idx: usize,
disjoint_equalities: &[EqualWitnesses],
Expand Down
6 changes: 3 additions & 3 deletions saver/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "saver"
version = "0.17.0"
version = "0.18.0"
edition.workspace = true
authors.workspace = true
license.workspace = true
Expand All @@ -20,8 +20,8 @@ rayon = {workspace = true, optional = true}
serde.workspace = true
serde_with.workspace = true
zeroize.workspace = true
dock_crypto_utils = { version = "0.19.0", default-features = false, path = "../utils" }
legogroth16 = { version = "0.14.0", default-features = false, features = ["aggregation"], path = "../legogroth16" }
dock_crypto_utils = { version = "0.20.0", default-features = false, path = "../utils" }
legogroth16 = { version = "0.15.0", default-features = false, features = ["aggregation"], path = "../legogroth16" }
merlin = { package = "dock_merlin", version = "3.0.0", default-features = false, path = "../merlin" }

[dev-dependencies]
Expand Down
Loading

0 comments on commit 1929e47

Please sign in to comment.