Skip to content

Commit

Permalink
Merge pull request #263 from dajiaji/add-hybridkem-kyber
Browse files Browse the repository at this point in the history
Add support for the hybrid post-quantum KEM (X25519Kyber768Draft00) experimentally.
  • Loading branch information
dajiaji authored Aug 19, 2023
2 parents 765f22d + 8f79e25 commit 766b529
Show file tree
Hide file tree
Showing 46 changed files with 2,837 additions and 344 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ jobs:
run: |
deno fmt --check
deno task test
- name: Run deno test for /x/hybridkem-x25519-kyber768
working-directory: ./x/hybridkem-x25519-kyber768
run: |
deno fmt --check
deno task test
- name: Run deno test for /x/dhkem-secp256k1
working-directory: ./x/dhkem-secp256k1
run: |
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/ci_browser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
cp -rf x/dhkem-x448/test/runtimes/browsers/pages/* test/runtimes/browsers/pages/dhkem-x448
mkdir test/runtimes/browsers/pages/chacha20poly1305
cp -rf x/chacha20poly1305/test/runtimes/browsers/pages/* test/runtimes/browsers/pages/chacha20poly1305
mkdir test/runtimes/browsers/pages/hybridkem-x25519-kyber768
cp -rf x/hybridkem-x25519-kyber768/test/runtimes/browsers/pages/* test/runtimes/browsers/pages/hybridkem-x25519-kyber768
mkdir test/runtimes/browsers/pages/dhkem-secp256k1
cp -rf x/dhkem-secp256k1/test/runtimes/browsers/pages/* test/runtimes/browsers/pages/dhkem-secp256k1
- working-directory: ./core
Expand All @@ -45,6 +47,7 @@ jobs:
deno task minify > ../test/runtimes/browsers/pages/dhkem-x25519/src/hpke-core.js
deno task minify > ../test/runtimes/browsers/pages/dhkem-x448/src/hpke-core.js
deno task minify > ../test/runtimes/browsers/pages/chacha20poly1305/src/hpke-core.js
deno task minify > ../test/runtimes/browsers/pages/hybridkem-x25519-kyber768/src/hpke-core.js
deno task minify > ../test/runtimes/browsers/pages/dhkem-secp256k1/src/hpke-core.js
- working-directory: ./x/dhkem-x25519
run: |
Expand All @@ -61,6 +64,11 @@ jobs:
npx typedoc --name "@hpke/chacha20poly1305 $(git describe --tags --abbrev=0)" --out ../../test/runtimes/browsers/pages/chacha20poly1305/docs mod.ts
deno task dnt
deno task minify > ../../test/runtimes/browsers/pages/chacha20poly1305/src/hpke-chacha20poly1305.js
- working-directory: ./x/hybridkem-x25519-kyber768
run: |
npx typedoc --name "@hpke/hybridkem-x25519-kyber768 $(git describe --tags --abbrev=0)" --out ../../test/runtimes/browsers/pages/hybridkem-x25519-kyber768/docs mod.ts
deno task dnt
deno task minify > ../../test/runtimes/browsers/pages/hybridkem-x25519-kyber768/src/hpke-hybridkem-x25519-kyber768.js
- working-directory: ./x/dhkem-secp256k1
run: |
npx typedoc --name "@hpke/dhkem-secp256k1 $(git describe --tags --abbrev=0)" --out ../../test/runtimes/browsers/pages/dhkem-secp256k1/docs mod.ts
Expand Down Expand Up @@ -91,5 +99,7 @@ jobs:
run: npm install && npx playwright install && npx playwright test
- working-directory: ./x/chacha20poly1305/test/runtimes/browsers
run: npm install && npx playwright install && npx playwright test
- working-directory: ./x/hybridkem-x25519-kyber768/test/runtimes/browsers
run: npm install && npx playwright install && npx playwright test
- working-directory: ./x/dhkem-secp256k1/test/runtimes/browsers
run: npm install && npx playwright install && npx playwright test
11 changes: 11 additions & 0 deletions .github/workflows/ci_bun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
deno task minify > ../x/dhkem-x25519/test/runtimes/hpke-core.js
deno task minify > ../x/dhkem-x448/test/runtimes/hpke-core.js
deno task minify > ../x/chacha20poly1305/test/runtimes/hpke-core.js
deno task minify > ../x/hybridkem-x25519-kyber768/test/runtimes/hpke-core.js
deno task minify > ../x/dhkem-secp256k1/test/runtimes/hpke-core.js
- name: Run test for core
working-directory: ./core/test/runtimes/bun
Expand Down Expand Up @@ -82,6 +83,16 @@ jobs:
nohup bun src/index.js &
sleep 3
deno test chacha20poly1305.spec.ts --allow-net
- working-directory: ./x/hybridkem-x25519-kyber768
run: |
deno task dnt
deno task minify > test/runtimes/hpke-hybridkem-x25519-kyber768.js
- name: Run test for hybridkem-x25519-kyber768
working-directory: ./x/hybridkem-x25519-kyber768/test/runtimes/bun
run: |
nohup bun src/index.js &
sleep 3
deno test hybridkem-x25519-kyber768.spec.ts --allow-net
- working-directory: ./x/dhkem-secp256k1/
run: |
deno task dnt
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/ci_cloudflare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
deno task minify > ../x/dhkem-x25519/test/runtimes/hpke-core.js
deno task minify > ../x/dhkem-x448/test/runtimes/hpke-core.js
deno task minify > ../x/chacha20poly1305/test/runtimes/hpke-core.js
deno task minify > ../x/hybridkem-x25519-kyber768/test/runtimes/hpke-core.js
deno task minify > ../x/dhkem-secp256k1/test/runtimes/hpke-core.js
- name: Run test for core
working-directory: ./core/test/runtimes/cloudflare
Expand Down Expand Up @@ -79,6 +80,17 @@ jobs:
nohup npm start &
sleep 3
deno test chacha20poly1305.spec.ts --allow-net
- working-directory: ./x/hybridkem-x25519-kyber768
run: |
deno task dnt
deno task minify > test/runtimes/hpke-hybridkem-x25519-kyber768.js
- name: Run test for hybridkem-x25519-kyber768
working-directory: ./x/hybridkem-x25519-kyber768/test/runtimes/cloudflare
run: |
npm install
nohup npm start &
sleep 3
deno test hybridkem-x25519-kyber768.spec.ts --allow-net
- working-directory: ./x/dhkem-secp256k1
run: |
deno task dnt
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/ci_node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ jobs:
run: |
deno task dnt
deno task minify > ./npm/hpke-chacha20poly1305.min.js
- name: Run dnt & minify for /x/hybridkem-x25519-kyber768
working-directory: ./x/hybridkem-x25519-kyber768
run: |
deno task dnt
deno task minify > ./npm/hpke-hybridkem-x25519-kyber768.min.js
- name: Run dnt & minify for /x/dhkem-secp256k1
working-directory: ./x/dhkem-secp256k1
run: |
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,27 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

publish-hybridkem-x25519-kyber768:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Run dnt
working-directory: ./x/hybridkem-x25519-kyber768
run: |
npm install -g esbuild
deno task dnt
- working-directory: ./x/hybridkem-x25519-kyber768/npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

publish-dhkem-secp256k1:
runs-on: ubuntu-latest
steps:
Expand Down
Loading

0 comments on commit 766b529

Please sign in to comment.