Skip to main content

Crate zrtp

Crate zrtp 

Source
Expand description

RFC 6189 ZRTP protocol core, crypto helpers, and embeddable engine.

§Modules

  • wire: packet/message framing and typed protocol structures
  • crypto: hash/KDF/Confirm/DH/ECDH helpers
  • cache: retained shared-secret storage primitives
  • engine: embeddable handshake state and retransmission helpers

§Feature flags

  • crypto (enabled by default): hash/KDF, Confirm encryption/MAC, DH/ECDH, SAS rendering, and crypto-backed handshake paths.
  • Without default features, the crate remains usable for wire/message parsing, packet framing, negotiation data structures, retransmission helpers, and cache primitives. Crypto-backed APIs return Error::Unsupported.

§Example

use zrtp::*;

let hello = Hello {
    version: VERSION_1_10,
    client_id: *b"example-zrtp    ",
    hash_image_h3: [0; 32],
    zid: [1; 12],
    signature_capable: false,
    mitm_capable: false,
    passive_capable: false,
    hashes: vec![algos::HASH_S256],
    ciphers: vec![algos::CIPHER_AES1],
    auth_tags: vec![algos::AUTH_HS32],
    key_agreements: vec![algos::KEYAGREE_EC25],
    sas_types: vec![algos::SAS_B32],
    mac: [0; 8],
};

let mut engine = ZrtpEngine::new(Role::Initiator, hello, MemorySharedSecretStore::default());
let outbound = engine.start();
assert!(!outbound.is_empty());

Re-exports§

pub use cache::*;
pub use crypto::*;
pub use engine::*;
pub use wire::*;

Modules§

cache
crypto
engine
wire