From 4a74e1ff4433f6ce6aa51a727fca16e33ac1a25b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marin=20Petruni=C4=87?= Date: Sat, 29 Aug 2020 16:18:33 +0200 Subject: [PATCH 1/2] allow passing decompressed keys --- src/index.ts | 2 +- src/signature.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 0e5f485..1f26e25 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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; } diff --git a/src/signature.ts b/src/signature.ts index dbe1e01..a3c8a12 100644 --- a/src/signature.ts +++ b/src/signature.ts @@ -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 ); } From 8da163ebbda7af1ee239439e919ec24c6554c061 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marin=20Petruni=C4=87?= Date: Sat, 29 Aug 2020 16:20:56 +0200 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed9491d..f4f929a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [dev] + +### BREAKING CHANGES +* Signature.verifyAggregate now takes decompressed pubkeys instead of raw bytes of compressed key + ## [3.0.0] - 2020-07-31 ### BREAKING CHANGES