allow passing decompressed keys
This commit is contained in:
parent
e2007e29b0
commit
4a74e1ff44
|
@ -102,7 +102,7 @@ export function verifyAggregate(publicKeys: Uint8Array[], messageHash: Uint8Arra
|
|||
try {
|
||||
return Signature
|
||||
.fromCompressedBytes(signature)
|
||||
.verifyAggregate(publicKeys, messageHash);
|
||||
.verifyAggregate(publicKeys.map(pubkey => PublicKey.fromBytes(pubkey)), messageHash);
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -52,9 +52,9 @@ export class Signature {
|
|||
return this.value;
|
||||
}
|
||||
|
||||
public verifyAggregate(publicKey: Uint8Array[], message: Uint8Array): boolean {
|
||||
public verifyAggregate(publicKeys: PublicKey[], message: Uint8Array): boolean {
|
||||
return this.value.fastAggregateVerify(
|
||||
publicKey.map((bytes) => PublicKey.fromBytes(bytes).getValue()),
|
||||
publicKeys.map((key) => key.getValue()),
|
||||
message
|
||||
);
|
||||
}
|
||||
|
|
Reference in New Issue