]> Cypherpunks.ru repositories - udpobfs.git/blobdiff - PROTOCOL
Reset nonces with the new key
[udpobfs.git] / PROTOCOL
index 4cef2f15a80410a191ea86579a55b0c488eb45602111838ccfba0b6ba4a36e48..257eacd441afabc58e595582e537d0a621fb9e63c1a0441c61a95c952821f887 100644 (file)
--- a/PROTOCOL
+++ b/PROTOCOL
@@ -1,5 +1,5 @@
-Protocol is trivial. Both peers has shared 256-bit key. SHA3 is used to
-derive four more keys from it:
+Protocol is trivial. Both peers have shared 256-bit key.
+SHA3 is used to derive four more keys from it:
 
     SHAKE128("go.cypherpunks.ru/udpobfs" || key) ->
         256-bit InitiatorEncryptionKey ||
@@ -7,11 +7,11 @@ derive four more keys from it:
         256-bit ResponderEncryptionKey ||
         256-bit ResponderObfuscationKey
 
-Each side has 64-bit packet number counter, that is used as a nonce.
-That counter is kept in memory and only its lower 24 bits are sent.
-When remote side receives 24-bit counter with lower value, then it
-increments in-memory counter's remaining part. Completely the same
-as Extended Sequence Numbers are done in IPsec's ESP.
+Each side has big-endian 64-bit packet number counter, that is used as a
+nonce. That counter is kept in memory and only its lower 24 bits are
+sent. When remote side receives 24-bit counter with lower value, then it
+increments in-memory counter's remaining part. Completely the same as
+Extended Sequence Numbers are done in IPsec's ESP.
 
 ChaCha20 is initialised with corresponding EncryptionKey and nonce equal
 to the full sequence number value. Its first 256-bit of output will be