From 01000b4bf48932a47d7c8c889d2201f8e8085d46 Mon Sep 17 00:00:00 2001 From: Tobias Looker Date: Tue, 23 Feb 2021 11:24:35 +1300 Subject: [PATCH] feat: migrate to async api (#106) --- jest.config.js | 2 +- package.json | 4 ++-- src/BbsBlsSignatureProof2020.ts | 2 +- yarn.lock | 34 +++++++++++++++++++-------------- 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/jest.config.js b/jest.config.js index da28233..18bed4c 100644 --- a/jest.config.js +++ b/jest.config.js @@ -8,7 +8,7 @@ module.exports = { moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"], coveragePathIgnorePatterns: ["/__tests__"], testEnvironment: "node", - testTimeout: 10000, + testTimeout: 15000, verbose: true, name: pack.name, displayName: pack.name diff --git a/package.json b/package.json index 2b03bb7..667727b 100644 --- a/package.json +++ b/package.json @@ -67,8 +67,8 @@ "vc-js": "0.6.4" }, "dependencies": { - "@mattrglobal/bbs-signatures": "0.4.0", - "@mattrglobal/bls12381-key-pair": "0.4.0", + "@mattrglobal/bbs-signatures": "0.4.1-unstable.10c5b9b", + "@mattrglobal/bls12381-key-pair": "0.4.1-unstable.6b18486", "@stablelib/random": "1.0.0", "bs58": "4.0.1", "jsonld": "3.1.0", diff --git a/src/BbsBlsSignatureProof2020.ts b/src/BbsBlsSignatureProof2020.ts index 5627c9d..738f7c3 100644 --- a/src/BbsBlsSignatureProof2020.ts +++ b/src/BbsBlsSignatureProof2020.ts @@ -282,7 +282,7 @@ export class BbsBlsSignatureProof2020 extends suites.LinkedDataProof { const key = await this.LDKeyClass.from(verificationMethod); // Verify the proof - const verified = blsVerifyProof({ + const verified = await blsVerifyProof({ proof: new Uint8Array(Buffer.from(proof.proofValue, "base64")), publicKey: new Uint8Array(key.publicKeyBuffer), messages: statementsToVerify, diff --git a/yarn.lock b/yarn.lock index ed1798c..18c8b66 100644 --- a/yarn.lock +++ b/yarn.lock @@ -594,25 +594,26 @@ mkdirp "^0.5.1" rimraf "^2.5.2" -"@mattrglobal/bbs-signatures@0.4.0": - version "0.4.0" - resolved "https://registry.yarnpkg.com/@mattrglobal/bbs-signatures/-/bbs-signatures-0.4.0.tgz#de106c4a5946e590dc1ecaf672e90c284a5fba85" - integrity sha512-r6ed3N9xO+7AlO6FF2rVksH+HjfLwxZ9eKWHg3saTi5hzhJyehE3Qahj+goddgYD6emzwzrVbawNZDTttMQUKg== +"@mattrglobal/bbs-signatures@0.4.1-unstable.10c5b9b": + version "0.4.1-unstable.10c5b9b" + resolved "https://registry.yarnpkg.com/@mattrglobal/bbs-signatures/-/bbs-signatures-0.4.1-unstable.10c5b9b.tgz#464fb47df1564c932cf4f4a0215054e57c24176d" + integrity sha512-xiUmIlQc/jjfaMNIcEC4M293/+7TonzN/vF0SfyzXloREhAXFz/ZKXosvqXZcwLh3qktl7xejUazCnS3tPjpRQ== optionalDependencies: - "@mattrglobal/node-bbs-signatures" "0.10.0" + "@mattrglobal/node-bbs-signatures" "0.11.0" -"@mattrglobal/bls12381-key-pair@0.4.0": - version "0.4.0" - resolved "https://registry.yarnpkg.com/@mattrglobal/bls12381-key-pair/-/bls12381-key-pair-0.4.0.tgz#595b4651ab59f3cb9e98497bf6a6b56a50a232a9" - integrity sha512-cbo5PkeIIOtfgf/wS1n+B6XsBWatYyOFjz+cehr/25x2SB0q8tO2leAaahvZNJmQQHIj1/hVVPigO1mh40sZ3w== +"@mattrglobal/bls12381-key-pair@0.4.1-unstable.6b18486": + version "0.4.1-unstable.6b18486" + resolved "https://registry.yarnpkg.com/@mattrglobal/bls12381-key-pair/-/bls12381-key-pair-0.4.1-unstable.6b18486.tgz#87d2e5d62e711a48291f83507af282fd04fe35f2" + integrity sha512-GX8GCIwz3h2kKKJ7XCczJc+P4iGvJP2RbRfQcGv8nZMeP8jHsGqLVoqxG/KkU/vzdb8SeuzbM7M+U7uMGcZKpQ== dependencies: - "@mattrglobal/bbs-signatures" "0.4.0" + "@mattrglobal/bbs-signatures" "0.4.1-unstable.10c5b9b" bs58 "4.0.1" + rfc4648 "1.4.0" -"@mattrglobal/node-bbs-signatures@0.10.0": - version "0.10.0" - resolved "https://registry.yarnpkg.com/@mattrglobal/node-bbs-signatures/-/node-bbs-signatures-0.10.0.tgz#6bdcdf135f8b101bf74f07207589104ef505db3d" - integrity sha512-i2sd61gXQJ0YJZ6JLUnKoQ8w+V39OOh5cdrYv0odnnF00H0a8y9JbSoDbzqEywFGol6oXk2ezFGI/ilU+1R7wQ== +"@mattrglobal/node-bbs-signatures@0.11.0": + version "0.11.0" + resolved "https://registry.yarnpkg.com/@mattrglobal/node-bbs-signatures/-/node-bbs-signatures-0.11.0.tgz#c63ab8648a529cfe1dd855cc78a93f78ee27a9f4" + integrity sha512-V0wcY0ZewrPOiMOrL3wam0oYL1SLbF2ihgAM6JQvLrAKw1MckYiJ8T4vL+nOBs2hf1PA1TZI+USe5mqMWuVKTw== dependencies: neon-cli "0.4.0" node-pre-gyp "0.14.0" @@ -5380,6 +5381,11 @@ ret@~0.1.10: resolved "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== +rfc4648@1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/rfc4648/-/rfc4648-1.4.0.tgz#c75b2856ad2e2d588b6ddb985d556f1f7f2a2abd" + integrity sha512-3qIzGhHlMHA6PoT6+cdPKZ+ZqtxkIvg8DZGKA5z6PQ33/uuhoJ+Ws/D/J9rXW6gXodgH8QYlz2UCl+sdUDmNIg== + right-pad@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/right-pad/-/right-pad-1.0.1.tgz#8ca08c2cbb5b55e74dafa96bf7fd1a27d568c8d0"