You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: delg_cred_cdd/README.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -4,17 +4,17 @@
4
4
5
5
### Brief description of the API
6
6
1.[Groth1 and Groth2 signatures](src/groth_sig.rs).
7
-
- Parameters can be generated by calling `GrothS1::setup` or `GrothS2::setup`. `setup` takes the maximum number of attributes that need to be supported. Keep it one more than the number you want to support to accomodate the public key.
7
+
- Parameters can be generated by calling `GrothS1::setup` or `GrothS2::setup`. `setup` takes the maximum number of attributes that need to be supported. Keep it one more than the number you want to support to accommodate the public key.
8
8
- Signing keys can be generated by calling `GrothS1::keygen` or `GrothS2::keygen`. Takes the corresponding setup parameters.
9
9
- A new signature can be created by calling `Groth1Sig:new` or `Groth2Sig:new`. An existing signature can be randomized by calling `randomize` on the siganture.
10
10
- 2 methods for signature verification, `verify` and `verify_fast`, both with the same API. `verify` computes several pairings to verify the signature whereas `verify_fast` does only 1 big multi-pairing. Applies this observation to pairings: if it needs to be cheched that a == b and c == d and e == f, then choose a random number `r` and check whether (a-b) + (c-d)*r + (e-f)*r<sup>2</sup> == 0. Refer the docs for the method for more details
11
11
2.[Issuers and delegation](src/issuer.rs).
12
12
- Issuers are instantiated by calling `EvenLevelIssuer::new` or `OddLevelIssuer::new` by passing their level to the `new` function. Root issuers is at level 0 so always instantiated by `EvenLevelIssuer::new(0)`.
13
13
- Issuers generate their keys with `EvenLevelIssuer::keygen` or `OddLevelIssuer::keygen`.
14
14
- Issuers can delegate by calling `delegate` method that takes the attributes to sign, who to delegate to etc resulting in a credential.
15
-
- A credential is a called a link and there credentials issued by `EvenLevelIssuer`s are called `CredLinkOdd` and credentials issued by `OddLevelIssuer`s are called `CredLinkEven`.
15
+
- A credential is a called a link and the credentials issued by `EvenLevelIssuer`s are called `CredLinkOdd` and credentials issued by `OddLevelIssuer`s are called `CredLinkEven`.
16
16
- A link stores its associated `level`, `attributes` and `signature`. The last element of `attributes` is the verification key of the delegatee and the signature is on `attributes`.
17
-
- To verify the correctness of link, call `verify` on it with delegator public key, delegatee public key ans setup params.
17
+
- To verify the correctness of link, call `verify` on it with delegator public key, delegatee public key and setup params.
18
18
- The chain of credentials is kept in `CredChain` which internally has 2 lists, 1 for odd level links and 1 for even. Even or odd level links can be added by calling `extend_with_even` or `extend_with_odd` on the chain.
19
19
- To verify that all delegations are valid in the chain, call `verify_delegations` on the chain.
let c_1 = AttributeToken::gen_challenge(&com_1,&l_0_issuer_vk);
1405
+
let c_1 = AttributeToken::gen_challenge(&com_1,&l_0_issuer_vk,vec![]);
1402
1406
1403
1407
let start_resp = Instant::now();
1404
1408
let resp_1 = at_1
@@ -1421,7 +1425,7 @@ mod tests {
1421
1425
.unwrap();
1422
1426
let recon_duration = start_recon.elapsed();
1423
1427
1424
-
let recon_c_1 = AttributeToken::gen_challenge(&recon_com_1,&l_0_issuer_vk);
1428
+
let recon_c_1 = AttributeToken::gen_challenge(&recon_com_1,&l_0_issuer_vk,vec![]);
1425
1429
assert_eq!(c_1, recon_c_1);
1426
1430
println!("For delegation chain of length {}, commitment takes {:?}, response takes {:?}, commitment reconstitution takes {:?}. Total time taken by commitment and response is {:?}",L,
let c_2 = AttributeToken::gen_challenge(&com_2,&l_0_issuer_vk);
1456
+
let c_2 = AttributeToken::gen_challenge(&com_2,&l_0_issuer_vk,vec![]);
1453
1457
1454
1458
let start_resp = Instant::now();
1455
1459
let resp_2 = at_2
@@ -1478,7 +1482,7 @@ mod tests {
1478
1482
.unwrap();
1479
1483
let recon_duration = start_recon.elapsed();
1480
1484
1481
-
let recon_c_2 = AttributeToken::gen_challenge(&recon_com_2,&l_0_issuer_vk);
1485
+
let recon_c_2 = AttributeToken::gen_challenge(&recon_com_2,&l_0_issuer_vk,vec![]);
1482
1486
assert_eq!(c_2, recon_c_2);
1483
1487
println!("For delegation chain of length {}, commitment takes {:?}, response takes {:?}, commitment reconstitution takes {:?}. Total time taken by commitment and response is {:?}",L,
let c_3 = AttributeToken::gen_challenge(&com_3,&l_0_issuer_vk);
1515
+
let c_3 = AttributeToken::gen_challenge(&com_3,&l_0_issuer_vk,vec![]);
1512
1516
1513
1517
let start_resp = Instant::now();
1514
1518
let resp_3 = at_3
@@ -1536,7 +1540,7 @@ mod tests {
1536
1540
)
1537
1541
.unwrap();
1538
1542
let recon_duration = start_recon.elapsed();
1539
-
let recon_c_3 = AttributeToken::gen_challenge(&recon_com_3,&l_0_issuer_vk);
1543
+
let recon_c_3 = AttributeToken::gen_challenge(&recon_com_3,&l_0_issuer_vk,vec![]);
1540
1544
assert_eq!(c_3, recon_c_3);
1541
1545
1542
1546
println!("For delegation chain of length {}, commitment takes {:?}, response takes {:?}, commitment reconstitution takes {:?}. Total time taken by commitment and response is {:?}",L,
let c_4 = AttributeToken::gen_challenge(&com_4,&l_0_issuer_vk);
1575
+
let c_4 = AttributeToken::gen_challenge(&com_4,&l_0_issuer_vk,vec![]);
1572
1576
1573
1577
let start_resp = Instant::now();
1574
1578
let resp_4 = at_4
@@ -1597,7 +1601,7 @@ mod tests {
1597
1601
.unwrap();
1598
1602
let recon_duration = start_recon.elapsed();
1599
1603
1600
-
let recon_c_4 = AttributeToken::gen_challenge(&recon_com_4,&l_0_issuer_vk);
1604
+
let recon_c_4 = AttributeToken::gen_challenge(&recon_com_4,&l_0_issuer_vk,vec![]);
1601
1605
assert_eq!(c_4, recon_c_4);
1602
1606
println!("For delegation chain of length {}, commitment takes {:?}, response takes {:?}, commitment reconstitution takes {:?}. Total time taken by commitment and response is {:?}",L,
let c_5 = AttributeToken::gen_challenge(&com_5,&l_0_issuer_vk);
1636
+
let c_5 = AttributeToken::gen_challenge(&com_5,&l_0_issuer_vk,vec![]);
1633
1637
1634
1638
let start_resp = Instant::now();
1635
1639
let resp_5 = at_5
@@ -1658,7 +1662,7 @@ mod tests {
1658
1662
.unwrap();
1659
1663
let recon_duration = start_recon.elapsed();
1660
1664
1661
-
let recon_c_5 = AttributeToken::gen_challenge(&recon_com_5,&l_0_issuer_vk);
1665
+
let recon_c_5 = AttributeToken::gen_challenge(&recon_com_5,&l_0_issuer_vk,vec![]);
1662
1666
assert_eq!(c_5, recon_c_5);
1663
1667
println!("For delegation chain of length {}, commitment takes {:?}, response takes {:?}, commitment reconstitution takes {:?}. Total time taken by commitment and response is {:?}",L,
let c_6 = AttributeToken::gen_challenge(&com_6,&l_0_issuer_vk);
1698
+
let c_6 = AttributeToken::gen_challenge(&com_6,&l_0_issuer_vk,vec![]);
1695
1699
1696
1700
let start_resp = Instant::now();
1697
1701
let resp_6 = at_6
@@ -1720,7 +1724,7 @@ mod tests {
1720
1724
.unwrap();
1721
1725
let recon_duration = start_recon.elapsed();
1722
1726
1723
-
let recon_c_6 = AttributeToken::gen_challenge(&recon_com_6,&l_0_issuer_vk);
1727
+
let recon_c_6 = AttributeToken::gen_challenge(&recon_com_6,&l_0_issuer_vk,vec![]);
1724
1728
assert_eq!(c_6, recon_c_6);
1725
1729
println!("For delegation chain of length {}, commitment takes {:?}, response takes {:?}, commitment reconstitution takes {:?}. Total time taken by commitment and response is {:?}",L,
let c_1 = AttributeToken::gen_challenge(&com_1,&l_0_issuer_vk);
1787
+
let c_1 = AttributeToken::gen_challenge(&com_1,&l_0_issuer_vk,vec![]);
1784
1788
1785
1789
let start_resp = Instant::now();
1786
1790
let resp_1 = at_1
@@ -1803,7 +1807,7 @@ mod tests {
1803
1807
.unwrap();
1804
1808
let recon_duration = start_recon.elapsed();
1805
1809
1806
-
let recon_c_1 = AttributeToken::gen_challenge(&recon_com_1,&l_0_issuer_vk);
1810
+
let recon_c_1 = AttributeToken::gen_challenge(&recon_com_1,&l_0_issuer_vk,vec![]);
1807
1811
assert_eq!(c_1, recon_c_1);
1808
1812
println!("For delegation chain of length {}, commitment takes {:?}, response takes {:?}, commitment reconstitution takes {:?}. Total time taken by commitment and response is {:?}",L,
let c_2 = AttributeToken::gen_challenge(&com_2,&l_0_issuer_vk);
1856
+
let c_2 = AttributeToken::gen_challenge(&com_2,&l_0_issuer_vk,vec![]);
1853
1857
1854
1858
let start_resp = Instant::now();
1855
1859
let resp_2 = at_2
@@ -1881,7 +1885,7 @@ mod tests {
1881
1885
.unwrap();
1882
1886
let recon_duration = start_recon.elapsed();
1883
1887
1884
-
let recon_c_2 = AttributeToken::gen_challenge(&recon_com_2,&l_0_issuer_vk);
1888
+
let recon_c_2 = AttributeToken::gen_challenge(&recon_com_2,&l_0_issuer_vk,vec![]);
1885
1889
assert_eq!(c_2, recon_c_2);
1886
1890
println!("For delegation chain of length {}, commitment takes {:?}, response takes {:?}, commitment reconstitution takes {:?}. Total time taken by commitment and response is {:?}",L,
let c_3 = AttributeToken::gen_challenge(&com_3,&l_0_issuer_vk);
1937
+
let c_3 = AttributeToken::gen_challenge(&com_3,&l_0_issuer_vk,vec![]);
1934
1938
1935
1939
let start_resp = Instant::now();
1936
1940
let resp_3 = at_3
@@ -1962,7 +1966,7 @@ mod tests {
1962
1966
)
1963
1967
.unwrap();
1964
1968
let recon_duration = start_recon.elapsed();
1965
-
let recon_c_3 = AttributeToken::gen_challenge(&recon_com_3,&l_0_issuer_vk);
1969
+
let recon_c_3 = AttributeToken::gen_challenge(&recon_com_3,&l_0_issuer_vk,vec![]);
1966
1970
assert_eq!(c_3, recon_c_3);
1967
1971
1968
1972
println!("For delegation chain of length {}, commitment takes {:?}, response takes {:?}, commitment reconstitution takes {:?}. Total time taken by commitment and response is {:?}",L,
let c_4 = AttributeToken::gen_challenge(&com_4,&l_0_issuer_vk);
2026
+
let c_4 = AttributeToken::gen_challenge(&com_4,&l_0_issuer_vk,vec![]);
2023
2027
2024
2028
let start_resp = Instant::now();
2025
2029
let resp_4 = at_4
@@ -2053,7 +2057,7 @@ mod tests {
2053
2057
.unwrap();
2054
2058
let recon_duration = start_recon.elapsed();
2055
2059
2056
-
let recon_c_4 = AttributeToken::gen_challenge(&recon_com_4,&l_0_issuer_vk);
2060
+
let recon_c_4 = AttributeToken::gen_challenge(&recon_com_4,&l_0_issuer_vk,vec![]);
2057
2061
assert_eq!(c_4, recon_c_4);
2058
2062
println!("For delegation chain of length {}, commitment takes {:?}, response takes {:?}, commitment reconstitution takes {:?}. Total time taken by commitment and response is {:?}",L,
0 commit comments