import {expect} from 'bun:test' import {hkdf, pbkdf, Usage} from '../src/kdf' import {derive_keypair, sign, verify} from '../src/signature' const salt = new Uint8Array(32) const pwd = "test" const message = new TextEncoder().encode("Yeet") const kd = await pbkdf(salt, pwd) const source = await hkdf(kd, Usage.sign) as Uint8Array const [privk, pubk] = await derive_keypair(source) const sig = await sign(message, privk) const verification = await verify(message, pubk, sig) expect(verification).toBeTrue() console.log("pwd-to-signing OK")