Add secretKeyToPublicKey function
This commit is contained in:
parent
f3e9392847
commit
e0076d0f27
|
@ -106,6 +106,14 @@ export function functionalInterfaceFactory({
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Computes a public key from a secret key
|
||||
*/
|
||||
function secretKeyToPublicKey(secretKey: Uint8Array): Uint8Array {
|
||||
validateBytes(secretKey, "secretKey");
|
||||
return SecretKey.fromBytes(secretKey).toPublicKey().toBytes();
|
||||
}
|
||||
|
||||
return {
|
||||
sign,
|
||||
aggregateSignatures,
|
||||
|
@ -113,5 +121,6 @@ export function functionalInterfaceFactory({
|
|||
verify,
|
||||
verifyAggregate,
|
||||
verifyMultiple,
|
||||
secretKeyToPublicKey,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ export interface IBls {
|
|||
verify(publicKey: Uint8Array, message: Uint8Array, signature: Uint8Array): boolean;
|
||||
verifyAggregate(publicKeys: Uint8Array[], message: Uint8Array, signature: Uint8Array): boolean;
|
||||
verifyMultiple(publicKeys: Uint8Array[], messages: Uint8Array[], signature: Uint8Array): boolean;
|
||||
secretKeyToPublicKey(secretKey: Uint8Array): Uint8Array;
|
||||
|
||||
init(): Promise<void>;
|
||||
destroy(): void;
|
||||
|
|
Reference in New Issue