GameNetworkingSockets
GameNetworkingSockets copied to clipboard
Add ChaCha20-Poly1305 crypto cipher support and introduce runtime availability checks for crypto ciphers
This changeset implements the following three major things:
- Introduces the support for ChaCha20-Poly1305 crypto cipher for all supported crypto backend libraries (OpenSSL and Libsodium). Libsodium uses the IETF variant of the algorithm, which should be compatible with other conforming implementations (e.g., it should be no problem if one client runs OpenSSL, while another runs libsodium).
- Add runtime availability checks for both AES-GCM and ChaCha20-Poly1305 ciphers (
IsAvailable()method for the correspondingCipherContextclasses). - Libsodium use is not restricted to x86/x86_64 anymore, as ChaCha20-Poly1305 should always be available.
This PR is based on the prior work from @past-due, that was done in the scope of https://github.com/ValveSoftware/GameNetworkingSockets/pull/197
Fixes: https://github.com/ValveSoftware/GameNetworkingSockets/issues/196