Closed driftluo closed 5 years ago
Add a contrasting implementation of openssl and ring, and use the openssl implementation by default with native support
After testing, openssl implementation will be 5-20% faster than ring on my machine.
@quake @TheWaWaR update, please review the latest commit
relate #190
Due to the basic requirements of the industry standard for encryption algorithms, the replacement algorithm is
libressl
andboringssl
bind.twofish-ctr
aes-gcm/chacha20poly1305
aes-ctr
communicationaes-gcm
Note that
aes-ctr
is not the same encryption algorithm asaes-gcm/chacha20poly1305
:aes-ctr
is just encryption, it needshmac
assistance for integrity verificationaes-gcm/chacha20poly1305
belongs to theaead
algorithm, which itself has the function of encryption and integrity check, so it does not need the assistance ofhmac
, which is the only symmetric encryption algorithm supported byTLS 1.3
.The good news is that we have a side effect that has greatly improved performance. :P
On my machine:
before:
after:
The corresponding communication overhead has also dropped significantly(just in ci):
before:
after:
sorry,after testing, aes-ctr and openssl are compatible when nonce is in a certain range, but the nonce large probability generated during secio handshake is not in this range, so 0.1 and 0.2 are not compatible with high probability. Even so, I still insist on using openssl as the standard and think that the previous implementation is a bug.