use crate::{x3dh_initiate, x3dh_respond, LocalIdentity};
#[test]
fn x3dh_shared_secret_matches_between_initiator_and_responder() {
let bob = LocalIdentity::new("bob").unwrap();
let bob_bundle = bob.bundle();
let (initiation, alice_secret) = x3dh_initiate(&bob_bundle).unwrap();
let bob_secret = x3dh_respond(&bob.responder_keys(), &initiation).unwrap();
assert_eq!(alice_secret.as_bytes(), bob_secret.as_bytes());
}
#[test]
fn x3dh_initiate_rejects_invalid_bundle() {
let bob = LocalIdentity::new("bob").unwrap();
let mut bundle = bob.bundle();
bundle.signed_prekey_signature[0] ^= 0xFF;
assert!(x3dh_initiate(&bundle).is_err());
}