Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ jobs:
run: go build -v ./...

- name: Test
run: |
go test -v --count=1 ./...
run:
make test
28 changes: 21 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
test: test_token test_type1 test_type2 test_type3 test_type5 test_typeBatched
go test ./... --count=1
test: test_token test_type1 test_type1_amortized test_type2 test_type3 test_type5 test_type5_amortized test_typeBatched
go test ./... -run TestVectorVerifyToken --count=1

vectors: test
AMORTIZED_TYPE1_ISSUANCE_TEST_VECTORS_OUT=type1-issuance-test-vectors.json go test -v -run TestVectorGenerateAmortizedBasicPrivateIssuance ./...
AMORTIZED_TYPE5_ISSUANCE_TEST_VECTORS_OUT=type1-issuance-test-vectors.json go test -v -run TestVectorGenerateAmortizedRistrettoPrivateIssuance ./...
BATCHED_ISSUANCE_TEST_VECTORS_OUT=batched-issuance-test-vectors.json go test -v -run TestVectorGenerateBatchedIssuance ./...
ED25519_BLINDING_TEST_VECTORS_OUT=type3-ed25519-blinding-test-vectors.json go test -v -run TestVectorGenerateEd25519Blinding ./...
ECDSA_BLINDING_TEST_VECTORS_OUT=type3-ecdsa-blinding-test-vectors.json go test -v -run TestVectorGenerateECDSABlinding ./...
TOKEN_TEST_VECTORS_OUT=token-test-vectors.json go test -v -run TestVectorGenerateToken ./...
TYPE1_ISSUANCE_TEST_VECTORS_OUT=type1-issuance-test-vectors.json go test -v -run TestVectorGenerateBasicPrivateIssuance ./...
TYPE5_ISSUANCE_TEST_VECTORS_OUT=type5-issuance-test-vectors.json go test -v -run TestVectorGenerateBatchedPrivateIssuance ./...
TYPE2_ISSUANCE_TEST_VECTORS_OUT=type2-issuance-test-vectors.json go test -v -run TestVectorGenerateBasicIssuance ./...
TYPE3_ANON_ORIGIN_ID_TEST_VECTORS_OUT=type3-anon-origin-id-test-vectors.json go test -v -run TestVectorGenerateAnonOriginID ./...
TYPE3_ORIGIN_ENCRYPTION_TEST_VECTORS_OUT=type3-origin-encryption-test-vectors.json go test -v -run TestVectorGenerateOriginEncryption ./...
TYPE5_ISSUANCE_TEST_VECTORS_OUT=type5-issuance-test-vectors.json go test -v -run TestVectorGenerateRistrettoPrivateIssuance ./...

bench:
go test -bench=.
Expand All @@ -21,9 +23,15 @@ test_token:

test_type1:
TYPE1_ISSUANCE_TEST_VECTORS_IN=type1-issuance-test-vectors.json \
go test -v --count=1 ./tokens/type1/...
go test -v --count=1 -run TestVectorVerifyBasicPrivateIssuance ./tokens/private/...
TYPE1_ISSUANCE_TEST_VECTORS_IN=type1-issuance-test-vectors.rust.json \
go test -v --count=1 ./tokens/type1/...
go test -v --count=1 -run TestVectorVerifyBasicPrivateIssuance ./tokens/private/...

test_type1_amortized:
AMORTIZED_TYPE1_ISSUANCE_TEST_VECTORS_IN=type1-issuance-test-vectors.json \
go test -v --count=1 -run TestVectorVerifyAmortizedBasicPrivateIssuance ./tokens/amortized/...
AMORTIZED_TYPE1_ISSUANCE_TEST_VECTORS_IN=type1-issuance-test-vectors.rust.json \
go test -v --count=1 -run TestVectorVerifyAmortizedBasicPrivateIssuance ./tokens/amortized/...

test_type2:
TYPE2_ISSUANCE_TEST_VECTORS_IN=type2-issuance-test-vectors.json \
Expand All @@ -40,9 +48,15 @@ test_type3:

test_type5:
TYPE5_ISSUANCE_TEST_VECTORS_IN=type5-issuance-test-vectors.json \
go test -v --count=1 ./tokens/type5/...
go test -v --count=1 -run TestVectorVerifyRistrettoPrivateIssuance ./tokens/private/...
TYPE5_ISSUANCE_TEST_VECTORS_IN=type5-issuance-test-vectors.rust.json \
go test -v --count=1 ./tokens/type5/...
go test -v --count=1 -run TestVectorVerifyRistrettoPrivateIssuance ./tokens/private/...

test_type5_amortized:
AMORTIZED_TYPE5_ISSUANCE_TEST_VECTORS_IN=type5-issuance-test-vectors.json \
go test -v --count=1 -run TestVectorVerifyAmortizedRistrettoPrivateIssuance ./tokens/amortized/...
AMORTIZED_TYPE5_ISSUANCE_TEST_VECTORS_IN=type5-issuance-test-vectors.rust.json \
go test -v --count=1 -run TestVectorVerifyAmortizedRistrettoPrivateIssuance ./tokens/amortized/...

test_typeBatched:
BATCHED_ISSUANCE_TEST_VECTORS_IN=batched-issuance-test-vectors.json \
Expand Down
9 changes: 8 additions & 1 deletion scripts/format_test_vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,25 @@ def format_vector(vector_keys, vector_fname):
]
format_vector(ordered_keys, sys.argv[1])

if "type5-issuance" in sys.argv[1]:
if "type1-issuance" in sys.argv[1]:
ordered_keys = [
"skS", "pkS", "token_challenge", "nonces", "blinds", "salt", "token_request", "token_response", "tokens"
]
format_vector(ordered_keys, sys.argv[1])
exit(0)

if "type1-issuance" in sys.argv[1]:
ordered_keys = [
"skS", "pkS", "token_challenge", "nonce", "blind", "token_request", "token_response", "token"
]
format_vector(ordered_keys, sys.argv[1])

if "type5-issuance" in sys.argv[1]:
ordered_keys = [
"skS", "pkS", "token_challenge", "nonce", "blind", "token_request", "token_response", "token"
]
format_vector(ordered_keys, sys.argv[1])

if "batched-issuance-test-vectors.json" in sys.argv[1]:
ordered_keys = [
("issuance", ["type", "skS", "pkS", "token_challenge", "nonce", "nonces", "blind", "blinds", "token", "tokens"]),
Expand Down
Loading