Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export {
HkdfSha512Native,
} from "./src/kdfs/hkdf.ts";
export { Dhkem } from "./src/kems/dhkem.ts";
export { Ec } from "./src/kems/dhkemPrimitives/ec.ts";
export {
base64UrlToBytes,
concat,
Expand Down
1 change: 1 addition & 0 deletions mod_core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export {
HkdfSha512Native,
} from "./core/src/kdfs/hkdf.ts";
export { Dhkem } from "./core/src/kems/dhkem.ts";
export { Ec } from "./core/src/kems/dhkemPrimitives/ec.ts";
export {
base64UrlToBytes,
concat,
Expand Down
8 changes: 4 additions & 4 deletions src/cipherSuite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import { Aes128Gcm, Aes256Gcm } from "../core/src/aeads/aesGcm.ts";
import { ExportOnly } from "../core/src/aeads/exportOnly.ts";
import { Chacha20Poly1305 } from "../x/chacha20poly1305/src/chacha20Poly1305.ts";
import { InvalidParamError } from "../core/src/errors.ts";
import { HkdfSha256 } from "../x/dhkem-x25519/src/hkdfSha256.ts";
import { HkdfSha384 } from "./kdfs/hkdfSha384.ts";
import { HkdfSha512 } from "./kdfs/hkdfSha512.ts";
import { DhkemP256HkdfSha256 } from "./kems/dhkemP256.ts";
import { DhkemP384HkdfSha384 } from "./kems/dhkemP384.ts";
import { DhkemP521HkdfSha512 } from "./kems/dhkemP521.ts";
import { DhkemX25519HkdfSha256 } from "../x/dhkem-x25519/src/dhkemX25519.ts";
import { DhkemX448HkdfSha512 } from "./kems/dhkemX448.ts";
import { AeadId, KdfId, KemId } from "../core/src/identifiers.ts";
import { CipherSuiteNative } from "../core/src/cipherSuiteNative.ts";

import { DhkemX25519HkdfSha256, HkdfSha256 } from "../x/dhkem-x25519/mod.ts";

import { DhkemX448HkdfSha512, HkdfSha512 } from "../x/dhkem-x448/mod.ts";

/**
* The Hybrid Public Key Encryption (HPKE) ciphersuite,
* which supports all of the ciphersuites defined in
Expand Down
7 changes: 3 additions & 4 deletions src/kems/dhkemP521.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { KemId } from "../../core/src/identifiers.ts";
import { HkdfSha512 } from "../kdfs/hkdfSha512.ts";
import { Dhkem } from "../../core/src/kems/dhkem.ts";
import { Ec } from "../../core/src/kems/dhkemPrimitives/ec.ts";
import { Dhkem, Ec, KemId } from "../../mod_core.ts";

import { HkdfSha512 } from "../../x/dhkem-x448/mod.ts";

export class DhkemP521HkdfSha512 extends Dhkem {
public readonly id: KemId = KemId.DhkemP521HkdfSha512;
Expand Down
2 changes: 1 addition & 1 deletion test/cipherSuiteNative.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
DhkemP521HkdfSha512Native,
} from "../core/src/kems/dhkemNative.ts";
import { DhkemX25519HkdfSha256 } from "../x/dhkem-x25519/src/dhkemX25519.ts";
import { DhkemX448HkdfSha512 } from "../src/kems/dhkemX448.ts";
import { DhkemX448HkdfSha512 } from "../x/dhkem-x448/src/dhkemX448.ts";
import { isDeno } from "../core/src/utils/misc.ts";

import { concat, hexToBytes, loadCrypto } from "../core/test/utils.ts";
Expand Down
5 changes: 3 additions & 2 deletions test/dhkemPrimitives.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import { describe, it } from "@std/testing/bdd";
import * as errors from "../core/src/errors.ts";
import { KemId } from "../core/src/identifiers.ts";
import { HkdfSha384 } from "../src/kdfs/hkdfSha384.ts";
import { HkdfSha512 } from "../src/kdfs/hkdfSha512.ts";
import { Ec } from "../core/src/kems/dhkemPrimitives/ec.ts";
import { X448 } from "../src/kems/dhkemPrimitives/x448.ts";
import { isDeno } from "../core/src/utils/misc.ts";

import { HkdfSha256 } from "../x/dhkem-x25519/src/hkdfSha256.ts";
import { X25519 } from "../x/dhkem-x25519/src/x25519.ts";

import { HkdfSha512 } from "../x/dhkem-x448/src/hkdfSha512.ts";
import { X448 } from "../x/dhkem-x448/src/x448.ts";

describe("derivePublicKey", () => {
describe("with valid parameters", () => {
it("should return a proper public key with Ec(DhkemP256HkdfSha256)", async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/kdfContext.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { assertEquals, assertRejects } from "@std/assert";
import { describe, it } from "@std/testing/bdd";

import { HkdfSha384 } from "../src/kdfs/hkdfSha384.ts";
import { HkdfSha512 } from "../src/kdfs/hkdfSha512.ts";
import { AeadId, KdfId, KemId } from "../core/src/identifiers.ts";
import { i2Osp } from "../core/src/utils/misc.ts";
import { loadCrypto } from "../core/test/utils.ts";

import { HkdfSha256 } from "../x/dhkem-x25519/src/hkdfSha256.ts";
import { HkdfSha512 } from "../x/dhkem-x448/src/hkdfSha512.ts";

// deno-fmt-ignore
const SUITE_ID_HEADER_HPKE = new Uint8Array([
Expand Down
2 changes: 1 addition & 1 deletion test/kemContext.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { KemId } from "../core/src/identifiers.ts";
import { DhkemP256HkdfSha256 } from "../src/kems/dhkemP256.ts";
import { DhkemP384HkdfSha384 } from "../src/kems/dhkemP384.ts";
import { DhkemP521HkdfSha512 } from "../src/kems/dhkemP521.ts";
import { DhkemX448HkdfSha512 } from "../src/kems/dhkemX448.ts";
import { isDeno } from "../core/src/utils/misc.ts";
import { loadCrypto } from "../core/test/utils.ts";

import { DhkemX25519HkdfSha256 } from "../x/dhkem-x25519/src/dhkemX25519.ts";
import { DhkemX448HkdfSha512 } from "../x/dhkem-x448/src/dhkemX448.ts";

describe("constructor", () => {
describe("with valid parameters", () => {
Expand Down
5 changes: 3 additions & 2 deletions test/sample.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ import * as errors from "../core/src/errors.ts";
import { DhkemP256HkdfSha256 } from "../src/kems/dhkemP256.ts";
import { DhkemP384HkdfSha384 } from "../src/kems/dhkemP384.ts";
import { DhkemP521HkdfSha512 } from "../src/kems/dhkemP521.ts";
import { DhkemX448HkdfSha512 } from "../src/kems/dhkemX448.ts";
import { HkdfSha384 } from "../src/kdfs/hkdfSha384.ts";
import { HkdfSha512 } from "../src/kdfs/hkdfSha512.ts";
import { isDeno } from "../core/src/utils/misc.ts";

import { DhkemX25519HkdfSha256 } from "../x/dhkem-x25519/src/dhkemX25519.ts";
import { HkdfSha256 } from "../x/dhkem-x25519/src/hkdfSha256.ts";

import { DhkemX448HkdfSha512 } from "../x/dhkem-x448/src/dhkemX448.ts";
import { HkdfSha512 } from "../x/dhkem-x448/src/hkdfSha512.ts";

import { concat, loadCrypto } from "../core/test/utils.ts";

describe("README examples", () => {
Expand Down
8 changes: 8 additions & 0 deletions x/dhkem-x448/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
"@std/assert": "jsr:@std/[email protected]",
"@std/testing": "jsr:@std/testing@^1.0.0"
},
"publish": {
"exclude": [
"dnt.ts",
"samples/",
"test/",
"tsconfig.json"
]
},
"fmt": {
"include": [
"**/*.md",
Expand Down
4 changes: 3 additions & 1 deletion x/dhkem-x448/mod.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export { DhkemX448HkdfSha512 } from "../../src/kems/dhkemX448.ts";
export { DhkemX448HkdfSha512 } from "./src/dhkemX448.ts";
export { HkdfSha512 } from "./src/hkdfSha512.ts";
export { X448 } from "./src/x448.ts";
7 changes: 3 additions & 4 deletions src/kems/dhkemX448.ts → x/dhkem-x448/src/dhkemX448.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { KemId } from "../../core/src/identifiers.ts";
import { HkdfSha512 } from "../kdfs/hkdfSha512.ts";
import { Dhkem } from "../../core/src/kems/dhkem.ts";
import { X448 } from "./dhkemPrimitives/x448.ts";
import { Dhkem, KemId } from "../../../mod_core.ts";
import { HkdfSha512 } from "./hkdfSha512.ts";
import { X448 } from "./x448.ts";

/**
* The DHKEM(X448, HKDF-SHA512) for HPKE KEM implementing {@link KemInterface}.
Expand Down
2 changes: 1 addition & 1 deletion src/kdfs/hkdfSha512.ts → x/dhkem-x448/src/hkdfSha512.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { hmac } from "npm:@noble/[email protected]/hmac";
// @ts-ignore: for "npm:"
import { sha512 } from "npm:@noble/[email protected]/sha512";

import { HkdfSha512Native } from "../../core/src/kdfs/hkdf.ts";
import { HkdfSha512Native } from "../../../mod_core.ts";

export class HkdfSha512 extends HkdfSha512Native {
public override async extract(
Expand Down
File renamed without changes.
Loading