Skip to content

Commit 54aba8d

Browse files
committed
Move chacha20poly1305 impl to x/chacha20poly1305.
1 parent 134b539 commit 54aba8d

File tree

9 files changed

+30
-9
lines changed

9 files changed

+30
-9
lines changed

src/cipherSuite.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { KemInterface } from "../core/src/interfaces/kemInterface.ts";
33

44
import { Aes128Gcm, Aes256Gcm } from "../core/src/aeads/aesGcm.ts";
55
import { ExportOnly } from "../core/src/aeads/exportOnly.ts";
6-
import { Chacha20Poly1305 } from "./aeads/chacha20Poly1305.ts";
6+
import { Chacha20Poly1305 } from "../x/chacha20poly1305/src/chacha20Poly1305.ts";
77
import { InvalidParamError } from "../core/src/errors.ts";
88
import { HkdfSha256 } from "./kdfs/hkdfSha256.ts";
99
import { HkdfSha384 } from "./kdfs/hkdfSha384.ts";

test/cipherSuiteNative.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
KemId,
1010
} from "../mod.ts";
1111
import { Aes128Gcm, Aes256Gcm } from "../core/src/aeads/aesGcm.ts";
12-
import { Chacha20Poly1305 } from "../src/aeads/chacha20Poly1305.ts";
12+
import { Chacha20Poly1305 } from "../x/chacha20poly1305/mod.ts";
1313
import { ExportOnly } from "../core/src/aeads/exportOnly.ts";
1414
import { CipherSuiteNative } from "../core/src/cipherSuiteNative.ts";
1515
import {

x/chacha20poly1305/deno.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,18 @@
44
"exports": "./mod.ts",
55
"imports": {
66
"@deno/dnt": "jsr:@deno/dnt@^0.41.2",
7+
"@hpke/core": "jsr:@hpke/core@^1.2.9",
78
"@std/assert": "jsr:@std/[email protected]",
89
"@std/testing": "jsr:@std/testing@^1.0.0"
910
},
11+
"publish": {
12+
"exclude": [
13+
"dnt.ts",
14+
"import_map_for_dnt.json",
15+
"samples/",
16+
"test/"
17+
]
18+
},
1019
"fmt": {
1120
"include": [
1221
"README.md",

x/chacha20poly1305/deno.lock

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x/chacha20poly1305/dnt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ await build({
99
test: true,
1010
declaration: true,
1111
scriptModule: "umd",
12-
importMap: "./deno.json",
12+
importMap: "./import_map_for_dnt.json",
1313
compilerOptions: {
1414
lib: ["es2022", "dom"],
1515
},
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"imports": {
3+
"@deno/dnt": "jsr:@deno/dnt@^0.41.2",
4+
"@hpke/core": "npm:@hpke/core@^1.2.9",
5+
"@std/assert": "jsr:@std/[email protected]",
6+
"@std/testing": "jsr:@std/testing@^1.0.0"
7+
}
8+
}
9+

x/chacha20poly1305/mod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { Chacha20Poly1305 } from "../../src/aeads/chacha20Poly1305.ts";
1+
export { Chacha20Poly1305 } from "./src/chacha20Poly1305.ts";

src/aeads/chacha20Poly1305.ts renamed to x/chacha20poly1305/src/chacha20Poly1305.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
// @ts-ignore: for "npm:"
22
import { chacha20poly1305 } from "npm:@noble/[email protected]/chacha";
33

4-
import type { AeadEncryptionContext } from "../../core/src/interfaces/aeadEncryptionContext.ts";
5-
import type { AeadInterface } from "../../core/src/interfaces/aeadInterface.ts";
6-
7-
import { AeadId } from "../../core/src/identifiers.ts";
4+
import type { AeadEncryptionContext, AeadInterface } from "@hpke/core";
5+
import { AeadId } from "@hpke/core";
86

97
export class Chacha20Poly1305Context implements AeadEncryptionContext {
108
private _key: Uint8Array;

x/chacha20poly1305/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
},
77
"include": [
88
"mod.ts",
9-
"../../src/aeads/chacha20Poly1305.ts"
9+
"./src/chacha20Poly1305.ts"
1010
]
1111
}

0 commit comments

Comments
 (0)