Skip to content

Commit 730e121

Browse files
authored
Merge pull request #5 from dfnsco/unambiguous-challenge
Derive challenges unambiguously
2 parents 9c4d4b8 + ed0894f commit 730e121

30 files changed

+900
-571
lines changed

.github/changelog.sh

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
3+
m_branch=m;
4+
changelog_file=CHANGELOG.md;
5+
6+
# fetch master since we might be in a shallow clone
7+
git fetch origin "$m_branch:$m_branch" --depth=1
8+
9+
changed=0;
10+
for log in */"$changelog_file"; do
11+
dir=$(dirname "$log");
12+
# check if version changed
13+
if git diff "$m_branch" -- "$dir/Cargo.toml" | grep -q "^-version = "; then
14+
# check if changelog updated
15+
if git diff --exit-code --no-patch "$m_branch" -- "$log"; then
16+
echo "$dir version changed, but $log is not updated"
17+
changed=1;
18+
fi
19+
fi
20+
done
21+
22+
exit "$changed";

.github/workflows/deps.yml

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
track_deps:
1717
runs-on: ubuntu-latest
1818
permissions:
19+
contents: read
1920
pull-requests: write
2021
steps:
2122
- uses: actions/checkout@v3
@@ -25,6 +26,9 @@ jobs:
2526
- uses: actions/checkout@v3
2627
with:
2728
path: pr_branch
29+
- uses: webfactory/[email protected]
30+
with:
31+
ssh-private-key: ${{ secrets.PAILLIER_ZK }}
2832
- name: Retrieve base branch deps
2933
run: |
3034
cd base_branch

.github/workflows/docs.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@ on:
66
push:
77
branches: [ "m" ]
88

9+
env:
10+
CARGO_TERM_COLOR: always
11+
CARGO_NET_GIT_FETCH_WITH_CLI: true
12+
913
jobs:
1014
build_pdf:
1115
runs-on: ubuntu-latest
1216
permissions:
17+
contents: read
1318
pull-requests: write
1419
steps:
1520
- uses: actions/checkout@v3
@@ -36,6 +41,9 @@ jobs:
3641
runs-on: ubuntu-latest
3742
steps:
3843
- uses: actions/checkout@v3
44+
- uses: webfactory/[email protected]
45+
with:
46+
ssh-private-key: ${{ secrets.PAILLIER_ZK }}
3947
- uses: dtolnay/rust-toolchain@nightly
4048
- uses: Swatinem/rust-cache@v2
4149
with:
@@ -74,4 +82,4 @@ jobs:
7482
path: 'website'
7583
- name: Deploy to GitHub Pages
7684
id: deployment
77-
uses: actions/deploy-pages@v4
85+
uses: actions/deploy-pages@v4

.github/workflows/readme.yml

+7
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,18 @@ on:
44
pull_request:
55
branches: [ "*" ]
66

7+
env:
8+
CARGO_TERM_COLOR: always
9+
CARGO_NET_GIT_FETCH_WITH_CLI: true
10+
711
jobs:
812
check_readme:
913
runs-on: ubuntu-latest
1014
steps:
1115
- uses: actions/checkout@v3
16+
- uses: webfactory/[email protected]
17+
with:
18+
ssh-private-key: ${{ secrets.PAILLIER_ZK }}
1219
- name: Install cargo-hakari
1320
uses: baptiste0928/cargo-install@v1
1421
with:

.github/workflows/rust.yml

+31
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v3
18+
- uses: webfactory/[email protected]
19+
with:
20+
ssh-private-key: ${{ secrets.PAILLIER_ZK }}
1821
- uses: Swatinem/rust-cache@v2
1922
with:
2023
cache-on-failure: "true"
@@ -35,6 +38,9 @@ jobs:
3538
- cggmp21
3639
steps:
3740
- uses: actions/checkout@v3
41+
- uses: webfactory/[email protected]
42+
with:
43+
ssh-private-key: ${{ secrets.PAILLIER_ZK }}
3844
- uses: Swatinem/rust-cache@v2
3945
with:
4046
cache-on-failure: "true"
@@ -44,6 +50,9 @@ jobs:
4450
runs-on: ubuntu-latest
4551
steps:
4652
- uses: actions/checkout@v3
53+
- uses: webfactory/[email protected]
54+
with:
55+
ssh-private-key: ${{ secrets.PAILLIER_ZK }}
4756
- uses: Swatinem/rust-cache@v2
4857
with:
4958
cache-on-failure: "true"
@@ -58,6 +67,9 @@ jobs:
5867
runs-on: ubuntu-latest
5968
steps:
6069
- uses: actions/checkout@v3
70+
- uses: webfactory/[email protected]
71+
with:
72+
ssh-private-key: ${{ secrets.PAILLIER_ZK }}
6173
- uses: Swatinem/rust-cache@v2
6274
with:
6375
cache-on-failure: "true"
@@ -68,6 +80,9 @@ jobs:
6880
runs-on: ubuntu-latest
6981
steps:
7082
- uses: actions/checkout@v3
83+
- uses: webfactory/[email protected]
84+
with:
85+
ssh-private-key: ${{ secrets.PAILLIER_ZK }}
7186
- uses: Swatinem/rust-cache@v2
7287
with:
7388
cache-on-failure: "true"
@@ -84,6 +99,9 @@ jobs:
8499
runs-on: ubuntu-latest
85100
steps:
86101
- uses: actions/checkout@v3
102+
- uses: webfactory/[email protected]
103+
with:
104+
ssh-private-key: ${{ secrets.PAILLIER_ZK }}
87105
- uses: Swatinem/rust-cache@v2
88106
with:
89107
cache-on-failure: "true"
@@ -97,6 +115,9 @@ jobs:
97115
steps:
98116
- uses: dtolnay/rust-toolchain@nightly
99117
- uses: actions/checkout@v3
118+
- uses: webfactory/[email protected]
119+
with:
120+
ssh-private-key: ${{ secrets.PAILLIER_ZK }}
100121
- uses: Swatinem/rust-cache@v2
101122
with:
102123
cache-on-failure: "true"
@@ -106,6 +127,7 @@ jobs:
106127
bench:
107128
runs-on: ubuntu-latest
108129
permissions:
130+
contents: read
109131
pull-requests: write
110132
needs: build
111133
steps:
@@ -135,8 +157,17 @@ jobs:
135157
- cggmp21
136158
steps:
137159
- uses: actions/checkout@v3
160+
- uses: webfactory/[email protected]
161+
with:
162+
ssh-private-key: ${{ secrets.PAILLIER_ZK }}
138163
- uses: Swatinem/rust-cache@v2
139164
with:
140165
cache-on-failure: "true"
141166
- name: Dry-run publish
142167
run: cargo publish --dry-run -p ${{ matrix.package }}
168+
check-changelog:
169+
runs-on: ubuntu-latest
170+
steps:
171+
- uses: actions/checkout@v3
172+
- name: Check changelogs
173+
run: ./.github/changelog.sh

Cargo.lock

+31-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+39
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,42 @@ members = [
99
exclude = [
1010
"wasm/no_std",
1111
]
12+
13+
[workspace.dependencies]
14+
cggmp21 = { version = "0.4", path = "cggmp21" }
15+
cggmp21-keygen = { version = "0.3", path = "cggmp21-keygen" }
16+
key-share = { version = "0.4", path = "key-share", default-features = false }
17+
18+
generic-ec = { version = "0.4", default-features = false }
19+
generic-ec-zkp = { version = "0.4", default-features = false }
20+
round-based = { version = "0.3", default-features = false }
21+
22+
paillier-zk = "0.4"
23+
udigest = { version = "0.2", default-features = false }
24+
25+
digest = { version = "0.10", default-features = false }
26+
sha2 = { version = "0.10", default-features = false }
27+
28+
rand = "0.8"
29+
rand_core = { version = "0.6", default-features = false }
30+
rand_hash = { version = "0.1" }
31+
rand_dev = "0.1"
32+
33+
futures = "0.3"
34+
35+
anyhow = "1"
36+
thiserror = "1"
37+
displaydoc = { version = "0.2", default-features = false }
38+
39+
serde = { version = "1", default-features = false }
40+
serde_with = { version = "2", default-features = false }
41+
serde_json = "1"
42+
hex = { version = "0.4", default-features = false }
43+
44+
slip-10 = { version = "0.4", default-features = false }
45+
46+
generic-tests = "0.1"
47+
48+
[patch.crates-io.paillier-zk]
49+
git = "https://github.com/dfnsco/paillier-zk-private"
50+
rev = "88cae377c9cbd75ca27bcd99ffbce2715486ce95"

cggmp21-keygen/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## v0.3.0
4+
* security fix: derive challenges for zero-knowledge proof unambiguously
5+
* Update `udigest` to v0.2
6+
* Update `generic-ec` to v0.4
7+
* Update `slip-10` to v0.4
8+
39
## v0.2.0
410
* Make library `#![no_std]`-compatible and WASM-friendly [#100]
511
* Provide sync API to carry out DKG protocol [#100]

0 commit comments

Comments
 (0)