From 9b00c69acd35ce7df32ed9e9ceb199c252e94b29 Mon Sep 17 00:00:00 2001 From: Puria Nafisi Azizi Date: Tue, 8 Oct 2019 16:48:03 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8D=B1=20Add=20contracts=20locally=20in?= =?UTF-8?q?=20place=20of=20a=20submodule?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/coconut_contracts/aggregate_petition_signature.zen | 9 +++++++++ app/coconut_contracts/aggregate_signature.zen | 7 +++++++ app/coconut_contracts/approve_petition.zen | 9 +++++++++ app/coconut_contracts/count_petition.zen | 5 +++++ app/coconut_contracts/create_petition.zen | 9 +++++++++ app/coconut_contracts/create_proof.zen | 8 ++++++++ app/coconut_contracts/create_request.zen | 5 +++++ app/coconut_contracts/credential_keygen.zen | 4 ++++ app/coconut_contracts/issuer_keygen.zen | 4 ++++ app/coconut_contracts/issuer_sign.zen | 7 +++++++ app/coconut_contracts/publish_verifier.zen | 4 ++++ app/coconut_contracts/sign_petition.zen | 8 ++++++++ app/coconut_contracts/tally_petition.zen | 6 ++++++ app/coconut_contracts/verify_proof.zen | 6 ++++++ app/config.ini | 2 +- app/test.ini | 2 +- 16 files changed, 93 insertions(+), 2 deletions(-) create mode 100644 app/coconut_contracts/aggregate_petition_signature.zen create mode 100644 app/coconut_contracts/aggregate_signature.zen create mode 100644 app/coconut_contracts/approve_petition.zen create mode 100644 app/coconut_contracts/count_petition.zen create mode 100644 app/coconut_contracts/create_petition.zen create mode 100644 app/coconut_contracts/create_proof.zen create mode 100644 app/coconut_contracts/create_request.zen create mode 100644 app/coconut_contracts/credential_keygen.zen create mode 100644 app/coconut_contracts/issuer_keygen.zen create mode 100644 app/coconut_contracts/issuer_sign.zen create mode 100644 app/coconut_contracts/publish_verifier.zen create mode 100644 app/coconut_contracts/sign_petition.zen create mode 100644 app/coconut_contracts/tally_petition.zen create mode 100644 app/coconut_contracts/verify_proof.zen diff --git a/app/coconut_contracts/aggregate_petition_signature.zen b/app/coconut_contracts/aggregate_petition_signature.zen new file mode 100644 index 0000000..b3a5675 --- /dev/null +++ b/app/coconut_contracts/aggregate_petition_signature.zen @@ -0,0 +1,9 @@ +Scenario coconut: aggregate petition signature +Given that I have a valid 'petition signature' +and I have a valid 'petition' +and I have a valid 'verifiers' +When the petition signature is not a duplicate +and the petition signature is just one more +and I add the signature to the petition +Then print the 'petition' +and print the 'verifiers' diff --git a/app/coconut_contracts/aggregate_signature.zen b/app/coconut_contracts/aggregate_signature.zen new file mode 100644 index 0000000..6ce9d53 --- /dev/null +++ b/app/coconut_contracts/aggregate_signature.zen @@ -0,0 +1,7 @@ +Scenario coconut: aggregate signature +Given that I am known as 'Alice' +and I have my valid 'credential keypair' +and I have a valid 'credential signature' +When I create the credentials +Then print my 'credentials' +and print my 'credential keypair' diff --git a/app/coconut_contracts/approve_petition.zen b/app/coconut_contracts/approve_petition.zen new file mode 100644 index 0000000..19ab5bc --- /dev/null +++ b/app/coconut_contracts/approve_petition.zen @@ -0,0 +1,9 @@ +Scenario coconut: approve petition +Given that I have a valid 'verifier' from 'MadHatter' +and I have a valid 'credential proof' +and I have a valid 'petition' +When I aggregate the verifiers +and I verify the credential proof +and I verify the new petition to be empty +Then print the 'petition' +and print the 'verifiers' diff --git a/app/coconut_contracts/count_petition.zen b/app/coconut_contracts/count_petition.zen new file mode 100644 index 0000000..fbe705e --- /dev/null +++ b/app/coconut_contracts/count_petition.zen @@ -0,0 +1,5 @@ +Scenario coconut: count petition +Given that I have a valid 'petition' +and I have a valid 'petition tally' +When I count the petition results +Then print the 'results' diff --git a/app/coconut_contracts/create_petition.zen b/app/coconut_contracts/create_petition.zen new file mode 100644 index 0000000..8480b98 --- /dev/null +++ b/app/coconut_contracts/create_petition.zen @@ -0,0 +1,9 @@ +Scenario coconut: create petition +Given that I am known as 'Alice' +and I have my valid 'credential keypair' +and I have my valid 'credentials' +and I have a valid 'verifier' from 'MadHatter' +When I aggregate the verifiers +and I create the credential proof +and I create the petition 'poll' +Then print all data diff --git a/app/coconut_contracts/create_proof.zen b/app/coconut_contracts/create_proof.zen new file mode 100644 index 0000000..38218ec --- /dev/null +++ b/app/coconut_contracts/create_proof.zen @@ -0,0 +1,8 @@ +Scenario coconut: create proof +Given that I am known as 'Alice' +and I have my valid 'credential keypair' +and I have a valid 'verifier' from 'MadHatter' +and I have my valid 'credentials' +When I aggregate the verifiers +and I create the credential proof +Then print the 'credential proof' diff --git a/app/coconut_contracts/create_request.zen b/app/coconut_contracts/create_request.zen new file mode 100644 index 0000000..433fdba --- /dev/null +++ b/app/coconut_contracts/create_request.zen @@ -0,0 +1,5 @@ +Scenario coconut: create request +Given that I am known as 'Alice' +and I have my valid 'credential keypair' +When I create the credential request +Then print my 'credential request' diff --git a/app/coconut_contracts/credential_keygen.zen b/app/coconut_contracts/credential_keygen.zen new file mode 100644 index 0000000..cfd780c --- /dev/null +++ b/app/coconut_contracts/credential_keygen.zen @@ -0,0 +1,4 @@ +Scenario coconut: credential keygen +Given that I am known as 'Alice' +When I create the credential keypair +Then print my 'credential keypair' diff --git a/app/coconut_contracts/issuer_keygen.zen b/app/coconut_contracts/issuer_keygen.zen new file mode 100644 index 0000000..a12a389 --- /dev/null +++ b/app/coconut_contracts/issuer_keygen.zen @@ -0,0 +1,4 @@ +Scenario coconut: issuer keygen +Given that I am known as 'MadHatter' +When I create the issuer keypair +Then print my 'issuer keypair' diff --git a/app/coconut_contracts/issuer_sign.zen b/app/coconut_contracts/issuer_sign.zen new file mode 100644 index 0000000..2219c4f --- /dev/null +++ b/app/coconut_contracts/issuer_sign.zen @@ -0,0 +1,7 @@ +Scenario coconut: issuer sign +Given that I am known as 'MadHatter' +and I have my valid 'issuer keypair' +and I have a valid 'credential request' +When I create the credential signature +Then print the 'credential signature' +and print the 'verifier' diff --git a/app/coconut_contracts/publish_verifier.zen b/app/coconut_contracts/publish_verifier.zen new file mode 100644 index 0000000..28f3a34 --- /dev/null +++ b/app/coconut_contracts/publish_verifier.zen @@ -0,0 +1,4 @@ +Scenario coconut: publish verifier +Given that I am known as 'MadHatter' +and I have my valid 'verifier' +Then print my 'verifier' diff --git a/app/coconut_contracts/sign_petition.zen b/app/coconut_contracts/sign_petition.zen new file mode 100644 index 0000000..5a8ad39 --- /dev/null +++ b/app/coconut_contracts/sign_petition.zen @@ -0,0 +1,8 @@ +Scenario coconut: sign petition +Given I am 'Alice' +and I have my valid 'credential keypair' +and I have a valid 'credentials' +and I have a valid 'verifier' from 'MadHatter' +When I aggregate the verifiers +and I create the petition signature 'poll' +Then print the 'petition signature' diff --git a/app/coconut_contracts/tally_petition.zen b/app/coconut_contracts/tally_petition.zen new file mode 100644 index 0000000..1989201 --- /dev/null +++ b/app/coconut_contracts/tally_petition.zen @@ -0,0 +1,6 @@ +Scenario coconut: tally petition +Given that I am 'Alice' +and I have my valid 'credential keypair' +and I have a valid 'petition' +When I create a petition tally +Then print all data diff --git a/app/coconut_contracts/verify_proof.zen b/app/coconut_contracts/verify_proof.zen new file mode 100644 index 0000000..40f6a56 --- /dev/null +++ b/app/coconut_contracts/verify_proof.zen @@ -0,0 +1,6 @@ +Scenario coconut: verify proof +Given that I have a valid 'verifier' from 'MadHatter' +and I have a valid 'credential proof' +When I aggregate the verifiers +and I verify the credential proof +Then print 'Success' 'OK' as 'string' diff --git a/app/config.ini b/app/config.ini index 8b14dfc..acc09f1 100644 --- a/app/config.ini +++ b/app/config.ini @@ -11,7 +11,7 @@ uid = issuer_identifier keypair = /app/app/ci_keypair.keys -contracts_path = /app/app/contracts/src +contracts_path = /app/app/coconut_contracts secret = 615872afdb35a291f56166d63399d0fa1f2a37415b24206fb051dbce294afc5c diff --git a/app/test.ini b/app/test.ini index 7a717ac..67ed9c9 100644 --- a/app/test.ini +++ b/app/test.ini @@ -2,7 +2,7 @@ debug = true uid = issuer_identifier keypair = /home/travis/build/DECODEproject/credential-issuer/tests/ci_keypair.keys -contracts_path = /home/travis/build/DECODEproject/Zenroom/test/zencode_coconut +contracts_path = /home/travis/build/DECODEproject/credential-issuer/app/coconut_contracts secret = 615872afdb35a291f56166d63399d0fa1f2a37415b24206fb051dbce294afc5c ALGORITHM = HS256