Skip to content

Commit 4b66784

Browse files
committed
refactor(deps): migrate to deno.json
1 parent 6643132 commit 4b66784

File tree

15 files changed

+46
-30
lines changed

15 files changed

+46
-30
lines changed

deno.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"lock": false,
3+
"imports": {
4+
"@std/assert": "jsr:@std/assert@^1.0.0",
5+
"@std/encoding/hex": "jsr:@std/encoding@^1.0.0/hex",
6+
"@std/hash": "https://deno.land/[email protected]/hash/mod.ts"
7+
},
8+
"exports": {
9+
"./aes": "./aes.ts",
10+
"./block-modes": "./block-modes.ts",
11+
"./blowfish": "./blowfish.ts",
12+
"./cast5": "./cast5.ts",
13+
"./des": "./des.ts",
14+
"./hkdf": "./hkdf.ts",
15+
"./hmac": "./hmac.ts",
16+
"./pbkdf2": "./pbkdf2.ts",
17+
"./tdes": "./tdes.ts"
18+
}
19+
}

deps.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

dev_deps.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/hkdf/mod.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { hmac, outputSizes } from "../hmac/mod.ts";
21
import type { SupportedAlgorithm } from "../hmac/mod.ts";
2+
import { hmac, outputSizes } from "../hmac/mod.ts";
33

44
export type { SupportedAlgorithm };
55

@@ -12,7 +12,7 @@ export function hkdf(
1212
ikm: Uint8Array,
1313
salt?: Uint8Array,
1414
info?: Uint8Array,
15-
) {
15+
): Uint8Array {
1616
const hashLen = outputSizes[hash];
1717

1818
if (!salt) salt = new Uint8Array(hashLen);

src/hmac/mod.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { createHash, SupportedAlgorithm } from "../../deps.ts";
2-
3-
export type { SupportedAlgorithm } from "../../deps.ts";
1+
import { createHash, SupportedAlgorithm } from "@std/hash";
2+
export type { SupportedAlgorithm } from "@std/hash";
43

54
export const blockSizes: Record<SupportedAlgorithm, number> = {
65
"sha3-512": 72,
@@ -21,6 +20,8 @@ export const blockSizes: Record<SupportedAlgorithm, number> = {
2120
keccak384: 48,
2221
keccak256: 136,
2322
keccak224: 144,
23+
blake3: 64,
24+
tiger: 64,
2425
};
2526

2627
export const outputSizes: Record<SupportedAlgorithm, number> = {
@@ -42,6 +43,8 @@ export const outputSizes: Record<SupportedAlgorithm, number> = {
4243
keccak384: 48,
4344
keccak256: 32,
4445
keccak224: 28,
46+
blake3: 32,
47+
tiger: 24,
4548
};
4649

4750
/**

tests/aes.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import { assertEquals, assertThrows } from "@std/assert";
2+
import { decodeHex } from "@std/encoding/hex";
13
import { Aes } from "../aes.ts";
2-
import { assertEquals, assertThrows, decodeHex } from "../dev_deps.ts";
34

45
// https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Algorithm-Validation-Program/documents/aes/AESAVS.pdf
56

tests/block-modes.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import { assertEquals, assertThrows } from "@std/assert";
2+
import { decodeHex } from "@std/encoding/hex";
13
import { Aes } from "../aes.ts";
24
import { Cbc, Cfb, Ctr, Ecb, Ige, Ofb } from "../block-modes.ts";
3-
import { assertEquals, assertThrows, decodeHex } from "../dev_deps.ts";
45

56
const key = new Uint8Array(16);
67
const iv = new Uint8Array(16);

tests/blowfish.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { assertEquals, assertThrows, decodeHex } from "../dev_deps.ts";
1+
import { assertEquals, assertThrows } from "@std/assert";
2+
import { decodeHex } from "@std/encoding/hex";
23
import { Blowfish } from "../blowfish.ts";
34

45
Deno.test("[Block Cipher] Blowfish", () => {

tests/cast5.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import { assertEquals, assertThrows } from "@std/assert";
2+
import { decodeHex } from "@std/encoding/hex";
13
import { Cast5 } from "../cast5.ts";
2-
import { assertEquals, assertThrows, decodeHex } from "../dev_deps.ts";
34

45
// https://tools.ietf.org/html/rfc2144#appendix-B.1
56

tests/des.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { assertEquals, assertThrows, decodeHex } from "../dev_deps.ts";
1+
import { assertEquals, assertThrows } from "@std/assert";
2+
import { decodeHex } from "@std/encoding/hex";
23
import { Des } from "../des.ts";
34

45
Deno.test("[Block Cipher] DES", () => {

0 commit comments

Comments
 (0)