Skip to content

Commit

Permalink
Use Aes256Gcm.
Browse files Browse the repository at this point in the history
  • Loading branch information
dajiaji committed Nov 4, 2024
1 parent 107f59b commit e104495
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions packages/hybridkem-x-wing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Documentation: [jsr.io](https://jsr.io/@hpke/hybridkem-x-wing/doc) |

## Installation

`@hpke/hybridkem-x-wing` need to be used with
`@hpke/hybridkem-x-wing` needs to be used with
[@hpke/core](https://github.com/dajiaji/hpke-js/blob/main/packages/core/README.md),
which can be installed in the same manner as desribed below.

Expand All @@ -52,7 +52,7 @@ such as Cloudflare Workers and Bun.
Then, you can use the module from code like this:

```ts
import { Aes128Gcm, CipherSuite, HkdfSha256 } from "@hpke/core";
import { Aes256Gcm, CipherSuite, HkdfSha256 } from "@hpke/core";
import { HybridkemXWing } from "@hpke/hybridkem-x-wing";
```

Expand All @@ -75,7 +75,7 @@ Using esm.sh:
<!-- use a specific version -->
<script type="module">
import {
Aes128Gcm,
Aes256Gcm,
CipherSuite,
HkdfSha256,
} from "https://esm.sh/@hpke/core@<SEMVER>";
Expand All @@ -86,7 +86,7 @@ Using esm.sh:
<!-- use the latest stable version -->
<script type="module">
import {
Aes128Gcm,
Aes256Gcm,
CipherSuite,
HkdfSha256,
} from "https://esm.sh/@hpke/core";
Expand All @@ -101,7 +101,7 @@ Using unpkg:
<!-- use a specific version -->
<script type="module">
import {
Aes128Gcm,
Aes256Gcm,
CipherSuite,
HkdfSha256,
} from "https://unpkg.com/@hpke/core@<SEMVER>/esm/mod.js";
Expand All @@ -117,15 +117,15 @@ This section shows some typical usage examples.
### Node.js

```js
import { Aes128Gcm, CipherSuite, HkdfSha256 } from "@hpke/core";
import { Aes256Gcm, CipherSuite, HkdfSha256 } from "@hpke/core";
import { HybridkemXWing } from "@hpke/hybridkem-x-wing";

async function doHpke() {
// setup
const suite = new CipherSuite({
kem: new HybridkemXWing(),
kdf: new HkdfSha256(),
aead: new Aes128Gcm(),
aead: new Aes256Gcm(),
});

const rkp = await suite.kem.generateKeyPair();
Expand All @@ -140,7 +140,7 @@ async function doHpke() {

const recipient = await suite.createRecipientContext({
recipientKey: rkp.privateKey,
enc: sender.enc, // == `ct` (ciphertext) for X-Wing
enc: sender.enc, // == `ct` (ciphertext) in the context of X-Wing
});

// decrypt
Expand All @@ -160,15 +160,15 @@ try {
### Deno

```ts
import { Aes128Gcm, CipherSuite, HkdfSha256 } from "@hpke/core";
import { Aes256Gcm, CipherSuite, HkdfSha256 } from "@hpke/core";
import { HybridkemXWing } from "@hpke/hybridkem-x-wing";

async function doHpke() {
// setup
const suite = new CipherSuite({
kem: new HybridkemXWing(),
kdf: new HkdfSha256(),
aead: new Aes128Gcm(),
aead: new Aes256Gcm(),
});

const rkp = await suite.kem.generateKeyPair();
Expand Down Expand Up @@ -208,7 +208,7 @@ try {
<body>
<script type="module">
import {
Aes128Gcm,
Aes256Gcm,
CipherSuite,
HkdfSha256,
} from "https://esm.sh/@hpke/core";
Expand All @@ -219,7 +219,7 @@ try {
const suite = new CipherSuite({
kem: new HybridkemXWing(),
kdf: new HkdfSha256(),
aead: new Aes128Gcm(),
aead: new Aes256Gcm(),
});
const rkp = await suite.kem.generateKeyPair();
Expand All @@ -235,7 +235,7 @@ try {
const recipient = await suite.createRecipientContext({
recipientKey: rkp.privateKey, // rkp (CryptoKeyPair) is also acceptable.
enc: sender.enc, // == `ct` (ciphertext) for X-Wing
enc: sender.enc, // == `ct` (ciphertext) in the context of X-Wing
});
// decrypt
Expand Down

0 comments on commit e104495

Please sign in to comment.