Skip to main content

Crate matter_crypto

Crate matter_crypto 

Source
Expand description

Matter session-establishment protocols.

Milestones 3 (PASE / SPAKE2+) and 4 (CASE / SIGMA) of the matter-rust roadmap.

§Scope

  • pase: Password Authenticated Session Establishment (SPAKE2+). M3.1 (current): math + KDF primitives. M3.2: state machines. M3.3: matter.js byte-parity verification.
  • case: Certificate Authenticated Session Establishment (SIGMA-I). Placeholder; M4 territory.
  • error: the crate error type.

§Cryptographic discipline

This crate never implements primitives. AES, ECDH, ECDSA, SHA, HKDF, and HMAC come from ring. EC scalar/point arithmetic (which ring deliberately doesn’t expose) comes from p256. We implement only the Matter-defined protocols on top of those primitives.

Re-exports§

pub use case::CaseCredentials;
pub use case::CaseMessageKind;
pub use case::CaseSessionKeys;
pub use case::CaseSessionOutput;
pub use case::LocalInfo;
pub use case::PeerInfo;
pub use case::ResumptionId;
pub use case::ResumptionRecord;
pub use case::Sigma1Outcome;
pub use error::Error;
pub use error::Result;
pub use operational::derive_compressed_fabric_id;
pub use operational::derive_group_privacy_key;
pub use operational::derive_group_session_id;
pub use operational::derive_operational_ipk;
pub use operational::group_multicast_ipv6;
pub use pase::pake_passcode_verifier;
pub use pase::PaseMessageKind;
pub use pase::PasePbkdfParams;
pub use pase::PaseProver;
pub use pase::PaseSessionKeys;
pub use pase::PaseVerifier;

Modules§

aead
AES-128-CCM-128 (16-byte key, 13-byte nonce, 16-byte tag) AEAD helpers.
case
Matter CASE (Certificate Authenticated Session Establishment) via SIGMA-I.
checkin
Matter Check-In message codec (Matter Core §4.18.2) — the payload an ICD sends unsolicited to a registered client when it briefly wakes. Reuses the crate’s AES-128-CCM AEAD and ring HMAC-SHA256; never implements primitives.
error
Error type for matter-crypto.
operational
Operational identity derivations (Matter Core Spec §4.3).
pase
Matter PASE (Password Authenticated Session Establishment).

Structs§

CaseInitiator
Initiator-side CASE state machine (new-session and resumption paths).
CaseResponder
Responder-side CASE state machine (new-session path).
RingSigner
CaseSigner backed by the p256 crate’s RFC 6979 deterministic ECDSA.

Enums§

SignerError
Errors returned by a CaseSigner implementation.

Traits§

CaseSigner
Pluggable ECDSA-P256-SHA256 signer for CASE.
Signer
Canonical name for the ECDSA-P256-SHA256 signer trait outside CASE.

Functions§

random_bytes
Fill buf with cryptographically secure random bytes (ring SystemRandom).