module
Matter::Session::SecureMessage
Overview
Secure message encoder/decoder for Matter protocol Uses AES-128-CCM for authenticated encryption
Extended Modules
Defined in:
matter/session/secure_message.crConstant Summary
-
MIC_LENGTH =
16 -
MIC (Message Integrity Check) length in bytes
-
NONCE_LENGTH =
13 -
Nonce size for AES-CCM in Matter (13 bytes)
-
PRIVACY_NONCE_LENGTH =
13 -
Privacy nonce for unencrypted header (13 bytes)
Instance Method Summary
-
#build_aad(packet_header_bytes : Bytes) : Bytes
Build Additional Authenticated Data (AAD) for AES-CCM AAD = packet header (unencrypted portion)
-
#build_nonce(source_node_id : UInt64, message_counter : UInt32, security_flags : UInt8 = 0_u8) : Bytes
Build nonce for AES-CCM encryption/decryption Format: source_node_id (8 bytes) | message_counter (4 bytes) | security_flags (1 byte)
-
#decrypt(context : SecureContext, encrypted_payload : Bytes, message_counter : UInt32, packet_header : Codec::MessageCodec::PacketHeader, crypto : Crypto::CryptoBase = Crypto::StandardCrypto.new) : Bytes
Decrypt a message payload using session context
-
#decrypt_with_params(key : Bytes, encrypted_payload : Bytes, source_node_id : UInt64, message_counter : UInt32, session_id : UInt16, security_flags : UInt8 = 0_u8, crypto : Crypto::CryptoBase = Crypto::StandardCrypto.new) : Bytes
Decrypt with explicit parameters (for testing)
-
#encrypt(context : SecureContext, payload : Bytes, packet_header : Codec::MessageCodec::PacketHeader, crypto : Crypto::CryptoBase = Crypto::StandardCrypto.new) : Bytes
Encrypt a message payload using session context
-
#encrypt_with_params(key : Bytes, payload : Bytes, source_node_id : UInt64, message_counter : UInt32, session_id : UInt16, security_flags : UInt8 = 0_u8, crypto : Crypto::CryptoBase = Crypto::StandardCrypto.new) : Bytes
Encrypt with explicit parameters (for testing)
Instance Method Detail
Build Additional Authenticated Data (AAD) for AES-CCM AAD = packet header (unencrypted portion)
Build nonce for AES-CCM encryption/decryption Format: source_node_id (8 bytes) | message_counter (4 bytes) | security_flags (1 byte)
Decrypt a message payload using session context
Decrypt with explicit parameters (for testing)
Encrypt a message payload using session context
Encrypt with explicit parameters (for testing)