Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
Signed-off-by: lovesh <[email protected]>
  • Loading branch information
lovesh committed Apr 12, 2024
1 parent 7ed83cf commit cd8e048
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 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.27.0"
version = "0.28.0"
edition.workspace = true
authors.workspace = true
license.workspace = true
Expand Down Expand Up @@ -29,7 +29,7 @@ aead = {version = "0.5.2", default-features = false, features = [ "alloc" ]}
chacha20poly1305 = {version = "0.10.1", default-features = false}
bbs_plus = { version = "0.19.0", default-features = false, path = "../bbs_plus" }
schnorr_pok = { version = "0.17.0", default-features = false, path = "../schnorr_pok" }
vb_accumulator = { version = "0.22.0", default-features = false, path = "../vb_accumulator" }
vb_accumulator = { version = "0.23.0", default-features = false, path = "../vb_accumulator" }
dock_crypto_utils = { version = "0.17.0", default-features = false, path = "../utils" }
saver = { version = "0.15.0", default-features = false, path = "../saver" }
coconut-crypto = { version = "0.8.0", default-features = false, path = "../coconut" }
Expand Down
2 changes: 1 addition & 1 deletion vb_accumulator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "vb_accumulator"
version = "0.22.0"
version = "0.23.0"
edition.workspace = true
authors.workspace = true
license.workspace = true
Expand Down
3 changes: 2 additions & 1 deletion vb_accumulator/src/kb_universal_accumulator/accumulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ impl<E: Pairing> KBUniversalAccumulator<E> {
sk: &SecretKey<E::ScalarField>,
) -> (E::G1Affine, E::G1Affine) {
let mem = self.mem.value().clone();
let non_mem = self.mem.compute_new_post_add_batch(new_elements, sk);
let non_mem = self.non_mem.compute_new_post_add_batch(new_elements, sk);
(mem, non_mem)
}

Expand Down Expand Up @@ -508,6 +508,7 @@ pub mod tests {
setup_kb_universal_accum(&mut rng, max);

let accumulator_ = KBUniversalAccumulator::<Bls12_381>::initialize_empty(&params);
assert_eq!(*accumulator_.mem_value(), *accumulator_.non_mem_value());
let (mem, non_mem) = accumulator_.compute_extended(&domain, &keypair.secret_key);
assert_eq!(*accumulator.mem_value(), mem);
assert_eq!(*accumulator.non_mem_value(), non_mem);
Expand Down
10 changes: 10 additions & 0 deletions vb_accumulator/src/kb_universal_accumulator/witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,16 @@ mod tests {
&mut non_mem_state,
)
.unwrap();
assert_eq!(*accumulator_2.mem_value(), *accumulator_1.mem_value());
assert_ne!(
*accumulator_2.non_mem_value(),
*accumulator_1.non_mem_value()
);

let (accumulator_2_mem, accumulator_2_non_mem) =
accumulator_1.compute_extended(&new_elements, &keypair.secret_key);
assert_eq!(*accumulator_2.mem_value(), accumulator_2_mem);
assert_eq!(*accumulator_2.non_mem_value(), accumulator_2_non_mem);

for i in 0..non_members.len() {
assert!(!accumulator_2.verify_non_membership(
Expand Down

0 comments on commit cd8e048

Please sign in to comment.