@@ -252,6 +252,11 @@ if (hasOpenSSL(3, 2)) {
252252 // Different domain separation means cross-verify must fail.
253253 assert . strictEqual ( crypto . verify ( null , data , pubKey , sig ) , false ) ;
254254
255+ // Ed25519 pure signatures are NOT compatible with Ed25519ph.
256+ // sign() output cannot be verified by verifyDigest().
257+ const pureSig = crypto . sign ( null , data , privKey ) ;
258+ assert . strictEqual ( crypto . verifyDigest ( null , digest , pubKey , pureSig ) , false ) ;
259+
255260 // KeyObject forms
256261 const privKeyObj = crypto . createPrivateKey ( privKey ) ;
257262 const pubKeyObj = crypto . createPublicKey ( pubKey ) ;
@@ -271,6 +276,9 @@ if (hasOpenSSL(3, 2)) {
271276 key : pubKey ,
272277 context : Buffer . from ( 'other' ) ,
273278 } , sig3 ) , false ) ;
279+
280+ // Ed25519ph+context signatures are NOT compatible with verify(ctx).
281+ assert . strictEqual ( crypto . verify ( null , data , { key : pubKey , context } , sig3 ) , false ) ;
274282 }
275283}
276284
@@ -297,6 +305,11 @@ if (hasOpenSSL(3, 2)) {
297305 // Different domain separation means cross-verify must fail.
298306 assert . strictEqual ( crypto . verify ( null , data , pubKey , sig ) , false ) ;
299307
308+ // Ed448 pure signatures are NOT compatible with Ed448ph.
309+ // sign() output cannot be verified by verifyDigest().
310+ const pureSig = crypto . sign ( null , data , privKey ) ;
311+ assert . strictEqual ( crypto . verifyDigest ( null , digest , pubKey , pureSig ) , false ) ;
312+
300313 // Ed448ph with context string
301314 {
302315 const context = Buffer . from ( 'my context' ) ;
@@ -309,6 +322,17 @@ if (hasOpenSSL(3, 2)) {
309322 key : pubKey ,
310323 context : Buffer . from ( 'other' ) ,
311324 } , sig2 ) , false ) ;
325+
326+ // Ed448ph+context signatures are NOT compatible with verify(ctx).
327+ assert . strictEqual ( crypto . verify ( null , data , { key : pubKey , context } , sig2 ) , false ) ;
328+ }
329+
330+ // Ed448+context signatures are NOT compatible with Ed448ph.
331+ // sign(ctx) output cannot be verified by verifyDigest(ctx).
332+ {
333+ const context = Buffer . from ( 'my context' ) ;
334+ const ctxSig = crypto . sign ( null , data , { key : privKey , context } ) ;
335+ assert . strictEqual ( crypto . verifyDigest ( null , digest , { key : pubKey , context } , ctxSig ) , false ) ;
312336 }
313337
314338 // Ed448ph with empty context string
0 commit comments