correction to E2E encrypted (double ratchet) envelope size

This commit is contained in:
Evgeny Poberezkin
2022-01-11 22:08:37 +00:00
parent 38f4cbe74f
commit 5f20f0124a
3 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -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:
+3 -2
View File
@@ -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
+1 -1
View File
@@ -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)