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 {
|
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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue