Skip to content

Commit 3d046e2

Browse files
committed
Add non-suite specific algorithm statements & start ecdsa-rdfc-2019.
1 parent c20af05 commit 3d046e2

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

tests/suites/algorithms.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*!
2+
* Copyright 2024 Digital Bazaar, Inc.
3+
* SPDX-License-Identifier: BSD-3-Clause
4+
*/
5+
6+
export function algorithmSuite({
7+
suiteName
8+
}) {
9+
it('When generating ECDSA signatures, the signature value MUST be ' +
10+
'expressed according to section 7 of [RFC4754] (sometimes referred to ' +
11+
'as the IEEE P1363 format) and encoded according to the specific ' +
12+
'cryptosuite proof generation algorithm.', async function() {
13+
this.test.link = 'https://w3c.github.io/vc-di-ecdsa/#algorithms:~:text=When%20generating%20ECDSA%20signatures%2C%20the%20signature%20value%20MUST%20be%20expressed%20according%20to%20section%207%20of%20%5BRFC4754%5D%20(sometimes%20referred%20to%20as%20the%20IEEE%20P1363%20format)%20and%20encoded%20according%20to%20the%20specific%20cryptosuite%20proof%20generation%20algorithm';
14+
});
15+
it('For P-256 keys, the default hashing function, SHA-2 with 256 bits of ' +
16+
'output, MUST be used.', async function() {
17+
this.test.link = 'https://w3c.github.io/vc-di-ecdsa/#algorithms:~:text=For%20P%2D256%20keys%2C%20the%20default%20hashing%20function%2C%20SHA%2D2%20with%20256%20bits%20of%20output%2C%20MUST%20be%20used.';
18+
});
19+
it('For P-384 keys, SHA-2 with 384-bits of output MUST be used, specified ' +
20+
'via the RDFC-1.0 implementation-specific parameter.', async function() {
21+
this.test.link = 'https://w3c.github.io/vc-di-ecdsa/#algorithms:~:text=For%20P%2D384%20keys%2C%20SHA%2D2%20with%20384%2Dbits%20of%20output%20MUST%20be%20used%2C%20specified%20via%20the%20RDFC%2D1.0%20implementation%2Dspecific%20parameter.';
22+
});
23+
}
24+
25+
export function ecdsaRdfc2019Algorithms({
26+
suiteName,
27+
vcVersion
28+
}) {
29+
return describe(`${suiteName} - Algorithms - VC ${vcVersion}`, function() {
30+
it('The transformation options MUST contain a type identifier for the ' +
31+
'cryptographic suite (type) and a cryptosuite identifier (cryptosuite).',
32+
async function() {
33+
this.test.link = 'https://w3c.github.io/vc-di-ecdsa/#transformation-ecdsa-rdfc-2019';
34+
});
35+
});
36+
}

0 commit comments

Comments
 (0)