diff --git a/.github/workflows/ci_browser.yml b/.github/workflows/ci_browser.yml index a31eaa6e8..54b432224 100644 --- a/.github/workflows/ci_browser.yml +++ b/.github/workflows/ci_browser.yml @@ -30,12 +30,12 @@ jobs: cp -rf x/dhkem-x25519/test/runtimes/browsers/pages/* test/runtimes/browsers/pages/dhkem-x25519 mkdir test/runtimes/browsers/pages/dhkem-secp256k1 cp -rf x/dhkem-secp256k1/test/runtimes/browsers/pages/* test/runtimes/browsers/pages/dhkem-secp256k1 - deno task minify > test/runtimes/browsers/pages/dhkem-secp256k1/src/hpke.js - working-directory: ./core run: | deno task dnt deno task minify > ../test/runtimes/browsers/pages/core/src/hpke-core.js deno task minify > ../test/runtimes/browsers/pages/dhkem-x25519/src/hpke-core.js + deno task minify > ../test/runtimes/browsers/pages/dhkem-secp256k1/src/hpke-core.js - working-directory: ./x/dhkem-x25519 run: | deno task dnt diff --git a/.github/workflows/ci_bun.yml b/.github/workflows/ci_bun.yml index 48e46550f..68b737aa1 100644 --- a/.github/workflows/ci_bun.yml +++ b/.github/workflows/ci_bun.yml @@ -29,7 +29,6 @@ jobs: npm install -g esbuild deno task dnt deno task minify > test/runtimes/hpke.js - deno task minify > x/dhkem-secp256k1/test/runtimes/hpke.js - uses: antongolub/action-setup-bun@v1 with: bun-version: ${{ matrix.bun-version }} @@ -44,6 +43,7 @@ jobs: deno task dnt deno task minify > test/runtimes/hpke-core.js deno task minify > ../x/dhkem-x25519/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 run: | diff --git a/.github/workflows/ci_cloudflare.yml b/.github/workflows/ci_cloudflare.yml index f4cb77683..54aca7edf 100644 --- a/.github/workflows/ci_cloudflare.yml +++ b/.github/workflows/ci_cloudflare.yml @@ -24,7 +24,6 @@ jobs: npm install -g esbuild deno task dnt deno task minify > test/runtimes/hpke.js - deno task minify > x/dhkem-secp256k1/test/runtimes/hpke.js - name: Run test working-directory: ./test/runtimes/cloudflare run: | @@ -37,6 +36,7 @@ jobs: deno task dnt deno task minify > test/runtimes/hpke-core.js deno task minify > ../x/dhkem-x25519/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 run: | diff --git a/x/dhkem-secp256k1/test/runtimes/browsers/dhkem-secp256k1.spec.ts b/x/dhkem-secp256k1/test/runtimes/browsers/dhkem-secp256k1.spec.ts index 11ddc7ad9..96d8beb05 100644 --- a/x/dhkem-secp256k1/test/runtimes/browsers/dhkem-secp256k1.spec.ts +++ b/x/dhkem-secp256k1/test/runtimes/browsers/dhkem-secp256k1.spec.ts @@ -4,6 +4,6 @@ test("basic test", async ({ page }) => { await page.goto("https://dajiaji.github.io/hpke-js/dhkem-secp256k1"); await page.click("text=run"); await page.waitForTimeout(5000); - await expect(page.locator("id=pass")).toHaveText("9"); + await expect(page.locator("id=pass")).toHaveText("6"); await expect(page.locator("id=fail")).toHaveText("0"); }); diff --git a/x/dhkem-secp256k1/test/runtimes/browsers/pages/index.html b/x/dhkem-secp256k1/test/runtimes/browsers/pages/index.html index 6140aaaee..1cef3e6f6 100644 --- a/x/dhkem-secp256k1/test/runtimes/browsers/pages/index.html +++ b/x/dhkem-secp256k1/test/runtimes/browsers/pages/index.html @@ -1,8 +1,8 @@ - hpke-js test + @hpke/dhkem-secp256k1 test -

hpke-js test

+

@hpke/dhkem-secp256k1 test

diff --git a/x/dhkem-secp256k1/test/runtimes/bun/dhkem-secp256k1.spec.ts b/x/dhkem-secp256k1/test/runtimes/bun/dhkem-secp256k1.spec.ts index d6f25d7da..565a64aa0 100644 --- a/x/dhkem-secp256k1/test/runtimes/bun/dhkem-secp256k1.spec.ts +++ b/x/dhkem-secp256k1/test/runtimes/bun/dhkem-secp256k1.spec.ts @@ -5,7 +5,7 @@ describe("Bun", () => { describe("GET /test", () => { it("should return ok", async () => { for (const kdf of ["0x0001", "0x0002", "0x0003"]) { - for (const aead of ["0x0001", "0x0002", "0x0003"]) { + for (const aead of ["0x0001", "0x0002"]) { const res = await fetch( `http://localhost:3001/test?kdf=${kdf}&aead=${aead}`, ); diff --git a/x/dhkem-secp256k1/test/runtimes/cloudflare/dhkem-secp256k1.spec.ts b/x/dhkem-secp256k1/test/runtimes/cloudflare/dhkem-secp256k1.spec.ts index 2656cc0e5..40ff9cb74 100644 --- a/x/dhkem-secp256k1/test/runtimes/cloudflare/dhkem-secp256k1.spec.ts +++ b/x/dhkem-secp256k1/test/runtimes/cloudflare/dhkem-secp256k1.spec.ts @@ -5,7 +5,7 @@ describe("Cloudflare Workers", () => { describe("GET /test", () => { it("should return ok", async () => { for (const kdf of ["0x0001", "0x0002", "0x0003"]) { - for (const aead of ["0x0001", "0x0002", "0x0003"]) { + for (const aead of ["0x0001", "0x0002"]) { const res = await fetch( `http://localhost:8788/test?kdf=${kdf}&aead=${aead}`, ); diff --git a/x/dhkem-secp256k1/test/runtimes/server.js b/x/dhkem-secp256k1/test/runtimes/server.js index 82359a068..c6c617fa7 100644 --- a/x/dhkem-secp256k1/test/runtimes/server.js +++ b/x/dhkem-secp256k1/test/runtimes/server.js @@ -1,5 +1,5 @@ -import * as hpke from "./hpke.js"; -import * as secp256k1 from "./hpke-dhkem-secp256k1.js"; +import * as hpke from "./hpke-core.js"; +import { DhkemSecp256k1HkdfSha256 } from "./hpke-dhkem-secp256k1.js"; export async function testServer(request) { const url = new URL(request.url); @@ -12,7 +12,7 @@ export async function testServer(request) { if (kdfStr === null || aeadStr === null) { return new Response("ng: invalid params"); } - const kem = new secp256k1.DhkemSecp256k1HkdfSha256(); + const kem = new DhkemSecp256k1HkdfSha256(); const kdf = Number.parseInt(kdfStr); const aead = Number.parseInt(aeadStr); if (Number.isNaN(kdf) || Number.isNaN(aead)) {