SecurePayloadCodec

Reliability frame format, version 1. Its output is the plaintext handed to ProtocolEngine.encrypt; the ciphertext wire format (CiphertextMessageCodec) is not affected. Full specification: docs/message-reliability.md.

ApplicationMessage: version=0x01 | type=0x01 | messageId[16] | length:u32 | body
Acknowledgement: version=0x01 | type=0x02 | messageId[16]

Integers are unsigned 32-bit big-endian. Every plaintext of a milestone 8 peer is such a frame; there is no fallback for raw plaintext. Decoding treats input as untrusted: anything that is not exactly one well-formed frame is rejected with a ProtocolException. Encoding is deterministic.

Properties

Link copied to clipboard
Link copied to clipboard
const val MAX_BODY_SIZE: Int

Largest application body. The frame adds APPLICATION_HEADER_SIZE bytes; the result, plus the ratchet overhead, stays below CiphertextMessageCodec.MAX_RATCHET_PAYLOAD_SIZE.

Link copied to clipboard

Upper bound for a complete encoded frame.

Link copied to clipboard
const val TYPE_ACKNOWLEDGEMENT: Int = 2
Link copied to clipboard
Link copied to clipboard
const val VERSION: Int = 1

Functions

Link copied to clipboard
Link copied to clipboard