assaabloy-ppi / salt-channel

The specification and the reference implementation of Salt Channel - a simple, light-weight secure channel protocol based on TweetNaCl by Bernstein.
MIT License
14 stars 11 forks source link

todo: implement one-write for m2+m3 #3

Closed franslundberg closed 7 years ago

franslundberg commented 7 years ago

See analysis below, saltchannel.dev.RunClient/RunServer were used. Implement the possibility that the server sends M2+M3 together in one write instead of two write operations.

WIRESHARK ANALYSIS 2017-05-10

402 bytes total

C       S
46 ----->
<----- 42
<---- 124
158 ---->
<----- 34

46+42+124+158+34 = 404 bytes. The Salt Channel handshake is: 46+42+124+124 = 336 bytes.

Note, we have two TCP packets 42+124. This could be avoided. When IO is slow compared to crypto, 42+124 should be combined into one write. When crypto is slow compared to IO, it makes sense to split them.

franslundberg commented 7 years ago

Done, see method SaltServerSession.setBufferM2(). Not enabled by default for now.