allow passing decompressed keys

This commit is contained in:
Marin Petrunić 2020-08-29 16:18:33 +02:00
parent e2007e29b0
commit 4a74e1ff44
No known key found for this signature in database
GPG Key ID: 834D07135E110DA5
2 changed files with 3 additions and 3 deletions

View File

@ -102,7 +102,7 @@ export function verifyAggregate(publicKeys: Uint8Array[], messageHash: Uint8Arra
try { try {
return Signature return Signature
.fromCompressedBytes(signature) .fromCompressedBytes(signature)
.verifyAggregate(publicKeys, messageHash); .verifyAggregate(publicKeys.map(pubkey => PublicKey.fromBytes(pubkey)), messageHash);
} catch (e) { } catch (e) {
return false; return false;
} }

View File

@ -52,9 +52,9 @@ export class Signature {
return this.value; return this.value;
} }
public verifyAggregate(publicKey: Uint8Array[], message: Uint8Array): boolean { public verifyAggregate(publicKeys: PublicKey[], message: Uint8Array): boolean {
return this.value.fastAggregateVerify( return this.value.fastAggregateVerify(
publicKey.map((bytes) => PublicKey.fromBytes(bytes).getValue()), publicKeys.map((key) => key.getValue()),
message message
); );
} }