move keccak related functions to front end

This commit is contained in:
2025-03-09 15:48:54 +01:00
parent edeb1b7c73
commit 35ff9cb240
8 changed files with 51 additions and 46 deletions

View File

@@ -1,4 +1,6 @@
import { genKeys, sharedKey } from "./ecdh.js";
import { keccakAEAD } from "./aead.js";
import { keccakKDF } from "./kdf.js";
const socket = io();
let secret = null;
@@ -47,7 +49,7 @@ export function create_listener(form, input) {
}
const fromHexString = (hexString) =>
Uint8Array.from(hexString.match(/.{1,2}/g).map((byte) => parseInt(byte, 16)));
Uint8Array.from(hexString.match(/.{1,2}/g).map((byte) => parseInt(byte, 16)));
const toHexString = (bytes) =>
bytes.reduce((str, byte) => str + byte.toString(16).padStart(2, '0'), '');
bytes.reduce((str, byte) => str + byte.toString(16).padStart(2, '0'), '');