@hpke/hybridkem-x-wing 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -49
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -22,40 +22,32 @@ Documentation: [jsr.io](https://jsr.io/@hpke/hybridkem-x-wing/doc) |
|
|
|
22
22
|
- [Node.js](#nodejs)
|
|
23
23
|
- [Deno](#deno)
|
|
24
24
|
- [Web Browsers](#web-browsers)
|
|
25
|
-
- [Cloudflare Workers](#cloudflare-workers)
|
|
26
25
|
- [Usage](#usage)
|
|
27
26
|
- [Contributing](#contributing)
|
|
28
27
|
|
|
29
28
|
## Installation
|
|
30
29
|
|
|
30
|
+
`@hpke/hybridkem-x-wing` need to be used with
|
|
31
|
+
[@hpke/core](https://github.com/dajiaji/hpke-js/blob/main/packages/core/README.md),
|
|
32
|
+
which can be installed in the same manner as desribed below.
|
|
33
|
+
|
|
31
34
|
### Node.js
|
|
32
35
|
|
|
33
|
-
|
|
36
|
+
You can install the package with npm, yarn or pnpm.
|
|
34
37
|
|
|
35
38
|
```sh
|
|
39
|
+
# Using npm:
|
|
36
40
|
npm install @hpke/hybridkem-x-wing
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
Using yarn:
|
|
40
|
-
|
|
41
|
-
```sh
|
|
42
41
|
yarn add @hpke/hybridkem-x-wing
|
|
42
|
+
pnpm install @hpke/hybridkem-x-wing
|
|
43
|
+
# Using jsr:
|
|
44
|
+
npx jsr add @hpke/hybridkem-x-wing
|
|
45
|
+
yarn dlx jsr add @hpke/hybridkem-x-wing
|
|
46
|
+
pnpm dlx jsr add @@hpke/hybridkem-x-wing
|
|
43
47
|
```
|
|
44
48
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
Starting from version 1.3.0, hpke-js packages are available from the JSR
|
|
48
|
-
registry. From this version onwards, please use JSR import instead of HTTPS
|
|
49
|
-
import in Deno.
|
|
50
|
-
|
|
51
|
-
**JSR imoprt (recommended on `>=1.3.0`):**
|
|
52
|
-
|
|
53
|
-
Add hpke-js packages using the commands below:
|
|
54
|
-
|
|
55
|
-
```sh
|
|
56
|
-
deno add @hpke/core
|
|
57
|
-
deno add @hpke/hybridkem-x-wing
|
|
58
|
-
```
|
|
49
|
+
The above manner can be used with other JavaScript runtimes that support npm,
|
|
50
|
+
such as Cloudflare Workers and Bun.
|
|
59
51
|
|
|
60
52
|
Then, you can use the module from code like this:
|
|
61
53
|
|
|
@@ -64,15 +56,12 @@ import { Aes128Gcm, CipherSuite, HkdfSha256 } from "@hpke/core";
|
|
|
64
56
|
import { HybridkemXWing } from "@hpke/hybridkem-x-wing";
|
|
65
57
|
```
|
|
66
58
|
|
|
67
|
-
|
|
59
|
+
### Deno
|
|
68
60
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
HkdfSha256,
|
|
74
|
-
} from "https://deno.land/x/hpke/core/mod.ts";
|
|
75
|
-
import { HybridkemXWing } from "https://deno.land/x/hpke/x/hybridkem-x-wing/mod.ts";
|
|
61
|
+
For Deno, it is recommended to use the jsr.io registry.
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
deno add jsr:@hpke/hybridkem-x-wing
|
|
76
65
|
```
|
|
77
66
|
|
|
78
67
|
### Web Browsers
|
|
@@ -85,15 +74,23 @@ Using esm.sh:
|
|
|
85
74
|
```html
|
|
86
75
|
<!-- use a specific version -->
|
|
87
76
|
<script type="module">
|
|
88
|
-
import
|
|
89
|
-
|
|
77
|
+
import {
|
|
78
|
+
Aes128Gcm,
|
|
79
|
+
CipherSuite,
|
|
80
|
+
HkdfSha256,
|
|
81
|
+
} from "https://esm.sh/@hpke/core@<SEMVER>";
|
|
82
|
+
import { HybridkemXWing } from "https://esm.sh/@hpke/hybridkem-x-wing@<SEMVER>";
|
|
90
83
|
// ...
|
|
91
84
|
</script>
|
|
92
85
|
|
|
93
86
|
<!-- use the latest stable version -->
|
|
94
87
|
<script type="module">
|
|
95
|
-
import
|
|
96
|
-
|
|
88
|
+
import {
|
|
89
|
+
Aes128Gcm,
|
|
90
|
+
CipherSuite,
|
|
91
|
+
HkdfSha256,
|
|
92
|
+
} from "https://esm.sh/@hpke/core";
|
|
93
|
+
import { HybridkemXWing } from "https://esm.sh/@hpke/hybridkem-x-wing";
|
|
97
94
|
// ...
|
|
98
95
|
</script>
|
|
99
96
|
```
|
|
@@ -103,22 +100,16 @@ Using unpkg:
|
|
|
103
100
|
```html
|
|
104
101
|
<!-- use a specific version -->
|
|
105
102
|
<script type="module">
|
|
106
|
-
import
|
|
107
|
-
|
|
103
|
+
import {
|
|
104
|
+
Aes128Gcm,
|
|
105
|
+
CipherSuite,
|
|
106
|
+
HkdfSha256,
|
|
107
|
+
} from "https://unpkg.com/@hpke/core@<SEMVER>/esm/mod.js";
|
|
108
|
+
import { HybridkemXWing } from "https://unpkg.com/@hpke/hybridkem-x-wing@<SEMVER>/esm/mod.js";
|
|
108
109
|
// ...
|
|
109
110
|
</script>
|
|
110
111
|
```
|
|
111
112
|
|
|
112
|
-
### Cloudflare Workers
|
|
113
|
-
|
|
114
|
-
```sh
|
|
115
|
-
git clone git@github.com:dajiaji/hpke-js.git
|
|
116
|
-
cd hpke-js/x/hybridkem-x-wing
|
|
117
|
-
npm install -g esbuild
|
|
118
|
-
deno task dnt
|
|
119
|
-
deno task minify > $YOUR_SRC_PATH/hpke-hybridkem-x-wing.js
|
|
120
|
-
```
|
|
121
|
-
|
|
122
113
|
## Usage
|
|
123
114
|
|
|
124
115
|
This section shows some typical usage examples.
|
|
@@ -128,7 +119,6 @@ This section shows some typical usage examples.
|
|
|
128
119
|
```js
|
|
129
120
|
import { Aes128Gcm, CipherSuite, HkdfSha256 } from "@hpke/core";
|
|
130
121
|
import { HybridkemXWing } from "@hpke/hybridkem-x-wing";
|
|
131
|
-
// const { HybridkemXWing } = require("@hpke/hybridkem-x-wing");
|
|
132
122
|
|
|
133
123
|
async function doHpke() {
|
|
134
124
|
// setup
|
|
@@ -208,7 +198,7 @@ try {
|
|
|
208
198
|
}
|
|
209
199
|
```
|
|
210
200
|
|
|
211
|
-
### Browsers
|
|
201
|
+
### Web Browsers
|
|
212
202
|
|
|
213
203
|
```html
|
|
214
204
|
<html>
|
|
@@ -219,8 +209,8 @@ try {
|
|
|
219
209
|
Aes128Gcm,
|
|
220
210
|
CipherSuite,
|
|
221
211
|
HkdfSha256,
|
|
222
|
-
} from "https://esm.sh/@hpke/core
|
|
223
|
-
import { HybridkemXWing } from "https://esm.sh/@hpke/hybridkem-x-wing
|
|
212
|
+
} from "https://esm.sh/@hpke/core";
|
|
213
|
+
import { HybridkemXWing } from "https://esm.sh/@hpke/hybridkem-x-wing";
|
|
224
214
|
|
|
225
215
|
globalThis.doHpke = async () => {
|
|
226
216
|
try {
|
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hpke/hybridkem-x-wing",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "A Hybrid Public Key Encryption (HPKE) module extension for
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "A Hybrid Public Key Encryption (HPKE) module extension for X-Wing: general-purpose hybrid post-quantum KEM.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hpke",
|
|
7
|
-
"
|
|
8
|
-
"kem",
|
|
7
|
+
"ml-kem",
|
|
9
8
|
"kyber",
|
|
10
9
|
"x25519",
|
|
11
10
|
"post-quantum",
|
|
11
|
+
"pqc",
|
|
12
|
+
"x-wing",
|
|
12
13
|
"security",
|
|
13
14
|
"encryption"
|
|
14
15
|
],
|
|
@@ -42,7 +43,7 @@
|
|
|
42
43
|
"dependencies": {
|
|
43
44
|
"@hpke/common": "^1.4.3",
|
|
44
45
|
"@hpke/dhkem-x25519": "^1.4.3",
|
|
45
|
-
"@noble/hashes": "^1.
|
|
46
|
+
"@noble/hashes": "^1.5.0",
|
|
46
47
|
"mlkem": "^2.2.0"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|