-
Notifications
You must be signed in to change notification settings - Fork 3
/
fetch-test-vectors.sh
executable file
·45 lines (38 loc) · 1.07 KB
/
fetch-test-vectors.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
FILE=fixtures
if [ -d "$FILE" ]; then
echo "$FILE directory already fetched; delete to refetch."
exit
fi
mkdir -p fixtures
urlPrefix="https://raw.githubusercontent.com/decentralized-identity/bbs-signature/main/tooling/fixtures/fixture_data/"
fetch_file() {
local suite=$1
local file=$2
local url="$urlPrefix/$suite/$file"
echo "Fetching $url"
wget -q -O "fixtures/$suite/$file" "$url"
}
suites=("bls12-381-sha-256" "bls12-381-shake-256")
for suite in "${suites[@]}"; do
echo "Fetching $suite fixtures"
mkdir -p fixtures/$suite
files=(
"generators.json"
"MapMessageToScalarAsHash.json"
"h2s.json"
"keypair.json"
"mockedRng.json"
)
for file in "${files[@]}"; do
fetch_file "$suite" "$file"
done
for ((i = 1; i <= 10; i++)); do
mkdir -p fixtures/$suite/signature
fetch_file "$suite" "signature/signature$(printf "%.3d" "$i").json"
done
for ((i = 1; i <= 15; i++)); do
mkdir -p fixtures/$suite/proof
fetch_file "$suite" "proof/proof$(printf "%.3d" "$i").json"
done
done