std1.0.0-beta-7 SafeC docs

Module crypto::tls

#include <std/crypto/tls.h> source

TLS 1.3 Record Layer Implements the TLS 1.3 record protocol (RFC 8446 §5). Crypto operations are delegated to std/crypto/aes.h and std/crypto/sha256.h. This module handles record framing, the inner content type and alerts. There is no handshake here: keys come from install_keys(). For complete TLS connections (handshake, certificates, every TLS 1.3 cipher suite, the OS's TLS library when there is one) use std/tls/tls.h.

Record protection is the AES-256-GCM AEAD of RFC 8446 §5.2 (the TLS_AES_256_GCM_SHA384 cipher suite's record layer), so protected records are wire-compatible with other TLS 1.3 stacks given the same traffic keys. Freestanding-safe.

Structs

TlsRecord
TlsTranscriptTranscript hash context (used during handshake).
TlsSessionTLS session — holds traffic keys and sequence numbers.

Macros

TLS_CHANGE_CIPHER_SPECTLS content types
TLS_ALERT
TLS_HANDSHAKE
TLS_APPLICATION_DATA
TLS_ALERT_WARNINGAlert levels and descriptions
TLS_ALERT_FATAL
TLS_ALERT_CLOSE_NOTIFY
TLS_ALERT_HANDSHAKE_FAIL
TLS_ALERT_DECODE_ERROR
TLS_MAX_RECORD_LENMaximum TLS plaintext/ciphertext fragment size (RFC 8446 §5.1)
TLS_KEY_LENRecord protection is TLS_AES_256_GCM_SHA384's AEAD: AES-256-GCM.
TLS_IV_LENper RFC 8446 §5.3
TLS_TAG_LENGCM authentication tag