signature : Add test, minor fix
This commit is contained in:
+6
-1
@@ -7,8 +7,13 @@ export async function gen_privkey() : Promise<Uint8Array> {
|
||||
log.trace("generate keypair")
|
||||
return ed.utils.randomPrivateKey()
|
||||
}
|
||||
export async function gen_keypair() : Promise<[Uint8Array, Uint8Array]> {
|
||||
const privkey = await gen_privkey()
|
||||
const pubkey = await get_pubkey(privkey)
|
||||
return [privkey, pubkey]
|
||||
}
|
||||
export async function get_pubkey(privkey: Uint8Array) : Promise<Uint8Array> {
|
||||
log.trace("derive pubky")
|
||||
log.trace("derive pubkey")
|
||||
return ed.getPublicKeyAsync(privkey)
|
||||
}
|
||||
export async function sign(message: Uint8Array, privkey: Uint8Array) : Promise<Uint8Array> {
|
||||
|
||||
Reference in New Issue
Block a user