]> Cypherpunks.ru repositories - govpn.git/blobdiff - doc/transport.texi
Explicitly store payload size in each message
[govpn.git] / doc / transport.texi
index d0cb75642564dbee51a693c1943fd9bbe9657840..b12a308469d54c840f6c23997c76ca877e3c9e6a 100644 (file)
@@ -2,8 +2,8 @@
 @section Transport protocol
 
 @verbatim
-ENCn(SERIAL) + ENC(KEY, ENCn(SERIAL), DATA) +
-    AUTH(ENCn(SERIAL) + ENC(KEY, ENCn(SERIAL), DATA))
+ENCn(SERIAL) + ENC(KEY, ENCn(SERIAL), DATA_SIZE+DATA) +
+    AUTH(ENCn(SERIAL) + ENC(KEY, ENCn(SERIAL), DATA_SIZE+DATA))
 @end verbatim
 
 All transport and handshake messages are indistinguishable from
@@ -24,6 +24,7 @@ Encrypted @code{SERIAL} is used as a nonce for @code{DATA} encryption:
 encryption key is different during each handshake, so (key, nonce) pair
 is always used only once. @code{ENC} is Salsa20 cipher, with established
 session @code{KEY} and encrypted @code{SERIAL} used as a nonce.
+@code{DATA_SIZE} is @emph{uint16} storing length of the @code{DATA}.
 
 @code{AUTH} is Poly1305 authentication function. First 256 bits of
 Salsa20 output are used as a one-time key for @code{AUTH}. Next 256 bits