From 120e6ce7a8c2f3ca3e3f88b15bc1f955304b52b2 Mon Sep 17 00:00:00 2001 From: Ajitomi Daisuke Date: Mon, 11 Sep 2023 20:07:23 +0900 Subject: [PATCH 1/3] Fix path to badge. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dcec797..acd23c7 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@
[![deno doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/deno.land/x/crystals_kyber/mod.ts) -![Browser CI](https://github.com/dajiaji/crystals-kyber-js/actions/workflows/ci_browser.yml/badge.svg) +![Browser CI](https://github.com/dajiaji/crystals-kyber-js/actions/workflows/ci_browsers.yml/badge.svg) ![Node.js CI](https://github.com/dajiaji/crystals-kyber-js/actions/workflows/ci_node.yml/badge.svg) ![Deno CI](https://github.com/dajiaji/crystals-kyber-js/actions/workflows/ci_deno.yml/badge.svg) ![Cloudflare Workers CI](https://github.com/dajiaji/crystals-kyber-js/actions/workflows/ci_cloudflare.yml/badge.svg) From 706cf117f9d48be7df664d24fa118a1589d6347f Mon Sep 17 00:00:00 2001 From: Ajitomi Daisuke Date: Mon, 11 Sep 2023 20:20:00 +0900 Subject: [PATCH 2/3] Remove console.assert from sample. --- README.md | 8 ++++---- src/kyber1024.ts | 3 +-- src/kyber512.ts | 7 +++---- src/kyber768.ts | 7 +++---- src/kyberBase.ts | 2 +- test/kyber1024.test.ts | 2 -- test/kyber512.test.ts | 2 -- test/kyber768.test.ts | 4 ---- 8 files changed, 12 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index acd23c7..6ac0edc 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ async function doKyber() { // The recipient decapsulates the ciphertext and generates the same shared secret with skR. const ssR = await recipient.decap(ct, skR); - console.assert(ssS === ssR, "The two shared secrets must match."); + // ssS === ssR return; } @@ -166,7 +166,7 @@ async function doKyber() { const ssR = await recipient.decap(ct, skR); - console.assert(ssS === ssR, "The two shared secrets must match."); + // ssS === ssR return; } @@ -192,7 +192,7 @@ async function doKyber() { const ssR = await recipient.decap(ct, skR); - console.assert(ssS === ssR, "The two shared secrets must match."); + // ssS === ssR return; } @@ -222,7 +222,7 @@ try { const ssR = await recipient.decap(ct, skR); - console.assert(ssS === ssR, "The two shared secrets must match."); + // ssS === ssR return; } catch (err) { alert("failed: ", err.message); diff --git a/src/kyber1024.ts b/src/kyber1024.ts index 8f42add..f807132 100644 --- a/src/kyber1024.ts +++ b/src/kyber1024.ts @@ -23,8 +23,7 @@ import { byte, int16, uint16, uint32 } from "./utils.ts"; * const [ct, ssS] = await sender.encap(pkR); * const ssR = await recipient.decap(ct, skR); - - * console.assert(ssS === ssR, "The two shared secrets must match."); + * // ssS === ssR * ``` */ export class Kyber1024 extends KyberBase { diff --git a/src/kyber512.ts b/src/kyber512.ts index f0b9487..63b57d5 100644 --- a/src/kyber512.ts +++ b/src/kyber512.ts @@ -18,13 +18,12 @@ import { byteopsLoad24, int16, prf } from "./utils.ts"; * * const recipient = new Kyber512(); * const [pkR, skR] = await recipient.generateKeyPair(); - + * * const sender = new Kyber512(); * const [ct, ssS] = await sender.encap(pkR); - + * * const ssR = await recipient.decap(ct, skR); - - * console.assert(ssS === ssR, "The two shared secrets must match."); + * // ssS === ssR * ``` */ export class Kyber512 extends KyberBase { diff --git a/src/kyber768.ts b/src/kyber768.ts index be925d4..e0a7490 100644 --- a/src/kyber768.ts +++ b/src/kyber768.ts @@ -17,13 +17,12 @@ import { KyberBase } from "./kyberBase.ts"; * * const recipient = new Kyber768(); * const [pkR, skR] = await recipient.generateKeyPair(); - + * * const sender = new Kyber768(); * const [ct, ssS] = await sender.encap(pkR); - + * * const ssR = await recipient.decap(ct, skR); - - * console.assert(ssS === ssR, "The two shared secrets must match."); + * // ssS === ssR * ``` */ export class Kyber768 extends KyberBase { diff --git a/src/kyberBase.ts b/src/kyberBase.ts index 104c33c..1ae535d 100644 --- a/src/kyberBase.ts +++ b/src/kyberBase.ts @@ -163,7 +163,7 @@ export class KyberBase { * const [pk, sk] = await kyber.generateKeyPair(); * const [ct, ssS] = await kyber.encap(pk); * const ssR = await kyber.decap(ct, sk); - * console.assert(ssS === ssR, "The two shared secrets must match."); + * // ssS === ssR * ``` */ public async decap(ct: Uint8Array, sk: Uint8Array): Promise { diff --git a/test/kyber1024.test.ts b/test/kyber1024.test.ts index 495b5c7..c76a41f 100644 --- a/test/kyber1024.test.ts +++ b/test/kyber1024.test.ts @@ -80,7 +80,6 @@ describe("Kyber1024", () => { const ssR = await recipient.decap(ct, skR); - console.assert(ssS === ssR, "The two shared secrets must match."); assertEquals(ssS, ssR); }); @@ -99,7 +98,6 @@ describe("Kyber1024", () => { const ssR = await recipient.decap(ct, skR); - console.assert(ssS === ssR, "The two shared secrets must match."); assertEquals(ssS, ssR); }); }); diff --git a/test/kyber512.test.ts b/test/kyber512.test.ts index b84e3fd..e360ba9 100644 --- a/test/kyber512.test.ts +++ b/test/kyber512.test.ts @@ -80,7 +80,6 @@ describe("Kyber512", () => { const ssR = await recipient.decap(ct, skR); - console.assert(ssS === ssR, "The two shared secrets must match."); assertEquals(ssS, ssR); }); @@ -99,7 +98,6 @@ describe("Kyber512", () => { const ssR = await recipient.decap(ct, skR); - console.assert(ssS === ssR, "The two shared secrets must match."); assertEquals(ssS, ssR); }); }); diff --git a/test/kyber768.test.ts b/test/kyber768.test.ts index 6f6859a..67ca665 100644 --- a/test/kyber768.test.ts +++ b/test/kyber768.test.ts @@ -79,8 +79,6 @@ describe("Kyber768", () => { const [ct, ssS] = await sender.encap(pkR); const ssR = await recipient.decap(ct, skR); - - console.assert(ssS === ssR, "The two shared secrets must match."); assertEquals(ssS, ssR); }); @@ -98,8 +96,6 @@ describe("Kyber768", () => { const [ct, ssS] = await sender.encap(pkR); const ssR = await recipient.decap(ct, skR); - - console.assert(ssS === ssR, "The two shared secrets must match."); assertEquals(ssS, ssR); }); }); From dc009fe77dc73246da984020cbe2f6111602cca9 Mon Sep 17 00:00:00 2001 From: Ajitomi Daisuke Date: Mon, 11 Sep 2023 20:30:09 +0900 Subject: [PATCH 3/3] Add dependabot.yml. --- .github/dependabot.yml | 10 ++++++++++ CHANGES.md | 7 +++++++ README.md | 10 +++++----- SECURITY.md | 3 ++- 4 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..5f31eaa --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: "npm" + directory: "/test/runtimes/browsers/" + schedule: + interval: "daily" + - package-ecosystem: "npm" + directory: "/test/runtimes/cloudflare/" + schedule: + interval: "daily" diff --git a/CHANGES.md b/CHANGES.md index bcbdd0d..079be4e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,12 @@ # Changes +## Version 1.0.0 + +Released 2023-09-11 + +- [(#19) Add CI for various JavaScript runtimes.](https://github.com/dajiaji/crystals-kyber-js/pull/19) +- [(#18) Remove KyberInterface.](https://github.com/dajiaji/crystals-kyber-js/pull/18) + ## Version 0.3.1 Released 2023-09-07 diff --git a/README.md b/README.md index 6ac0edc..ac7c138 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ Using deno.land: ```js // use a specific version -import { Kyber768 } from "https://deno.land/x/crystals_kyber@0.3.1/mod.ts"; +import { Kyber768 } from "https://deno.land/x/crystals_kyber@1.0.0/mod.ts"; // use the latest stable version import { Kyber768 } from "https://deno.land/x/crystals_kyber/mod.ts"; @@ -116,7 +116,7 @@ Using esm.sh: ```html @@ -132,7 +132,7 @@ Using unpkg: ```html ``` @@ -180,7 +180,7 @@ try { ### Deno ```js -import { Kyber512 } from "https://deno.land/x/crystals_kyber@0.3.1/mod.ts"; +import { Kyber512 } from "https://deno.land/x/crystals_kyber@1.0.0/mod.ts"; async function doKyber() { @@ -210,7 +210,7 @@ try {