Skip to content

Commit 0943c7a

Browse files
committed
Initial release, version 0.4
0 parents  commit 0943c7a

File tree

234 files changed

+149832
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

234 files changed

+149832
-0
lines changed

.github/workflows/CI.yml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
name: CI Workflow
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'creds/**'
9+
- 'forks/**'
10+
- 'circuit_setup/**'
11+
- 'samples/**'
12+
pull_request:
13+
branches:
14+
- main
15+
paths:
16+
- 'creds/**'
17+
- 'forks/**'
18+
- 'circuit_setup/**'
19+
- 'samples/**'
20+
21+
jobs:
22+
build_and_test:
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Check out the project
27+
uses: actions/checkout@v3
28+
29+
- name: Set up Python
30+
uses: actions/setup-python@v4
31+
with:
32+
python-version: '3.x'
33+
34+
- name: Install dependencies
35+
run: |
36+
sudo apt update
37+
sudo apt install -y python3-pip nodejs
38+
curl --proto '=https' --tlsv1.3 -sSf https://sh.rustup.rs | sh -s -- -y
39+
source $HOME/.cargo/env
40+
pip install python_jwt
41+
git clone https://github.com/iden3/circom.git
42+
cd circom
43+
git checkout v2.1.6
44+
cargo build --release
45+
cargo install --path circom
46+
export PATH=$PATH:~/.cargo/bin
47+
cd ..
48+
git submodule update --init --recursive
49+
pip install git+https://github.com/peppelinux/pyMDOC-CBOR.git
50+
51+
- name: Run circuit setup for rs256
52+
run: |
53+
cd circuit_setup/scripts
54+
./run_setup.sh rs256
55+
56+
- name: Run circuit setup for mDL
57+
run: |
58+
cd circuit_setup/scripts
59+
./run_setup.sh mdl1
60+
61+
- name: Run clippy for /creds
62+
run: |
63+
cd creds
64+
../clippy_command.sh
65+
66+
- name: Run cargo test for /creds
67+
run: |
68+
cd creds
69+
cargo test --release
70+
71+
# RS256 Commands
72+
- name: Run ZKSetup for rs256
73+
run: |
74+
cd creds
75+
cargo run --bin crescent --release --features print-trace zksetup --name rs256
76+
77+
- name: Run Prove for rs256
78+
run: |
79+
cd creds
80+
cargo run --bin crescent --release --features print-trace prove --name rs256
81+
82+
- name: Run Show for rs256
83+
run: |
84+
cd creds
85+
cargo run --bin crescent --release --features print-trace show --name rs256
86+
87+
- name: Run Verify for rs256
88+
run: |
89+
cd creds
90+
cargo run --bin crescent --release --features print-trace verify --name rs256
91+
92+
# mDL Commands
93+
- name: Run ZKSetup for mDL
94+
run: |
95+
cd creds
96+
cargo run --bin crescent --release --features print-trace zksetup --name mdl1
97+
98+
- name: Run Prove for mDL
99+
run: |
100+
cd creds
101+
cargo run --bin crescent --release --features print-trace prove --name mdl1
102+
103+
- name: Run Show for mDL
104+
run: |
105+
cd creds
106+
cargo run --bin crescent --release --features print-trace show --name mdl1
107+
108+
- name: Run Verify for mDL
109+
run: |
110+
cd creds
111+
cargo run --bin crescent --release --features print-trace verify --name mdl1
112+
113+
# Build sample
114+
- name: Run the sample setup script
115+
run: |
116+
cd sample
117+
./setup-sample.sh

.github/workflows/codeql.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL Advanced"
13+
14+
on:
15+
push:
16+
branches: [ "main" ]
17+
pull_request:
18+
branches: [ "main" ]
19+
schedule:
20+
- cron: '33 6 * * 1'
21+
22+
jobs:
23+
analyze:
24+
name: Analyze (${{ matrix.language }})
25+
# Runner size impacts CodeQL analysis time. To learn more, please see:
26+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
27+
# - https://gh.io/supported-runners-and-hardware-resources
28+
# - https://gh.io/using-larger-runners (GitHub.com only)
29+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
30+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
31+
permissions:
32+
# required for all workflows
33+
security-events: write
34+
35+
# required to fetch internal or private CodeQL packs
36+
packages: read
37+
38+
# only required for workflows in private repositories
39+
actions: read
40+
contents: read
41+
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
include:
46+
- language: python
47+
build-mode: none
48+
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
49+
# Use `c-cpp` to analyze code written in C, C++ or both
50+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
51+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
52+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
53+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
54+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
55+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
56+
steps:
57+
- name: Checkout repository
58+
uses: actions/checkout@v4
59+
60+
# Initializes the CodeQL tools for scanning.
61+
- name: Initialize CodeQL
62+
uses: github/codeql-action/init@v3
63+
with:
64+
languages: ${{ matrix.language }}
65+
build-mode: ${{ matrix.build-mode }}
66+
# If you wish to specify custom queries, you can do so here or in a config file.
67+
# By default, queries listed here will override any specified in a config file.
68+
# Prefix the list here with "+" to use these queries and those in the config file.
69+
70+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
71+
# queries: security-extended,security-and-quality
72+
73+
# If the analyze step fails for one of the languages you are analyzing with
74+
# "We were unable to automatically build your code", modify the matrix above
75+
# to set the build mode to "manual" for that language. Then modify this step
76+
# to build your code.
77+
# ℹ️ Command-line programs to run using the OS shell.
78+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
79+
- if: matrix.build-mode == 'manual'
80+
shell: bash
81+
run: |
82+
echo 'If you are using a "manual" build mode for one or more of the' \
83+
'languages you are analyzing, replace this with the commands to build' \
84+
'your code, for example:'
85+
echo ' make bootstrap'
86+
echo ' make release'
87+
exit 1
88+
89+
- name: Perform CodeQL Analysis
90+
uses: github/codeql-action/analyze@v3
91+
with:
92+
category: "/language:${{matrix.language}}"

.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.vscode/
2+
target/
3+
Cargo.lock
4+
5+
# ignore test vectors, but not the README
6+
creds/test-vectors
7+
!creds/test-vectors/README
8+
9+
# sample files
10+
sample/issuer/.well-known/
11+
sample/issuer/keys/
12+
sample/client/.vscode/crescent-client-extension.code-workspace
13+
sample/client/node_modules
14+
sample/client/dist
15+
sample/client_helper/data
16+
sample/verifier/data
17+
18+
# sample credentials that are generated
19+
circuit_setup/inputs/*/issuer.prv
20+
circuit_setup/inputs/*/issuer.pub
21+
circuit_setup/inputs/*/token.jwt
22+
23+
setup/generated_files/

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "setup/circom/circomlib"]
2+
path = circuit_setup/circuits/circomlib
3+
url = https://github.com/iden3/circomlib

CODE_OF_CONDUCT.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Microsoft Open Source Code of Conduct
2+
3+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
4+
5+
Resources:
6+
7+
- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
8+
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
9+
- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Microsoft Corporation.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE

0 commit comments

Comments
 (0)