Skip to content

Commit

Permalink
style: run deno fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
aykxt committed Jul 14, 2023
1 parent 315d4f6 commit a04b867
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
4 changes: 2 additions & 2 deletions dev_deps.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export { parse as parseArgs } from "https://deno.land/std@0.194.0/flags/mod.ts";
export {
assertEquals,
assertThrows
assertThrows,
} from "https://deno.land/std@0.194.0/testing/asserts.ts";
export {
bench,
runBenchmarks
runBenchmarks,
} from "https://deno.land/std@0.92.0/testing/bench.ts";
// export {
// decodeString as decodeHex,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/bytes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ export function bytesToWords(bytes: Uint8Array): Uint32Array {
words[i] = dataView.getUint32(i * 4);
}
return words;
}
}
2 changes: 1 addition & 1 deletion tests/aes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ Deno.test("[Block Cipher] AES-128 2.0", () => {
aes.decryptBlock(dataView, 0);
assertEquals(data, decodeHex(plaintext));
}
});
});
12 changes: 3 additions & 9 deletions tests/block-modes.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { Aes } from "../aes.ts";
import { Cbc, Cfb, Ctr, Ecb, Ofb } from "../block-modes.ts";
import {
assertEquals,
assertThrows,
decodeHex
} from "../dev_deps.ts";
import { assertEquals, assertThrows, decodeHex } from "../dev_deps.ts";

const key = new Uint8Array(16);
const iv = new Uint8Array(16);
Expand All @@ -19,7 +15,7 @@ Deno.test("[Block Cipher Mode] Base", () => {
cipher.decrypt(new Uint8Array(4));
},
Error,
"Invalid data size (must be multiple of 16 bytes)"
"Invalid data size (must be multiple of 16 bytes)",
);

assertThrows(
Expand All @@ -28,7 +24,7 @@ Deno.test("[Block Cipher Mode] Base", () => {
cipher.encrypt(new Uint8Array(4));
},
Error,
"Invalid initialization vector size (must be 16 bytes)"
"Invalid initialization vector size (must be 16 bytes)",
);
});

Expand Down Expand Up @@ -81,10 +77,8 @@ Deno.test("[Block Cipher Mode] ECB", () => {
const dec = cipher.decrypt(enc);
assertEquals(dec, plain);
}

});


Deno.test("[Block Cipher Mode] CBC", () => {
const cipher = new Cbc(Aes, key, iv);
const decipher = new Cbc(Aes, key, iv);
Expand Down

0 comments on commit a04b867

Please sign in to comment.