Skip to content

Commit

Permalink
Merge pull request #20 from dajiaji/bump-to-1_0_0
Browse files Browse the repository at this point in the history
Bump version up to 1.0.0.
  • Loading branch information
dajiaji authored Sep 11, 2023
2 parents a4bacbe + dc009fe commit d5efe76
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 30 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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"
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div align="center">

[![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)
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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";
Expand All @@ -116,7 +116,7 @@ Using esm.sh:
```html
<!-- use a specific version -->
<script type="module">
import { Kyber768 } from "https://esm.sh/crystals-kyber-js@0.3.1";
import { Kyber768 } from "https://esm.sh/crystals-kyber-js@1.0.0";
// ...
</script>

Expand All @@ -132,7 +132,7 @@ Using unpkg:
```html
<!-- use a specific version -->
<script type="module">
import { Kyber768 } from "https://unpkg.com/crystals-kyber-js@0.3.1";
import { Kyber768 } from "https://unpkg.com/crystals-kyber-js@1.0.0";
// ...
</script>
```
Expand Down Expand Up @@ -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;
}

Expand All @@ -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() {

Expand All @@ -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;
}

Expand All @@ -210,7 +210,7 @@ try {
<head></head>
<body>
<script type="module">
import { Kyber1024 } from "https://esm.sh/crystals-kyber@0.3.1";
import { Kyber1024 } from "https://esm.sh/crystals-kyber@1.0.0";
globalThis.doKyber = async () => {
try {
Expand All @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

| Version | Supported |
| ------- | ------------------ |
| 0.3.x | :white_check_mark: |
| 1.0.x | :white_check_mark: |
| < 1.0 | :x: |

## Reporting a Vulnerability

Expand Down
3 changes: 1 addition & 2 deletions src/kyber1024.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 3 additions & 4 deletions src/kyber512.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 3 additions & 4 deletions src/kyber768.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/kyberBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Uint8Array> {
Expand Down
2 changes: 0 additions & 2 deletions test/kyber1024.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand All @@ -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);
});
});
Expand Down
2 changes: 0 additions & 2 deletions test/kyber512.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand All @@ -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);
});
});
Expand Down
4 changes: 0 additions & 4 deletions test/kyber768.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand All @@ -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);
});
});
Expand Down

0 comments on commit d5efe76

Please sign in to comment.