Skip to content

Commit

Permalink
Merge pull request #226 from dajiaji/bump-to-1_0_1
Browse files Browse the repository at this point in the history
Bump version up to 1.0.1.
  • Loading branch information
dajiaji authored Aug 6, 2023
2 parents 0a5b2b3 + d1966b1 commit 1534b25
Show file tree
Hide file tree
Showing 20 changed files with 133 additions and 129 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci_browser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,22 @@ jobs:
deno task minify > ../test/runtimes/browsers/pages/dhkem-secp256k1/src/hpke-core.js
- working-directory: ./x/dhkem-x25519
run: |
npx typedoc --name "@hpke/dhkem-x25519 $(git describe --tags $(git rev-list --tags --max-count=1))" --out ../test/runtimes/browsers/pages/dhkem-x25519/docs mod.ts
npx typedoc --name "@hpke/dhkem-x25519 $(git describe --tags $(git rev-list --tags --max-count=1))" --out ../../test/runtimes/browsers/pages/dhkem-x25519/docs mod.ts
deno task dnt
deno task minify > ../../test/runtimes/browsers/pages/dhkem-x25519/src/hpke-dhkem-x25519.js
- working-directory: ./x/dhkem-x448
run: |
npx typedoc --name "@hpke/dhkem-x448 $(git describe --tags $(git rev-list --tags --max-count=1))" --out ../test/runtimes/browsers/pages/dhkem-x448/docs mod.ts
npx typedoc --name "@hpke/dhkem-x448 $(git describe --tags $(git rev-list --tags --max-count=1))" --out ../../test/runtimes/browsers/pages/dhkem-x448/docs mod.ts
deno task dnt
deno task minify > ../../test/runtimes/browsers/pages/dhkem-x448/src/hpke-dhkem-x448.js
- working-directory: ./x/chacha20poly1305
run: |
npx typedoc --name "@hpke/chacha20poly1305 $(git describe --tags $(git rev-list --tags --max-count=1))" --out ../test/runtimes/browsers/pages/chacha20poly1305/docs mod.ts
npx typedoc --name "@hpke/chacha20poly1305 $(git describe --tags $(git rev-list --tags --max-count=1))" --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/dhkem-secp256k1
run: |
npx typedoc --name "@hpke/dhkem-secp256k1 $(git describe --tags $(git rev-list --tags --max-count=1))" --out ../test/runtimes/browsers/pages/dhkem-secp256k1/docs mod.ts
npx typedoc --name "@hpke/dhkem-secp256k1 $(git describe --tags $(git rev-list --tags --max-count=1))" --out ../../test/runtimes/browsers/pages/dhkem-secp256k1/docs mod.ts
deno task dnt
deno task minify > ../../test/runtimes/browsers/pages/dhkem-secp256k1/src/hpke-dhkem-secp256k1.js
- uses: peaceiris/actions-gh-pages@v3
Expand Down
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.1

Released 2023-08-06

- [(#226) Remove unnecessary ciphersuite classes.](https://github.com/dajiaji/hpke-js/pull/226)
- [(#225) Deploy tsdoc-based document to pages.](https://github.com/dajiaji/hpke-js/pull/225)

## Version 1.0.0

Released 2023-08-05
Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This module works on web browsers, Node.js, Deno and various other JavaScript ru

<div align="center">

[Documentation](https://doc.deno.land/https://deno.land/x/hpke/mod.ts)
[Doc(deno.land)](https://doc.deno.land/https://deno.land/x/hpke/mod.ts)/[Doc(pages, only for the latest version)](https://dajiaji.github.io/hpke-js/docs/)

</div>

Expand Down Expand Up @@ -181,8 +181,8 @@ Using esm.sh:
```html
<!-- use a specific version -->
<script type="module">
import * as hpke from "https://esm.sh/@hpke/core@1.0.0";
// import * as hpke from "https://esm.sh/hpke-js@1.0.0";
import * as hpke from "https://esm.sh/@hpke/core@1.0.1";
// import * as hpke from "https://esm.sh/hpke-js@1.0.1";
// ...
</script>

Expand All @@ -199,8 +199,8 @@ Using unpkg:
```html
<!-- use a specific version -->
<script type="module">
import * as hpke from "https://unpkg.com/@hpke/core@1.0.0/esm/mod.js";
// import * as hpke from "https://unpkg.com/hpke-js@1.0.0/esm/mod.js";
import * as hpke from "https://unpkg.com/@hpke/core@1.0.1/esm/mod.js";
// import * as hpke from "https://unpkg.com/hpke-js@1.0.1/esm/mod.js";
// ...
</script>
```
Expand Down Expand Up @@ -237,9 +237,9 @@ Using deno.land:

```js
// use a specific version
import * as hpke from "https://deno.land/x/hpke@1.0.0/core/mod.ts";
// import * as hpke from "https://deno.land/x/hpke@1.0.0/x/dhkem-x25519/mod.ts";
// import * as hpke from "https://deno.land/x/hpke@1.0.0/mod.ts";
import * as hpke from "https://deno.land/x/hpke@1.0.1/core/mod.ts";
// import * as hpke from "https://deno.land/x/hpke@1.0.1/x/dhkem-x25519/mod.ts";
// import * as hpke from "https://deno.land/x/hpke@1.0.1/mod.ts";

// use the latest stable version
import * as hpke from "https://deno.land/x/hpke/core/mod.ts";
Expand Down Expand Up @@ -283,8 +283,8 @@ Browsers:
<head></head>
<body>
<script type="module">
import { KemId, KdfId, AeadId, CipherSuite } from "https://esm.sh/@hpke/core@1.0.0";
// import { KemId, KdfId, AeadId, CipherSuite } from "https://esm.sh/hpke-js@1.0.0";
import { KemId, KdfId, AeadId, CipherSuite } from "https://esm.sh/@hpke/core@1.0.1";
// import { KemId, KdfId, AeadId, CipherSuite } from "https://esm.sh/hpke-js@1.0.1";
globalThis.doHpke = async () => {
Expand Down Expand Up @@ -398,15 +398,15 @@ doHpke();
Deno:

```js
import { KemId, KdfId, AeadId, CipherSuite } from "https://deno.land/x/hpke@1.0.0/core/mod.ts";
import { DhkemX25519HkdfSha256 } from "https://deno.land/x/hpke@1.0.0/x/dhkem-x25519/mod.ts";
// import { KemId, KdfId, AeadId, CipherSuite } from "https://deno.land/x/hpke@1.0.0/mod.ts";
import { KemId, KdfId, AeadId, CipherSuite } from "https://deno.land/x/hpke@1.0.1/core/mod.ts";
import { DhkemX25519HkdfSha256 } from "https://deno.land/x/hpke@1.0.1/x/dhkem-x25519/mod.ts";
// import { KemId, KdfId, AeadId, CipherSuite } from "https://deno.land/x/hpke@1.0.1/mod.ts";

async function doHpke() {
// setup
const suite = new CipherSuite({
kem: new DhkemX25519HkdfSha256(),
// If you use "https://deno.land/x/hpke@1.0.0/mod.ts", you can specify it with id as follows:
// If you use "https://deno.land/x/hpke@1.0.1/mod.ts", you can specify it with id as follows:
// kem: KemId.DhkemX25519HkdfSha256,
kdf: KdfId.HkdfSha256,
aead: AeadId.Aes128Gcm,
Expand Down
18 changes: 9 additions & 9 deletions core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A TypeScript <a href="https://datatracker.ietf.org/doc/html/rfc9180">Hybrid Publ

<div align="center">

[Documentation](https://doc.deno.land/https://deno.land/x/hpke/core/mod.ts)
[Doc(deno.land)](https://doc.deno.land/https://deno.land/x/hpke/core/mod.ts)/[Doc(pages, only latest)](https://dajiaji.github.io/hpke-js/core/docs/)

</div>

Expand All @@ -31,8 +31,8 @@ Using esm.sh:
```html
<!-- use a specific version -->
<script type="module">
import * as hpke from "https://esm.sh/@hpke/core@1.0.0";
// import { KemId, KdfId, AeadId, CipherSuite } from "https://esm.sh/@hpke/core@1.0.0";
import * as hpke from "https://esm.sh/@hpke/core@1.0.1";
// import { KemId, KdfId, AeadId, CipherSuite } from "https://esm.sh/@hpke/core@1.0.1";
</script>

<!-- use the latest stable version -->
Expand All @@ -47,8 +47,8 @@ Using unpkg:
```html
<!-- use a specific version -->
<script type="module">
import * as hpke from "https://unpkg.com/@hpke/core@1.0.0/esm/mod.js";
import { KemId, KdfId, AeadId, CipherSuite} from "https://unpkg.com/@hpke/core@1.0.0/esm/mod.js";
import * as hpke from "https://unpkg.com/@hpke/core@1.0.1/esm/mod.js";
import { KemId, KdfId, AeadId, CipherSuite} from "https://unpkg.com/@hpke/core@1.0.1/esm/mod.js";
// ...
</script>
```
Expand All @@ -73,7 +73,7 @@ Using deno.land:

```js
// use a specific version
import * as hpke from "https://deno.land/x/hpke@1.0.0/core/mod.ts";
import * as hpke from "https://deno.land/x/hpke@1.0.1/core/mod.ts";

// use the latest stable version
import * as hpke from "https://deno.land/x/hpke/core/mod.ts";
Expand All @@ -100,8 +100,8 @@ This section shows some typical usage examples.
<head></head>
<body>
<script type="module">
// import * as hpke from "https://esm.sh/hpke-js@1.0.0";
import { KemId, KdfId, AeadId, CipherSuite } from "https://esm.sh/@hpke/core@1.0.0";
// import * as hpke from "https://esm.sh/hpke-js@1.0.1";
import { KemId, KdfId, AeadId, CipherSuite } from "https://esm.sh/@hpke/core@1.0.1";
globalThis.doHpke = async () => {
Expand Down Expand Up @@ -187,7 +187,7 @@ doHpke();
### Deno

```js
import { KdfId, AeadId, CipherSuite } from "https://deno.land/x/hpke@1.0.0/core/mod.ts";
import { KdfId, AeadId, CipherSuite } from "https://deno.land/x/hpke@1.0.1/core/mod.ts";

async function doHpke() {
// setup
Expand Down
11 changes: 11 additions & 0 deletions core/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 1 addition & 9 deletions core/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ export type { SenderContextParams } from "../src/interfaces/senderContextParams.
export { Aes128Gcm, Aes256Gcm } from "../src/aeads/aesGcm.ts";
export { AeadId, KdfId, KemId } from "../src/identifiers.ts";

export {
CipherSuite,
DhkemP256HkdfSha256,
DhkemP384HkdfSha384,
DhkemP521HkdfSha512,
HkdfSha256,
HkdfSha384,
HkdfSha512,
} from "./src/native.ts";
export { CipherSuite } from "./src/native.ts";

export * from "../src/errors.ts";
32 changes: 16 additions & 16 deletions core/src/native.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { CipherSuiteNative } from "../../src/cipherSuiteNative.ts";
import {
DhkemP256HkdfSha256Native,
DhkemP384HkdfSha384Native,
DhkemP521HkdfSha512Native,
} from "../../src/kems/dhkemNative.ts";
import {
HkdfSha256Native,
HkdfSha384Native,
HkdfSha512Native,
} from "../../src/kdfs/hkdf.ts";
// import {
// DhkemP256HkdfSha256Native,
// DhkemP384HkdfSha384Native,
// DhkemP521HkdfSha512Native,
// } from "../../src/kems/dhkemNative.ts";
// import {
// HkdfSha256Native,
// HkdfSha384Native,
// HkdfSha512Native,
// } from "../../src/kdfs/hkdf.ts";

export class CipherSuite extends CipherSuiteNative {}
export class DhkemP256HkdfSha256 extends DhkemP256HkdfSha256Native {}
export class DhkemP384HkdfSha384 extends DhkemP384HkdfSha384Native {}
export class DhkemP521HkdfSha512 extends DhkemP521HkdfSha512Native {}
export class HkdfSha256 extends HkdfSha256Native {}
export class HkdfSha384 extends HkdfSha384Native {}
export class HkdfSha512 extends HkdfSha512Native {}
// export class DhkemP256HkdfSha256 extends DhkemP256HkdfSha256Native {}
// export class DhkemP384HkdfSha384 extends DhkemP384HkdfSha384Native {}
// export class DhkemP521HkdfSha512 extends DhkemP521HkdfSha512Native {}
// export class HkdfSha256 extends HkdfSha256Native {}
// export class HkdfSha384 extends HkdfSha384Native {}
// export class HkdfSha512 extends HkdfSha512Native {}
15 changes: 8 additions & 7 deletions core/test/cipherSuite.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,22 @@ import { concat } from "../../src/utils/misc.ts";

import {
AeadId,
Aes128Gcm,
CipherSuite,
DeserializeError,
DhkemP256HkdfSha256,
DhkemP384HkdfSha384,
DhkemP521HkdfSha512,
HkdfSha256,
HkdfSha384,
HkdfSha512,
InvalidParamError,
KdfId,
KemId,
NotSupportedError,
} from "../mod.ts";

import { DhkemP256HkdfSha256 } from "../../src/kems/dhkemP256.ts";
import { DhkemP384HkdfSha384 } from "../../src/kems/dhkemP384.ts";
import { DhkemP521HkdfSha512 } from "../../src/kems/dhkemP521.ts";
import { HkdfSha256 } from "../../src/kdfs/hkdfSha256.ts";
import { HkdfSha384 } from "../../src/kdfs/hkdfSha384.ts";
import { HkdfSha512 } from "../../src/kdfs/hkdfSha512.ts";
import { Aes128Gcm } from "../../src/aeads/aesGcm.ts";

import { hexStringToBytes } from "../../test/utils.ts";

describe("CipherSuite", () => {
Expand Down
20 changes: 10 additions & 10 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ export * from "./src/errors.ts";
export { Aead, AeadId, Kdf, KdfId, Kem, KemId } from "./src/identifiers.ts";
export { CipherSuite } from "./src/cipherSuite.ts";
export { CipherSuiteNative } from "./src/cipherSuiteNative.ts";
export { DhkemP256HkdfSha256 } from "./src/kems/dhkemP256.ts";
export { DhkemP384HkdfSha384 } from "./src/kems/dhkemP384.ts";
export { DhkemP521HkdfSha512 } from "./src/kems/dhkemP521.ts";
export { DhkemX25519HkdfSha256 } from "./src/kems/dhkemX25519.ts";
export { DhkemX448HkdfSha512 } from "./src/kems/dhkemX448.ts";
export { HkdfSha256 } from "./src/kdfs/hkdfSha256.ts";
export { HkdfSha384 } from "./src/kdfs/hkdfSha384.ts";
export { HkdfSha512 } from "./src/kdfs/hkdfSha512.ts";
export { Aes128Gcm, Aes256Gcm } from "./src/aeads/aesGcm.ts";
export { Chacha20Poly1305 } from "./src/aeads/chacha20Poly1305.ts";
// export { DhkemP256HkdfSha256 } from "./src/kems/dhkemP256.ts";
// export { DhkemP384HkdfSha384 } from "./src/kems/dhkemP384.ts";
// export { DhkemP521HkdfSha512 } from "./src/kems/dhkemP521.ts";
// export { DhkemX25519HkdfSha256 } from "./src/kems/dhkemX25519.ts";
// export { DhkemX448HkdfSha512 } from "./src/kems/dhkemX448.ts";
// export { HkdfSha256 } from "./src/kdfs/hkdfSha256.ts";
// export { HkdfSha384 } from "./src/kdfs/hkdfSha384.ts";
// export { HkdfSha512 } from "./src/kdfs/hkdfSha512.ts";
// export { Aes128Gcm, Aes256Gcm } from "./src/aeads/aesGcm.ts";
// export { Chacha20Poly1305 } from "./src/aeads/chacha20Poly1305.ts";
2 changes: 1 addition & 1 deletion samples/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"author": "Ajitomi Daisuke <ajitomi@gmail.com> (https://github.com/dajiaji)",
"license": "MIT",
"dependencies": {
"@hpke/core": "^0.22.0"
"@hpke/core": "^1.0.1"
}
}
2 changes: 1 addition & 1 deletion samples/ts-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"author": "Ajitomi Daisuke <ajitomi@gmail.com> (https://github.com/dajiaji)",
"license": "MIT",
"dependencies": {
"@hpke/core": "^0.22.0",
"@hpke/core": "^1.0.1",
"ts-node": "^10.7.0"
}
}
11 changes: 2 additions & 9 deletions test/cipherSuiteNative.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,14 @@ import { describe, it } from "testing/bdd.ts";

import {
AeadId,
Aes128Gcm,
// CipherSuite,
CipherSuiteNative,
DeserializeError,
// DhkemP256HkdfSha256,
// DhkemP384HkdfSha384,
// DhkemP521HkdfSha512,
// HkdfSha256,
// HkdfSha384,
// HkdfSha512,
InvalidParamError,
KdfId,
KemId,
NotSupportedError,
} from "../mod.ts";
import { CipherSuiteNative } from "../src/cipherSuiteNative.ts";
import { Aes128Gcm } from "../src/aeads/aesGcm.ts";
import {
HkdfSha256Native,
HkdfSha384Native,
Expand Down
Loading

0 comments on commit 1534b25

Please sign in to comment.