@@ -58,25 +58,29 @@ export function commonAlgorithms({
5858 } ) ;
5959 }
6060 } ) ;
61- it ( 'For P-256 keys, the default hashing function, SHA-2 with 256 bits' +
62- 'of output, MUST be used.' , async function ( ) {
63- 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.' ;
64- await assertions . verificationSuccess ( {
65- credential : credentials . get ( 'P-256' ) . get ( 'invalidHash' ) ,
66- verifier,
67- reason : `Should not verify VC with invalid hash.`
61+ if ( keyTypes . includes ( 'P-256' ) ) {
62+ it ( 'For P-256 keys, the default hashing function, SHA-2 with 256 ' +
63+ 'bits of output, MUST be used.' , async function ( ) {
64+ 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.' ;
65+ await assertions . verificationSuccess ( {
66+ credential : credentials . get ( 'P-256' ) . get ( 'invalidHash' ) ,
67+ verifier,
68+ reason : `Should not verify VC with invalid hash.`
69+ } ) ;
6870 } ) ;
69- } ) ;
70- it ( 'For P-384 keys, SHA-2 with 384-bits of output MUST be used, ' +
71- 'specified via the RDFC-1.0 implementation-specific parameter.' ,
72- async function ( ) {
73- 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.' ;
74- await assertions . verificationFail ( {
75- credential : credentials . get ( 'P-384' ) . get ( 'invalidHash' ) ,
76- verifier,
77- reason : `Should not verify VC with invalid hash.`
71+ }
72+ if ( keyTypes . includes ( 'P-384' ) ) {
73+ it ( 'For P-384 keys, SHA-2 with 384-bits of output MUST be used, ' +
74+ 'specified via the RDFC-1.0 implementation-specific parameter.' ,
75+ async function ( ) {
76+ 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.' ;
77+ await assertions . verificationFail ( {
78+ credential : credentials . get ( 'P-384' ) . get ( 'invalidHash' ) ,
79+ verifier,
80+ reason : `Should not verify VC with invalid hash.`
81+ } ) ;
7882 } ) ;
79- } ) ;
83+ }
8084 } ) ;
8185 }
8286 } ) ;
0 commit comments