Skip to content

Commit 20a83b5

Browse files
committed
Move chacha20poly1305 impl to x/chacha20poly1305.
1 parent 134b539 commit 20a83b5

File tree

27 files changed

+409
-43
lines changed

27 files changed

+409
-43
lines changed

.github/workflows/ci_bun.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ jobs:
5252
deno run -A dnt.ts 0.0.0
5353
deno task minify > ../x/dhkem-x25519/test/runtimes/hpke-core.js
5454
deno task minify > ../x/dhkem-x448/test/runtimes/hpke-core.js
55-
deno task minify > ../x/chacha20poly1305/test/runtimes/hpke-core.js
5655
deno task minify > ../x/hybridkem-x25519-kyber768/test/runtimes/hpke-core.js
5756
deno task minify > ../x/dhkem-secp256k1/test/runtimes/hpke-core.js
5857
- name: Run npm pack for core
@@ -88,13 +87,17 @@ jobs:
8887
- working-directory: ./x/chacha20poly1305
8988
run: |
9089
deno task dnt
91-
deno task minify > test/runtimes/hpke-chacha20poly1305.js
90+
deno run -A dnt.ts 0.0.0
91+
- name: Run npm pack for chacha20poly1305
92+
working-directory: ./x/chacha20poly1305/npm
93+
run: npm pack
9294
- name: Run test for chacha20poly1305
9395
working-directory: ./x/chacha20poly1305/test/runtimes/bun
9496
run: |
95-
nohup bun src/index.js &
97+
bun install
98+
nohup bun src/index.ts &
9699
sleep 3
97-
deno test chacha20poly1305.spec.ts --allow-net
100+
deno test chacha20poly1305.spec.ts --allow-net --config ../../../deno.json
98101
- working-directory: ./x/hybridkem-x25519-kyber768
99102
run: |
100103
deno task dnt

deno.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,29 @@
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
},
1011
"publish": {
12+
"include": [
13+
"README.md",
14+
"core/",
15+
"deno.json",
16+
"deno.lock",
17+
"mod.ts",
18+
"src/",
19+
"x/chacha20poly1305/src/"
20+
],
1121
"exclude": [
12-
".github/",
1322
"core/LICENSE",
1423
"core/README.md",
1524
"core/deno.json",
1625
"core/deno.lock",
1726
"core/dnt.ts",
27+
"core/samples/",
1828
"core/test/",
19-
"core/tsconfig.json",
20-
"dnt.ts",
21-
"samples/",
22-
"test/",
23-
"x/"
29+
"core/tsconfig.json"
2430
]
2531
},
2632
"fmt": {

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.

dnt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ await build({
2222
test: true,
2323
declaration: "inline",
2424
scriptModule: "umd",
25-
importMap: "./deno.json",
25+
importMap: "./import_map_for_dnt.json",
2626
compilerOptions: {
2727
lib: ["ES2022", "DOM"],
2828
},

import_map_for_dnt.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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+
}

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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,17 @@
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+
"samples/",
15+
"test/"
16+
]
17+
},
1018
"fmt": {
1119
"include": [
1220
"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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { build, emptyDir } from "@deno/dnt";
22

33
await emptyDir("./npm");
4+
await emptyDir("./test/runtimes/browsers/node_modules");
45

56
await build({
67
entryPoints: ["./mod.ts"],
@@ -9,7 +10,7 @@ await build({
910
test: true,
1011
declaration: true,
1112
scriptModule: "umd",
12-
importMap: "./deno.json",
13+
importMap: "../../import_map_for_dnt.json",
1314
compilerOptions: {
1415
lib: ["es2022", "dom"],
1516
},

0 commit comments

Comments
 (0)