|
5 | 5 | import { |
6 | 6 | assertions, |
7 | 7 | } from 'data-integrity-test-suite-assertion'; |
| 8 | +import {sdVerifySetup} from '../setup.js'; |
8 | 9 |
|
9 | 10 | export function sd2023Algorithms({ |
10 | | - credential, |
| 11 | + credentials, |
11 | 12 | verifiers, |
12 | 13 | issuers, |
13 | | - mandatoryPointers, |
14 | | - selectivePointers, |
15 | 14 | keyTypes, |
16 | 15 | suiteName, |
17 | 16 | vcVersion, |
18 | | - setup = _setup |
| 17 | + setup = sdVerifySetup |
19 | 18 | }) { |
20 | 19 | return describe(`${suiteName} - Algorithms - VC ${vcVersion}`, function() { |
21 | 20 | this.matrix = true; |
22 | 21 | this.report = true; |
23 | 22 | this.implemented = []; |
24 | 23 | this.rowLabel = 'Test Name'; |
25 | 24 | this.columnLabel = 'Implementation'; |
26 | | - const credentials = new Map(keyTypes.map(kt => [kt, null])); |
| 25 | + let fixtures = new Map(); |
27 | 26 | before(async function() { |
28 | | - for(const keyType of keyTypes) { |
29 | | - credentials.set(keyType, await setup({ |
30 | | - suiteName, |
31 | | - keyType, |
32 | | - credential, |
33 | | - mandatoryPointers, |
34 | | - selectivePointers |
35 | | - })); |
36 | | - } |
| 27 | + fixtures = await setup({ |
| 28 | + suite: suiteName, |
| 29 | + keyTypes, |
| 30 | + credentials |
| 31 | + }); |
37 | 32 | }); |
38 | 33 | for(const [name, {endpoints}] of verifiers) { |
39 | 34 | const [verifier] = endpoints; |
@@ -101,6 +96,11 @@ export function sd2023Algorithms({ |
101 | 96 | 'MUST be raised and SHOULD convey an error type of ' + |
102 | 97 | 'PROOF_VERIFICATION_ERROR.', async function() { |
103 | 98 | this.test.link = 'https://w3c.github.io/vc-di-ecdsa/#selective-disclosure-functions:~:text=labelMap%22%2C%20and%20%22mandatoryIndexes%22.-,If%20the%20proofValue%20string%20does%20not%20start%20with%20u%2C%20indicating%20that%20it%20is%20a%20multibase%2Dbase64url%2Dno%2Dpad%2Dencoded%20value%2C%20an%20error%20MUST%20be%20raised%20and%20SHOULD%20convey%20an%20error%20type%20of%20PROOF_VERIFICATION_ERROR.,-Initialize%20decodedProofValue%20to'; |
| 99 | + await assertions.verificationFail({ |
| 100 | + credential, |
| 101 | + verifier, |
| 102 | + reason: 'Should not verify proofValue not starting with u' |
| 103 | + }); |
104 | 104 | }); |
105 | 105 | it('If the decodedProofValue does not start with the ECDSA-SD ' + |
106 | 106 | 'disclosure proof header bytes 0xd9, 0x5d, and 0x01, an error ' + |
|
0 commit comments