()
| 207 | |
| 208 | #[test] |
| 209 | fn domain_separation() { |
| 210 | // A signature made over the raw hash must NOT verify as a change |
| 211 | // signature (domain separation). |
| 212 | let (signing_key, _seed) = test_keypair(); |
| 213 | let hash = Hash::of(b"content"); |
| 214 | let raw_sig = signing_key.sign(hash.as_bytes()).to_bytes(); |
| 215 | |
| 216 | let sig = ChangeSignature::new("did:atomic:x", raw_sig, *hash.as_bytes(), 0); |
| 217 | let public = signing_key.verifying_key().to_bytes(); |
| 218 | let err = verify_change_signature(&sig, &public, &hash).unwrap_err(); |
| 219 | assert!(matches!( |
| 220 | err, |
| 221 | ChangeSignatureError::SignatureVerificationFailed { .. } |
| 222 | )); |
| 223 | } |
| 224 | } |
nothing calls this directly
no test coverage detected