Right now in the obfs4 implementation the client opens their TCP connection BEFORE generating their session keys. This means that if we have to re-roll the session keys (which we do with 50% probability because of elligator2) then there is a network observable delay between TCP dial and the first byte on the wire.
This should be the other way around.
One way to do this is to delay the await for the connection future until we are in ClientSession::complete_handshake since we don't actually use the stream object before then. This will require some minor refactoring in the client code, so I am putting it off for now.
Right now in the obfs4 implementation the client opens their TCP connection BEFORE generating their session keys. This means that if we have to re-roll the session keys (which we do with 50% probability because of elligator2) then there is a network observable delay between TCP dial and the first byte on the wire.
This should be the other way around.
One way to do this is to delay the
awaitfor the connection future until we are inClientSession::complete_handshakesince we don't actually use the stream object before then. This will require some minor refactoring in the client code, so I am putting it off for now.