()
| 188 | |
| 189 | #[test] |
| 190 | fn wrong_key_fails() { |
| 191 | let (_signing_key, seed) = test_keypair(); |
| 192 | let (_other_key, other_seed) = test_keypair(); |
| 193 | let hash = Hash::of(b"content"); |
| 194 | let sig = sign_change("did:atomic:attacker", &seed, &hash, 0); |
| 195 | |
| 196 | // Verify against a DIFFERENT (victim's) key — the forge scenario. |
| 197 | let victim_key = SigningKey::from_bytes(&other_seed) |
| 198 | .verifying_key() |
| 199 | .to_bytes(); |
| 200 | |
| 201 | let err = verify_change_signature(&sig, &victim_key, &hash).unwrap_err(); |
| 202 | assert!(matches!( |
| 203 | err, |
| 204 | ChangeSignatureError::SignatureVerificationFailed { .. } |
| 205 | )); |
| 206 | } |
| 207 | |
| 208 | #[test] |
| 209 | fn domain_separation() { |
nothing calls this directly
no test coverage detected