Skip to content

Commit a985391

Browse files
committed
Implement 2 DAC (Delegatable Anonymous Credentials) schemes: Protego
(and Protego Duo) and MSBM Signed-off-by: lovesh <lovesh.bond@gmail.com>
1 parent 860c023 commit a985391

40 files changed

+8188
-65
lines changed

Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ members = [
99
"saver",
1010
"compressed_sigma",
1111
"benches",
12-
"test_utils"
12+
"test_utils",
13+
"delegatable_credentials"
1314
]
1415
resolver = "2"
1516

@@ -31,7 +32,8 @@ serde_with = { version = "1.10.0", default-features = false, features = ["macros
3132
zeroize = { version = "1.5.5", features = ["derive"] }
3233
blake2 = { version = "0.9", default-features = false }
3334
ark-bls12-381 = { version = "^0.3.0", default-features = false, features = [ "curve" ] }
34-
35+
ark-poly = { version = "^0.3.0", default-features = false }
36+
merlin = { version = "^3.0", default-features = false }
3537

3638
[profile.release]
3739
lto = true

bbs_plus/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bbs_plus"
3-
version = "0.9.0"
3+
version = "0.10.0"
44
edition.workspace = true
55
authors.workspace = true
66
license.workspace = true
@@ -18,8 +18,8 @@ ark-ec.workspace = true
1818
ark-std.workspace = true
1919
digest.workspace = true
2020
rayon = {workspace = true, optional = true}
21-
schnorr_pok = { version = "0.7.0", default-features = false, path = "../schnorr_pok" }
22-
dock_crypto_utils = { version = "0.7.0", default-features = false, path = "../utils" }
21+
schnorr_pok = { version = "0.8.0", default-features = false, path = "../schnorr_pok" }
22+
dock_crypto_utils = { version = "0.8.0", default-features = false, path = "../utils" }
2323
serde.workspace = true
2424
serde_with.workspace = true
2525
zeroize.workspace = true

benches/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ authors.workspace = true
66
license.workspace = true
77

88
[dependencies]
9-
bbs_plus = { version = "0.9.0", default-features = false, path = "../bbs_plus" }
10-
schnorr_pok = { version = "0.7.0", default-features = false, path = "../schnorr_pok" }
11-
vb_accumulator = { version = "0.10.0", default-features = false, path = "../vb_accumulator" }
9+
bbs_plus = { version = "0.10.0", default-features = false, path = "../bbs_plus" }
10+
schnorr_pok = { version = "0.8.0", default-features = false, path = "../schnorr_pok" }
11+
vb_accumulator = { version = "0.11.0", default-features = false, path = "../vb_accumulator" }
1212
test_utils = { version = "0.1.0", default-features = false, path = "../test_utils" }
1313
ark-ff.workspace = true
1414
ark-ec.workspace = true

compressed_sigma/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ark-sponge = { version = "^0.3.0", default-features = false }
1515
ark-poly = { version = "^0.3.0", default-features = false }
1616
rayon = {workspace = true, optional = true}
1717
digest.workspace = true
18-
dock_crypto_utils = { version = "0.7.0", default-features = false, path = "../utils" }
18+
dock_crypto_utils = { version = "0.8.0", default-features = false, path = "../utils" }
1919

2020
[dev-dependencies]
2121
blake2.workspace = true

compressed_sigma/src/compressed_linear_form.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ where
133133

134134
// There are many multiplications done with `k`, so creating a table for it
135135
let lg2 = z_hat.len() & (z_hat.len() - 1);
136-
let k_table = WindowTable::new(G::ScalarField::size_in_bits(), lg2, k.into_projective());
136+
let k_table = WindowTable::new(lg2, k.into_projective());
137137

138138
// In each iteration of the loop, size of `z_hat`, `g_hat` and `L_tilde` is reduced by half
139139
while z_hat.len() > 2 {

compressed_sigma/src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use ark_ec::AffineCurve;
22
use ark_ff::PrimeField;
33
use ark_std::{vec, vec::Vec};
44
use dock_crypto_utils::ec::batch_normalize_projective_into_affine;
5-
use dock_crypto_utils::msm::{multiply_field_elems_with_same_group_elem, variable_base_msm};
5+
use dock_crypto_utils::msm::multiply_field_elems_with_same_group_elem;
66

77
use crate::transforms::{Homomorphism, LinearForm};
88

delegatable_credentials/Cargo.toml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[package]
2+
name = "delegatable_credentials"
3+
version = "0.1.0"
4+
edition.workspace = true
5+
authors.workspace = true
6+
license.workspace = true
7+
repository.workspace = true
8+
9+
[dependencies]
10+
ark-ff.workspace = true
11+
ark-ec.workspace = true
12+
ark-std.workspace = true
13+
ark-serialize.workspace = true
14+
ark-poly.workspace = true
15+
digest.workspace = true
16+
rayon = {workspace = true, optional = true}
17+
serde.workspace = true
18+
serde_with.workspace = true
19+
dock_crypto_utils = { version = "0.8.0", default-features = false, path = "../utils" }
20+
zeroize.workspace = true
21+
num-bigint = { version = "0.4.0", default-features = false }
22+
schnorr_pok = { version = "0.8.0", default-features = false, path = "../schnorr_pok" }
23+
[dependencies.num-integer]
24+
version = "0.1.42"
25+
features = ["i128"]
26+
default-features = false
27+
28+
[dev-dependencies]
29+
blake2.workspace = true
30+
ark-bls12-381.workspace = true
31+
32+
[features]
33+
default = [ "parallel" ]
34+
std = [ "ark-ff/std", "ark-ec/std", "ark-std/std", "ark-serialize/std", "serde/std", "dock_crypto_utils/std", "ark-poly/std"]
35+
parallel = [ "std", "ark-ff/parallel", "ark-ec/parallel", "ark-std/parallel", "rayon", "dock_crypto_utils/parallel", "ark-poly/parallel"]

delegatable_credentials/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Delegatable credentials
2+
3+
Provides 2 variations:
4+
1. Ad-hoc delegation where credential owner chooses a set of issuer public keys and proves that the credential was issued by one of the key. Based on the paper [Protego: A Credential Scheme for Permissioned Blockchains](https://eprint.iacr.org/2022/661). [Code](./src/protego)
5+
2. Here there is a root issuer which can issue a credential to anyone with the permission to reissue the credential with or without additional attributes. Based on the paper [Practical Delegatable Anonymous Credentials From Equivalence Class Signatures](https://eprint.iacr.org/2022/680). [Code](./src/msbm)

0 commit comments

Comments
 (0)