S2N is great, clean, actively maintained, and even has experimental support for post-quantum key exchange (compatible with BoringSSL and the Zig standard library).
> But formal methods (and TLA+ for distributed computation) don't eliminate side channels.
True, but they eliminate whole classes of attack. I'm normally aghast at people writing new code in plain C, but formally verified plain C counts as a whole other and better paradigm to me.
There have been some attempts at formally verifying lack of timing attacks (to the extent allowed by hardware). This is the one I know the most about: https://dl.acm.org/doi/pdf/10.1145/3314221.3314605 but there are likely others
Clarification: this still has dependencies. For example, it requires one of "OpenSSL (versions 1.0.2, 1.1.1 and 3.0.x), LibreSSL, BoringSSL, AWS-LC, and the Apple Common Crypto framework to perform the underlying cryptographic operations"
Other very nice TLS implementations in C/C++:
- Facebook Fizz: https://github.com/facebookincubator/fizz
- PicoTLS: https://github.com/h2o/picotls