From d3d4b0d87959a4316902073e2c258686d8130c3f Mon Sep 17 00:00:00 2001 From: Ajitomi Daisuke Date: Sun, 13 Oct 2024 17:58:04 +0900 Subject: [PATCH 1/2] Remove deno.land from docs. --- packages/core/src/aeads/aesGcm.ts | 4 +-- packages/core/src/aeads/exportOnly.ts | 2 +- packages/core/src/cipherSuiteNative.ts | 2 +- packages/core/src/native.ts | 28 +++++++++---------- .../dhkem-secp256k1/src/dhkemSecp256k1.ts | 24 +++------------- packages/dhkem-x25519/src/dhkemX25519.ts | 23 +++------------ packages/dhkem-x448/src/dhkemX448.ts | 21 +++----------- packages/hpke-js/src/cipherSuite.ts | 14 +++++----- .../src/hybridkemX25519Kyber768.ts | 8 +++--- 9 files changed, 41 insertions(+), 85 deletions(-) diff --git a/packages/core/src/aeads/aesGcm.ts b/packages/core/src/aeads/aesGcm.ts index 33eef6864..085c0c321 100644 --- a/packages/core/src/aeads/aesGcm.ts +++ b/packages/core/src/aeads/aesGcm.ts @@ -85,7 +85,7 @@ export class AesGcmContext extends NativeAlgorithm * CipherSuite, * DhkemP256HkdfSha256, * HkdfSha256, - * } from "http://deno.land/x/hpke/core/mod.ts"; + * } from "@hpke/core"; * * const suite = new CipherSuite({ * kem: new DhkemP256HkdfSha256(), @@ -124,7 +124,7 @@ export class Aes128Gcm implements AeadInterface { * CipherSuite, * DhkemP256HkdfSha256, * HkdfSha256, - * } from "http://deno.land/x/hpke/core/mod.ts"; + * } from "@hpke/core"; * * const suite = new CipherSuite({ * kem: new DhkemP256HkdfSha256(), diff --git a/packages/core/src/aeads/exportOnly.ts b/packages/core/src/aeads/exportOnly.ts index b3ad45631..e173c18a9 100644 --- a/packages/core/src/aeads/exportOnly.ts +++ b/packages/core/src/aeads/exportOnly.ts @@ -16,7 +16,7 @@ import { AeadId, NotSupportedError } from "@hpke/common"; * DhkemP256HkdfSha256, * ExportOnly, * HkdfSha256, - * } from "http://deno.land/x/hpke/core/mod.ts"; + * } from "@hpke/core"; * * const suite = new CipherSuite({ * kem: new DhkemP256HkdfSha256(), diff --git a/packages/core/src/cipherSuiteNative.ts b/packages/core/src/cipherSuiteNative.ts index 0cf4016cb..72218f3be 100644 --- a/packages/core/src/cipherSuiteNative.ts +++ b/packages/core/src/cipherSuiteNative.ts @@ -66,7 +66,7 @@ const SUITE_ID_HEADER_HPKE = new Uint8Array([ * {@link https://www.w3.org/TR/WebCryptoAPI/ | Web Cryptography API}. * * This is the super class of {@link CipherSuite} and the same as - * {@link https://deno.land/x/hpke/core/mod.ts?s=CipherSuite | @hpke/core#CipherSuite }, + * {@link https://jsr.io/@hpke/core/doc/~/CipherSuite | @hpke/core#CipherSuite} as follows: * which supports only the ciphersuites that can be implemented on the native * {@link https://www.w3.org/TR/WebCryptoAPI/ | Web Cryptography API}. * Therefore, the following cryptographic algorithms are not supported for now: diff --git a/packages/core/src/native.ts b/packages/core/src/native.ts index d12ed2ac8..3857f6836 100644 --- a/packages/core/src/native.ts +++ b/packages/core/src/native.ts @@ -17,7 +17,7 @@ import { * {@link https://www.w3.org/TR/WebCryptoAPI/ | Web Cryptography API}. * * This class is the same as - * {@link https://deno.land/x/hpke/mod.ts?s=CipherSuiteNative | @hpke/core#CipherSuiteNative }, + * {@link https://jsr.io/@hpke/core/doc/~/CipherSuiteNative | @hpke/core#CipherSuiteNative} as follows: * which supports only the ciphersuites that can be implemented on the native * {@link https://www.w3.org/TR/WebCryptoAPI/ | Web Cryptography API}. * Therefore, the following cryptographic algorithms are not supported for now: @@ -30,7 +30,7 @@ import { * * If you want to use the unsupported cryptographic algorithms * above or derive keys longer than the `hashSize`, - * please use {@link https://deno.land/x/hpke/mod.ts?s=CipherSuite | hpke-js#CipherSuite}. + * please use {@link https://jsr.io/@hpke/hpke-js/doc/~/CipherSuite | hpke-js#CipherSuite}. * * This class provides following functions: * @@ -52,7 +52,7 @@ import { * DhkemP256HkdfSha256, * HkdfSha256, * CipherSuite, - * } from "http://deno.land/x/hpke/core/mod.ts"; + * } from "@hpke/core"; * * const suite = new CipherSuite({ * kem: new DhkemP256HkdfSha256(), @@ -64,8 +64,8 @@ import { * @example Use a ciphersuite which is currently not supported by Web Cryptography API. * * ```ts - * import { Aes128Gcm, HkdfSha256, CipherSuite } from "http://deno.land/x/hpke/core/mod.ts"; - * import { DhkemX25519HkdfSha256 } from "https://deno.land/x/hpke/x/dhkem-x25519/mod.ts"; + * import { Aes128Gcm, HkdfSha256, CipherSuite } from "@hpke/core"; + * import { DhkemX25519HkdfSha256 } from "@hpke/dhkem-x25519"; * const suite = new CipherSuite({ * kem: new DhkemX25519HkdfSha256(), * kdf: new HkdfSha256(), @@ -90,7 +90,7 @@ export class CipherSuite extends CipherSuiteNative {} * CipherSuite, * DhkemP256HkdfSha256, * HkdfSha256, - * } from "http://deno.land/x/hpke/core/mod.ts"; + * } from "@hpke/core"; * * const suite = new CipherSuite({ * kem: new DhkemP256HkdfSha256(), @@ -116,7 +116,7 @@ export class DhkemP256HkdfSha256 extends DhkemP256HkdfSha256Native {} * CipherSuite, * DhkemP384HkdfSha384, * HkdfSha384, - * } from "http://deno.land/x/hpke/core/mod.ts"; + * } from "@hpke/core"; * * const suite = new CipherSuite({ * kem: new DhkemP384HkdfSha384(), @@ -142,7 +142,7 @@ export class DhkemP384HkdfSha384 extends DhkemP384HkdfSha384Native {} * CipherSuite, * DhkemP521HkdfSha512, * HkdfSha512, - * } from "http://deno.land/x/hpke/core/mod.ts"; + * } from "@hpke/core"; * * const suite = new CipherSuite({ * kem: new DhkemP521HkdfSha512(), @@ -161,7 +161,7 @@ export class DhkemP521HkdfSha512 extends DhkemP521HkdfSha512Native {} * * The KDF class can only derive keys of the same length as the `hashSize`. * If you want to derive keys longer than the `hashSize`, - * please use {@link https://deno.land/x/hpke/mod.ts?s=CipherSuite | hpke-js#CipherSuite}. + * please use {@link https://jsr.io/@hpke/hpke-js/doc/~/CipherSuite | hpke-js#CipherSuite}. * * @example * @@ -171,7 +171,7 @@ export class DhkemP521HkdfSha512 extends DhkemP521HkdfSha512Native {} * CipherSuite, * DhkemP256HkdfSha256, * HkdfSha256, - * } from "http://deno.land/x/hpke/core/mod.ts"; + * } from "@hpke/core"; * * const suite = new CipherSuite({ * kem: new DhkemP256HkdfSha256(), @@ -190,7 +190,7 @@ export class HkdfSha256 extends HkdfSha256Native {} * * The KDF class can only derive keys of the same length as the `hashSize`. * If you want to derive keys longer than the `hashSize`, - * please use {@link https://deno.land/x/hpke/mod.ts?s=CipherSuite | hpke-js#CipherSuite}. + * please use {@link https://jsr.io/@hpke/hpke-js/doc/~/CipherSuite | hpke-js#CipherSuite}. * * @example * @@ -200,7 +200,7 @@ export class HkdfSha256 extends HkdfSha256Native {} * CipherSuite, * DhkemP384HkdfSha384, * HkdfSha384, - * } from "http://deno.land/x/hpke/core/mod.ts"; + * } from "@hpke/core"; * * const suite = new CipherSuite({ * kem: new DhkemP384HkdfSha384(), @@ -219,7 +219,7 @@ export class HkdfSha384 extends HkdfSha384Native {} * * The KDF class can only derive keys of the same length as the `hashSize`. * If you want to derive keys longer than the `hashSize`, - * please use {@link https://deno.land/x/hpke/mod.ts?s=CipherSuite | hpke-js#CipherSuite}. + * please use {@link https://jsr.io/@hpke/hpke-js/doc/~/CipherSuite | hpke-js#CipherSuite}. * * @example * @@ -229,7 +229,7 @@ export class HkdfSha384 extends HkdfSha384Native {} * CipherSuite, * DhkemP521HkdfSha512, * HkdfSha512, - * } from "http://deno.land/x/hpke/core/mod.ts"; + * } from "@hpke/core"; * * const suite = new CipherSuite({ * kem: new DhkemP521HkdfSha512(), diff --git a/packages/dhkem-secp256k1/src/dhkemSecp256k1.ts b/packages/dhkem-secp256k1/src/dhkemSecp256k1.ts index bb32f380a..0c849871c 100644 --- a/packages/dhkem-secp256k1/src/dhkemSecp256k1.ts +++ b/packages/dhkem-secp256k1/src/dhkemSecp256k1.ts @@ -12,33 +12,17 @@ import { Secp256k1 } from "./secp256k1.ts"; * The public keys are assumed to be compressed. * * The instance of this class can be specified to the - * {@link https://deno.land/x/hpke/core/mod.ts?s=CipherSuiteParams | CipherSuiteParams} as follows: + * {@link https://jsr.io/@hpke/core/doc/~/CipherSuiteParams | CipherSuiteParams} as follows: * - * @example Use with `hpke-js` (`https://deno.land/x/hpke/mod.ts`). - * - * ```ts - * import { AeadId, CipherSuite, KdfId } from "https://deno.land/x/hpke/mod.ts"; - * import { DhkemSecp256k1HkdfSha256 } from "https://deno.land/x/hpke/x/dhkem-secp256k1/mod.ts"; - * - * const suite = new CipherSuite({ - * kem: new DhkemSecp256k1HkdfSha256(), - * kdf: KdfId.HkdfSha256, - * aead: AeadId.Aes128Gcm, - * }); - * ``` - * - * When using `hpke-js` (`https://deno.land/x/hpke/mod.ts`), `KemId.DhkemSecp256k1HkdfSha256` - * cannot be used as well. So you need to specify the instance of this class as follows: - * - * @example Use with `@hpke/core` (`https://deno.land/x/hpke/core/mod.ts`). + * @example Use with `@hpke/core`: * * ```ts * import { * Aes128Gcm, * CipherSuite, * HkdfSha256, - * } from "https://deno.land/x/hpke/core/mod.ts"; - * import { DhkemSecp256k1HkdfSha256 } from "https://deno.land/x/hpke/x/dhkem-secp256k1/mod.ts"; + * } from "@hpke/core"; + * import { DhkemSecp256k1HkdfSha256 } from "@hpke/dhkem-secp256k1"; * * const suite = new CipherSuite({ * kem: new DhkemSecp256k1HkdfSha256(), diff --git a/packages/dhkem-x25519/src/dhkemX25519.ts b/packages/dhkem-x25519/src/dhkemX25519.ts index 53f8e73bd..8caae6dc4 100644 --- a/packages/dhkem-x25519/src/dhkemX25519.ts +++ b/packages/dhkem-x25519/src/dhkemX25519.ts @@ -10,17 +10,17 @@ import { X25519 } from "./x25519.ts"; * {@link https://github.com/paulmillr/noble-curves | @noble/curves}. * * The instance of this class can be specified to the - * {@link https://deno.land/x/hpke/core/mod.ts?s=CipherSuiteParams | CipherSuiteParams} as follows: + * {@link https://jsr.io/@hpke/core/doc/~/CipherSuiteParams | CipherSuiteParams} as follows: * - * @example Use with `@hpke/core` (`https://deno.land/x/hpke/core/mod.ts`). + * @example Use with `@hpke/core`: * * ```ts * import { * Aes128Gcm, * CipherSuite, * HkdfSha256, - * } from "https://deno.land/x/hpke/core/mod.ts"; - * import { DhkemX25519HkdfSha256 } from "https://deno.land/x/hpke/x/dhkem-x25519/mod.ts"; + * } from "@hpke/core"; + * import { DhkemX25519HkdfSha256 } from "@hpke/dhkem-x25519"; * * const suite = new CipherSuite({ * kem: new DhkemX25519HkdfSha256(), @@ -28,21 +28,6 @@ import { X25519 } from "./x25519.ts"; * aead: new Aes128Gcm(), * }); * ``` - * - * When using `hpke-js` (`https://deno.land/x/hpke/mod.ts`), `KemId.DhkemX25519HkdfSha256` - * can be used. You don't need to use this class. - * - * @example - * - * ```ts - * import { AeadId, CipherSuite, KdfId, KemId } from "https://deno.land/x/hpke/mod.ts"; - * - * const suite = new CipherSuite({ - * kem: KemId.DhkemX25519HkdfSha256, - * kdf: KdfId.HkdfSha256, - * aead: AeadId.Aes128Gcm, - * }); - * ``` */ export class DhkemX25519HkdfSha256 extends Dhkem { /** KemId.DhkemX25519HkdfSha256 (0x0020) */ diff --git a/packages/dhkem-x448/src/dhkemX448.ts b/packages/dhkem-x448/src/dhkemX448.ts index 05c28a30d..b2bca4047 100644 --- a/packages/dhkem-x448/src/dhkemX448.ts +++ b/packages/dhkem-x448/src/dhkemX448.ts @@ -9,30 +9,17 @@ import { X448 } from "./x448.ts"; * {@link https://github.com/paulmillr/noble-curves | @noble/curves}. * * The instance of this class can be specified to the - * {@link https://deno.land/x/hpke/core/mod.ts?s=CipherSuiteParams | CipherSuiteParams} as follows: + * {@link https://jsr.io/@hpke/core/doc/~/CipherSuiteParams | CipherSuiteParams} as follows: * - * @example Use with `hpke-js` (`https://deno.land/x/hpke/mod.ts`). - * - * ```ts - * import { CipherSuite, AeadId, KdfId } from "https://deno.land/x/hpke/mod.ts"; - * import { DhkemX448HkdfSha512 } from "https://deno.land/x/hpke/x/dhkem-x448/mod.ts"; - * - * const suite = new CipherSuite({ - * kem: new DhkemX448HkdfSha512(), - * kdf: KdfId.HkdfSha512, - * aead: AeadId.Aes256Gcm, - * }); - * ``` - * - * @example Use with `@hpke/core` (`https://deno.land/x/hpke/core/mod.ts`). + * @example Use with `@hpke/core`: * * ```ts * import { * Aes256Gcm, * CipherSuite, * HkdfSha512, - * } from "https://deno.land/x/hpke/core/mod.ts"; - * import { DhkemX448HkdfSha512 } from "https://deno.land/x/hpke/x/dhkem-x448/mod.ts"; + * } from "@hpke/core"; + * import { DhkemX448HkdfSha512 } from "@hpke/dhkem-x448"; * * const suite = new CipherSuite({ * kem: new DhkemX448HkdfSha512(), diff --git a/packages/hpke-js/src/cipherSuite.ts b/packages/hpke-js/src/cipherSuite.ts index c6923300c..dcb08443d 100644 --- a/packages/hpke-js/src/cipherSuite.ts +++ b/packages/hpke-js/src/cipherSuite.ts @@ -25,10 +25,10 @@ import { DhkemP521HkdfSha512 } from "./kems/dhkemP521.ts"; * which supports all of the ciphersuites defined in * {@link https://datatracker.ietf.org/doc/html/rfc9180 | RFC9180}. * - * The class consists of the {@link https://deno.land/x/hpke/core/mod.ts | @hpke/core}, - * {@link https://deno.land/x/hpke/x/chacha20Poly1305/mod.ts | @hpke/chcha20poly1305}, - * {@link https://deno.land/x/hpke/x/dhkem-x25519/mod.ts | @hpke/dhkem-x25519} and - * {@link https://deno.land/x/hpke/x/dhkem-x448/mod.ts | @hpke/dhkem-x448} internally. + * The class consists of the {@link https://jsr.io/@hpke/core/doc | @hpke/core}, + * {@link https://jsr.io/@hpke/chacha20Poly1305/doc | @hpke/chcha20poly1305}, + * {@link https://jsr.io/@hpke/dhkem-x25519/doc | @hpke/dhkem-x25519} and + * {@link https://jsr.io/@hpke/dhkem-x448/doc | @hpke/dhkem-x448} internally. * * This class provides following functions: * @@ -48,7 +48,7 @@ import { DhkemP521HkdfSha512 } from "./kems/dhkemP521.ts"; * @example Use only ciphersuites supported internally. * * ```ts - * import { AeadId, CipherSuite, KdfId, KemId } from "http://deno.land/x/hpke/mod.ts"; + * import { AeadId, CipherSuite, KdfId, KemId } from "@hpke/hpke-js"; * * const suite = new CipherSuite({ * kem: KemId.DhkemP256HkdfSha256, @@ -60,11 +60,11 @@ import { DhkemP521HkdfSha512 } from "./kems/dhkemP521.ts"; * @example Use a ciphersuite consisting of an external module. * * ```ts - * import { AeadId, CipherSuite, KdfId } from "http://deno.land/x/hpke/mod.ts"; + * import { AeadId, CipherSuite, KdfId } from "@hpke/hpke-js"; * // Use an extension module. * import { * HybridkemX25519Kyber768, - * } from "https://deno.land/x/hpke/x/hybridkem-x25519-kyber768/mod.ts"; + * } from "@hpke/hybridkem-x25519-kyber768"; * * const suite = new CipherSuite({ * kem: new HybridkemX25519Kyber768(), diff --git a/packages/hybridkem-x25519-kyber768/src/hybridkemX25519Kyber768.ts b/packages/hybridkem-x25519-kyber768/src/hybridkemX25519Kyber768.ts index c4b097cee..1d266116d 100644 --- a/packages/hybridkem-x25519-kyber768/src/hybridkemX25519Kyber768.ts +++ b/packages/hybridkem-x25519-kyber768/src/hybridkemX25519Kyber768.ts @@ -29,13 +29,13 @@ class DhkemX25519HkdfSha256 extends Dhkem implements DhkemInterface { * {@link https://github.com/Argyle-Software/kyber | pqc-kyber }. * * The instance of this class can be specified to the - * {@link https://deno.land/x/hpke/core/mod.ts?s=CipherSuiteParams | CipherSuiteParams} as follows: + * {@link https://jsr.io/@hpke/core/doc/~/CipherSuiteParams | CipherSuiteParams} as follows: * - * @example + * @example Use with `@hpke/core`: * * ```ts - * import { Aes128Gcm, CipherSuite, HkdfSha256 } from "http://deno.land/x/hpke/core/mod.ts"; - * import { HybridkemX25519Kyber768 } from "https://deno.land/x/hpke/x/hybridkem-x25519-kyber768/mod.ts"; + * import { Aes128Gcm, CipherSuite, HkdfSha256 } from "@hpke/core"; + * import { HybridkemX25519Kyber768 } from "@hpke/hybridkem-x25519-kyber768"; * const suite = new CipherSuite({ * kem: new HybridkemX25519Kyber768(), * kdf: new HkdfSha256(), From df72c362e4f56c3da730d16f24531cea9ede760a Mon Sep 17 00:00:00 2001 From: Ajitomi Daisuke Date: Sun, 13 Oct 2024 18:00:36 +0900 Subject: [PATCH 2/2] Fix typo. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index db676cfc2..868a987da 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ try { The hpke-js includes the following packages. -| name | since | description | +| name | registry | description | | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | @hpke/core | [![npm](https://img.shields.io/npm/v/@hpke/core?color=%23EE3214)](https://www.npmjs.com/package/@hpke/core)
[![JSR](https://jsr.io/badges/@hpke/core)](https://jsr.io/@hpke/core) | The HPKE core module implemented using only [Web Cryptography API](https://www.w3.org/TR/WebCryptoAPI/). It does not support the X25519/X448-based KEMs and the ChaCha20/Poly1305 AEAD, but it has no external module dependencies. It's small in size and tree-shaking friendly.
[README](https://github.com/dajiaji/hpke-js/blob/main/packages/core/README.md) / [samples](https://github.com/dajiaji/hpke-js/tree/main/packages/core/samples) | | @hpke/chacha20poly1305 | [![npm](https://img.shields.io/npm/v/@hpke/chacha20poly1305?color=%23EE3214)](https://www.npmjs.com/package/@hpke/chacha20poly1305)
[![JSR](https://jsr.io/badges/@hpke/chacha20poly1305)](https://jsr.io/@hpke/chacha20poly1305) | The HPKE module extension for ChaCha20Poly1305 AEAD.
[README](https://github.com/dajiaji/hpke-js/blob/main/packages/chacha20poly1305/README.md) / [samples](https://github.com/dajiaji/hpke-js/tree/main/packages/chacha20poly1305/samples) |