SharkSSL adds TLS to a C or C++ application while leaving the network interface under your control. Start with the introduction to choose an integration path, then use the API groups below for details.
Choose the parts your product needs
- Client, server, or both: configure the roles with SHARKSSL_SSL_CLIENT_CODE and SHARKSSL_SSL_SERVER_CODE.
- TLS 1.2 and TLS 1.3: control protocol inclusion with SHARKSSL_TLS_1_2 and SHARKSSL_TLS_1_3. The negotiated version also depends on the peer.
- Post-quantum cryptography: combine ML-KEM with classical key exchange in TLS 1.3, or verify application signatures with ML-DSA-65. The PQC guide maps the available algorithms to their APIs.
- Constant-time native cryptography: fixed-access software AES/GHASH and timing-resistant private-key paths, with processor-specific assembly for the selected operations. See timing properties and acceleration.
- Certificates and trust: install local identity certificates and trusted Certificate Authority (CA) lists. See certificate management for the different purposes.
- Network integration: use selib for supported socket interfaces or drive the core API from your own transport. The core does not require a real-time operating system.
- Memory and code size: choose buffer sizes, optional APIs, and algorithm settings for your target. See build configuration.
- Crypto acceleration: select a processor and toolchain-specific implementation for Arm, x86/x64, RISC-V, ESP32-S3, Renesas RX or MIPS from Ports. The port guide specifies the available operations, required instructions and fallback behavior.
- OpenSSL-style integration: reuse supported TLS, BIO and EVP calls through the optional compatibility adapter.
- Session resumption: reuse negotiated session information when the peer and configuration permit it. See session management.
Understanding cipher suites
A cipher suite identifies a combination of algorithms used by TLS. The enabled suites depend on your compile-time settings; the peer must support a compatible choice. Use the definitions in SharkSSL.h and configuration macros as the reference for this source version. Availability follows the algorithms included in your build.
In TLS 1.2, a name such as TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 describes key agreement (ECDHE), certificate-based signatures (ECDSA), data encryption (ChaCha20), message authentication (Poly1305), and a hash (SHA-256). These algorithms perform different jobs; the certificate does not encrypt your application messages.
TLS 1.3 names are shorter. For example, TLS_AES_128_GCM_SHA256 names the record-protection algorithm and hash. Key agreement and certificate signature algorithms are negotiated separately. The current header also defines TLS_AES_256_GCM_SHA384 and TLS_CHACHA20_POLY1305_SHA256.