diff --git a/CHANGELOG.md b/CHANGELOG.md index b3061ee36..9f1581779 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ New functionality: - Support for notification servers with new SMP commands: `NKEY`/`NID`, `NSUB`/`NMSG`. Efficiency improvements: -- Binary protocol encodings to reduce overhead from circa 15% to approximately 3.6% of transmitted application message size, with only 2.2% overhead for SMP protocol messages. +- Binary protocol encodings to reduce overhead from circa 15% to approximately 3.7% of transmitted application message size, with only 2.2% overhead for SMP protocol messages. - More performant cryptographic algorithms. For more information about SimpleX: diff --git a/protocol/simplex-messaging.md b/protocol/simplex-messaging.md index 4930291ab..0b4edd183 100644 --- a/protocol/simplex-messaging.md +++ b/protocol/simplex-messaging.md @@ -646,14 +646,14 @@ SMP transmission structure for received messages: 2 | originalLength 8- | smpPrivHeader (empty header for the message) ....... clientMsgBody (<= 16020 bytes = 16030 - 10) - -- TODO move internal structure to agent protocol + -- TODO move internal structure (below) to agent protocol 8- | agentPublicHeader (the size is for user messages post handshake, without E2E X3DH keys - it is version and 'M' for the messages - 3 bytes in total) ....... E2E double-ratchet encrypted (= 16012 bytes = 16020 - 8) 88 | double-ratchet header (actual size is 69 bytes, the rest is reserved) 16 | double-ratchet header auth tag 16 | double-ratchet header iv 16 | message auth tag (IV generated from chain ratchet) - ------- encrypted agent message (= 15876 bytes = 16012 - 136) + ------- encrypted agent message (= 15876 bytes = 16012 - 136) 2 | originalLength 84 (41) | agentHeader (8 + 1+32) 2 | %s"MM" @@ -665,6 +665,7 @@ SMP transmission structure for received messages: | ....... E2E double-ratchet encrypted end | + -- TODO move internal structure (above) to agent protocol ....... clientMsgBody end 0+ | smpClientMessage pad ------- smpClientMessage end diff --git a/src/Simplex/Messaging/Agent/Protocol.hs b/src/Simplex/Messaging/Agent/Protocol.hs index b191e1aff..893be29c7 100644 --- a/src/Simplex/Messaging/Agent/Protocol.hs +++ b/src/Simplex/Messaging/Agent/Protocol.hs @@ -161,7 +161,7 @@ e2eEncConnInfoLength :: Int e2eEncConnInfoLength = 14848 e2eEncUserMsgLength :: Int -e2eEncUserMsgLength = 15788 +e2eEncUserMsgLength = 15876 -- | Raw (unparsed) SMP agent protocol transmission. type ARawTransmission = (ByteString, ByteString, ByteString)