nobleCurves, serve file for cryptography in the browser

This commit is contained in:
2025-02-19 20:48:16 +01:00
parent 295513f83b
commit da4f74b60c
10 changed files with 90 additions and 86 deletions

View File

@ -1,16 +0,0 @@
import { genKeys, sharedKey } from '../src/public/ecdh.js';
import { arrayToHex } from '../src/stringutils.js';
describe('ecdh.js functions', () => {
it('key exchange test', () => {
const keysA= genKeys();
const keysB = genKeys();
const sharedA = sharedKey(keysA.privkey, keysB.pubkey);
const sharedB = sharedKey(keysB.privkey, keysA.pubkey);
const sharedAhex = arrayToHex(sharedA);
const sharedBhex = arrayToHex(sharedB);
expect(sharedAhex).toBe(sharedBhex);
});
});