SharkSSL C/C++ Reference
TLS, cryptography, certificates, and PSA integration
SharkSsl Configuration (macros)

Detailed Description

Add/remove SharkSSL features and/or optimize for speed versus size.

Set configuration macros consistently for all C and assembly files in your build. Begin with the shipped defaults, establish a working connection, and then measure individual changes on your target.

Modules

 PSA consumer
 
 HASH algorithms
 

Files

file  SharkSSL_opts.h
 See Choose a SharkSSL API for build scope and the owning API layer.
 

Macros

#define SHARKSSL_TLS_1_3   1
 TLS 1.3 stack Disable by setting SHARKSSL_TLS_1_3=0. More...
 
#define SHARKSSL_TLS_1_2   1
 TLS 1.2 stack Disable by setting SHARKSSL_TLS_1_2=0. More...
 
#define SHARKSSL_PSA_KEY_SLOTS   12
 Number of volatile key slots in the SharkSSL PSA provider. More...
 
#define SHARKSSL_PSA_DYNAMIC_KEY_SLOTS   0
 Select 1 to allocate SharkSSL PSA provider key slots on demand. More...
 
#define SHARKSSL_RFC_9846_CONFORMANCE_PROFILE   0
 Select 1 to enforce the compile-time feature set required by the general RFC 9846 profile. More...
 
#define SHARKSSL_USE_AES_256   1
 Enable/disable AES 256. More...
 
#define SHARKSSL_USE_AES_128   1
 Enable/disable AES 128. More...
 
#define SHARKSSL_USE_AES_192   0
 AES-192 is not used in SSL/TLS enable only if needed in application using the crypto API. More...
 
#define SHARKSSL_ENABLE_AES_GCM   1
 AES-GCM requires AES: the AES-GCM ciphersuites are included. More...
 
#define SHARKSSL_AES_GCM_CT_M4_ASM   0
 Select the Cortex-M4/M7/M85 GHASH helper for software CT AES-GCM. More...
 
#define SHARKSSL_AES_GCM_CT_MVE_ASM   0
 Select the Cortex-M85 Helium (MVE) GHASH for software CT AES-GCM, instead of SHARKSSL_AES_GCM_CT_M4_ASM. More...
 
#define SHARKSSL_AES_GCM_CT_RX_EMULU   0
 Use RXv3 EMULU for the software AES-GCM GHASH on little-endian Renesas RX. More...
 
#define SHARKSSL_AES_CT_KEY_ASM   0
 Run the AES-128/192/256 key expansion of the bitsliced AES in Thumb-2 on little-endian Cortex-M4/M7/M33/M85: compile crypto/Cortex-M_GCC/SharkSslAesCT_M4.S (GCC) or crypto/Cortex-M_IAR/SharkSslAesCT_M4.s (IAR) with the same options. More...
 
#define SHARKSSL_USE_CHACHA20   1
 AES-CCM requires AES: only for crypto functions - CCM TLS ciphersuites removed. More...
 
#define SHARKSSL_SSL_SERVER_CODE   1
 Select 1 to enable SERVER side TLS. More...
 
#define SHARKSSL_ENABLE_CLIENT_AUTH   1
 Select 1 to enable client authentication from server. More...
 
#define SHARKSSL_MAX_HANDSHAKE_LENGTH   0x00004000UL
 Select 1 to enable support for Post Handshake Authentication (RFC 8446 sections 4.2.6 and 4.6.2) More...
 
#define SHARKSSL_USE_MLKEM   SHARKSSL_ENABLE_PQC
 Enable TLS 1.3 hybrid key agreement using ML-KEM-768 with X25519 or secp256r1, and ML-KEM-1024 with secp384r1 when that curve is enabled. More...
 
#define SHARKSSL_PQC_DEFER_INITIAL_SHARE   0
 With PQC and HelloRetryRequest enabled, send an empty initial key_share. More...
 
#define SHARKSSL_MLKEM_M4_ASM   0
 Select the native Thumb-2 polynomial and Keccak kernels for ML-KEM on little-endian Cortex-M4/M7 or Cortex-M33 with DSP. More...
 
#define SHARKSSL_OPTIMIZED_MLKEM_ASM   SHARKSSL_MLKEM_M4_ASM
 Select 1 to use the available assembly kernels for ML-KEM-768 and ML-KEM-1024. More...
 
#define SHARKSSL_OPTIMIZED_KECCAK_ASM   SHARKSSL_MLKEM_M4_ASM
 Use native Keccak-f[1600] for SHA-3 and SHAKE in ML-KEM and ML-DSA. More...
 
#define SHARKSSL_KECCAK_FAST_C   0
 Select the portable, two-bank C permutation for native PQC. More...
 
#define SHARKSSL_ENABLE_HELLO_RETRY_REQUEST   SHARKSSL_TLS_1_3
 Compile TLS 1.3 HelloRetryRequest handling. More...
 
#define SHARKSSL_TLS_1_3_INITIAL_KEY_SHARE_X25519_ONLY   0
 Select 1 to send only an X25519 key share in the initial TLS 1.3 ClientHello. More...
 
#define SHARKSSL_TLS_1_3_INITIAL_BRAINPOOL_GROUP   0
 Select one RFC 8734 Brainpool group as the initial TLS 1.3 key share Set to TLS_NAMEDGROUP_BRAINPOOLP256R1TLS13, P384R1TLS13, or P512R1TLS13 Zero retains the usual initial key shares. More...
 
#define SHARKSSL_ENABLE_KEY_UPDATE   SHARKSSL_TLS_1_3
 Select 1 to enable TLS 1.3 KeyUpdate support (RFC 9846 section 4.7.3; RFC 8446 section 4.6.3). More...
 
#define SHARKSSL_TLS_1_3_AES_GCM_KEY_UPDATE_THRESHOLD   0x00800000UL
 Number of TLS 1.3 records that may be encrypted with one AES-GCM key before SharkSSL proactively sends a KeyUpdate. More...
 
#define SHARKSSL_SSL_CLIENT_CODE   1
 Select 1 to enable CLIENT side TLS. More...
 
#define SHARKSSL_RANDOMIZE_EXTENSIONS   1
 Select 1 to randomize the order of extensions in ClientHello. More...
 
#define SHARKSSL_ENABLE_SNI   1
 Select 1 to enable support for Server Name Indication. More...
 
#define SHARKSSL_ENABLE_CA_EXTENSION   1
 Select 1 to enable support for Certificate Authorities extension (RFC 8446 section 4.2.4) Note: SHARKSSL_TLS_1_3 and SHARKSSL_ENABLE_CA_LIST must be enabled. More...
 
#define SHARKSSL_ENABLE_RSA   1
 Select 0 to disable RSA: the RSA ciphersuites in TLS 1.2 and RSA certificates and signatures in TLS 1.2 and TLS 1.3. More...
 
#define SHARKSSL_ENABLE_SESSION_CACHE   1
 Select 1 to enable session caching. More...
 
#define SHARKSSL_ENABLE_SECURE_RENEGOTIATION   SHARKSSL_TLS_1_2
 Select 1 to enable renegotiation Only secure renegotiation (RFC 5746) is supported Note: with the default define below, it is enabled whenever TLS 1.2 is NOTE: IMPLEMENTED ONLY ON THE SERVER SIDE. More...
 
#define SHARKSSL_ENABLE_DHE_RSA   0
 Enable legacy TLS 1.2 DHE_RSA ciphersuites. More...
 
#define SHARKSSL_DHE_MIN_PRIME_BITS   2048
 Minimum size in bits of the DHE_RSA prime p sent by a server: the client aborts the handshake with an insufficient_security alert when p is shorter. More...
 
#define SHARKSSL_USE_SHA_256   1
 TLS 1.2/1.3 require SHA-256, do not modify the following settings. More...
 
#define SHARKSSL_ENABLE_SELECT_CIPHERSUITE   1
 Enable/disable the SharkSslCon_selectCiphersuite API. More...
 
#define SHARKSSL_SELECT_CIPHERSUITE_LIST_DEPTH   8
 Determine the number of ciphersuites that can be selected, in decreasing order of preference; this value is only in effect if the SHARKSSL_ENABLE_SELECT_CIPHERSUITE is selected. More...
 
#define SHARKSSL_ENABLE_ALPN_EXTENSION   1
 Enable/disable ALPN API (support for ALPN extension, RFC 7301) More...
 
#define SHARKSSL_ENABLE_RSA_API   1
 Enable/disable RSA API (sharkssl_RSA_public_encrypt, sharkssl_RSA_private_decrypt, sharkssl_RSA_private_encrypt, sharkssl_RSA_public_decrypt, SharkSslRSAKey_size) More...
 
#define SHARKSSL_ENABLE_RSA_PKCS1   1
 Enable the native RSA key generator. More...
 
#define SHARKSSL_ENABLE_ECDSA_API   1
 Enable/disable RSASSA-PSS padding in RSA API (RFC 8017) (SHARKSSL_ENABLE_RSA_API must be enabled to use RSASSA-PSS through the RSA API) More...
 
#define SHARKSSL_ECDSA_ONLY_VERIFY   0
 Disable ECDSA sign API functions (sharkssl_ECDSA_sign, SharkSslECDSA_siglen) - effective only if ECDSA API is compiled (SHARKSSL_ENABLE_ECDSA_API must be enabled); used to achieve minimum code size in crypto-only builds. More...
 
#define SHARKSSL_ENABLE_PEM_API   1
 Select 1 to enable PEM certs/keys decoding If RSA_API is enabled, then also the functions sharkssl_PEM_to_RSAKey and SharkSslRSAKey_free are available If ECDSA_API is enabled, then also the functions sharkssl_PEM_to_ECCKey and SharkSslECCKey_free are available. More...
 
#define SHARKSSL_ENABLE_INFO_API   1
 Enable/disable support for encrypted PKCS#8 certificates in sharkssl_PEM function (requires SHARKSSL_ENABLE_AES_CBC and SHARKSSL_USE_SHA_256) More...
 
#define SHARKSSL_ENABLE_CERT_COMMON_NAMES   0
 Enable a per-connection policy hook for presented peer certificates. More...
 
#define SHARKSSL_ENABLE_CERT_SPKI   0
 Retain the original DER SubjectPublicKeyInfo in cloned peer leaf certificates for public-key pinning. More...
 
#define SHARKSSL_ENABLE_CERT_CHAIN   1
 Select 1 to enable certificate chain support. More...
 
#define SHARKSSL_ENABLE_CA_LIST   1
 Select 1 to enable CA check (client or server with client auth) More...
 
#define SHARKSSL_ENABLE_CERTSTORE_API   1
 Select 1 to enable certificate storage. More...
 
#define SHARKSSL_ENABLE_CERT_KEYUSAGE   0
 Select 1 to enable SharkSslCertInfo_parseCert for local DER certificates. More...
 
#define SHARKSSL_MD5_SMALL_FOOTPRINT   0
 Select 1 for smaller, but slower MD5. More...
 
#define SHARKSSL_SHA1_SMALL_FOOTPRINT   0
 Select 1 for smaller, but slower SHA1. More...
 
#define SHARKSSL_SHA256_SMALL_FOOTPRINT   0
 Select 1 for smaller, but slower SHA256. More...
 
#define SHARKSSL_BIGINT_EXP_SLIDING_WINDOW_K   4
 Select a window size between 1 (slower, less RAM) and 5. More...
 
#define SHARKSSL_BIGINT_MULT_LOOP_UNROLL   1
 Select 0 for smaller multiplication loops or 1 to unroll them. More...
 
#define SHARKSSL_ENABLE_AES_CTR_MODE   1
 Select 1 to include AES CTR mode (USE_AES_xxx must be enabled) More...
 
#define SHARKSSL_AES_CIPHER_LOOP_UNROLL   1
 Select 0 for smaller AES loops or 1 to unroll them. More...
 
#define SHARKSSL_UNALIGNED_ACCESS   0
 Select 1 if your architecture supports unaligned memory access (x86, ARM-Cortex-M3, ColdFire) More...
 
#define SHARKSSL_USE_ECC   1
 Elliptic Curve Cryptography. More...
 
#define SHARKSSL_ENABLE_ECDSA   1
 Select 1 to enable generation and verification of elliptic curve digital signatures. More...
 
#define SHARKSSL_ECC_VERIFY_POINT   1
 Select 1 to verify that a point lies on a curve; TLS 1.3 always enables this verification for peer key shares. More...
 
#define SHARKSSL_ECC_FIXED_BASE_COMB   1
 Enable Ed25519/Ed448 support (RFC 8032). More...
 
#define SHARKSSL_ECC_MULT_FIXED_WINDOW   4
 Compute k*Q for any other point Q of SECP256R1, SECP384R1 and SECP521R1 (ECDH shared secret) with a fixed window of this many bits and the same timing resistance as generic multiplication. More...
 
#define SHARKSSL_ECC_WINDOW_CACHE_DOUBLES   1
 Cache doubled points in the optimized P-256/P-384 variable-base window with native field ASM on Cortex-M, AArch64, RX and x64, and P-256 on RV32IM. More...
 
#define SHARKSSL_ECC_SMALL_FOOTPRINT   0
 Select 1 for smaller and slower ECDSA signing and fixed-base comb code with the same timing resistance. More...
 
#define SHARKSSL_ECC_USE_SECP256R1   1
 Enable/disable the SECP256R1 curve. More...
 
#define SHARKSSL_ECC_USE_SECP384R1   1
 Enable/disable the SECP384R1 curve. More...
 
#define SHARKSSL_ECC_USE_SECP521R1   1
 Enable/disable the SECP521R1 curve. More...
 
#define SHARKSSL_ECC_USE_BRAINPOOLP256R1   1
 Enable/disable the brainpoolP256r1 curve (RFC 5639) More...
 
#define SHARKSSL_ECC_USE_BRAINPOOLP384R1   1
 Enable/disable the brainpoolP384r1 curve (RFC 5639) More...
 
#define SHARKSSL_ECC_USE_BRAINPOOLP512R1   1
 Enable/disable the brainpoolP512r1 curve (RFC 5639) More...
 
#define SHARKSSL_ECC_USE_CURVE25519   1
 Enable/disable the Curve25519 curve (RFC 7748) More...
 
#define SHARKSSL_ENABLE_X25519_API   1
 Enable/disable the X25519 public API (sharkssl_X25519_createKeyPair, sharkssl_X25519_sharedSecret) More...
 
#define SHARKSSL_X25519_DEDICATED   1
 Select 1 to use dedicated Curve25519 field arithmetic (SharkSslBigInt.c) modulo p = 2^255 - 19, with a fixed inversion chain. More...
 
#define SHARKSSL_ECC_USE_CURVE448   0
 Enable/disable the Curve448 curve (RFC 7748) More...
 
#define SHARKSSL_ENABLE_ECDHE_RSA   1
 Select 1 to enable ECDHE_RSA ciphersuites (RFC 8422) Elliptic Curve Cryptography (SHARKSSL_USE_ECC) must be enabled RSA (SHARKSSL_ENABLE_RSA) must be enabled. More...
 
#define SHARKSSL_ENABLE_ECDHE_ECDSA   1
 Select 1 to enable ECDHE_ECDSA ciphersuites (RFC 8422) Elliptic Curve Cryptography (SHARKSSL_USE_ECC) must be enabled SHARKSSL_ENABLE_ECDSA must be set. More...
 
#define SHARKSSL_OPTIMIZED_BIGINT_ASM   0
 Select the full BigInt assembly backend: add, subtract, right shift, multiplication and Montgomery reduction. More...
 
#define SHARKSSL_OPTIMIZED_BIGINT_WORD_ASM   0
 Select an assembly backend for BigInt add, subtract and right shift only. More...
 
#define SHARKSSL_ECC_P256_ASM   0
 Select 1 to use the assembly for the P-256 (secp256r1) field arithmetic: on Cortex-M4/M7/M33 with DSP/M85 SharkSslP256_M4.S for GCC or Keil, SharkSslP256_M4.s for IAR; on M0/M0+/M23 use SharkSslP256_M0 instead. More...
 
#define SHARKSSL_ECC_P256_ASM_COMPACT   0
 Cortex-M4/M7/M33 with DSP/M85, GCC and IAR, with SHARKSSL_ECC_P256_ASM: select 1 for the compact P-256 multiplication of SharkSslP256_M4 (the field functions then take about 0.9 KB instead of 1.5 KB), 0 for the unrolled one. More...
 
#define SHARKSSL_ECC_P384_ASM   0
 Select 1 to use a native P-384 (secp384r1) field backend: on Cortex-M4/M7/M33 with DSP/M85 SharkSslP384_M4.S for GCC or Keil, SharkSslP384_M4.s for IAR; on M0/M0+/M23 use SharkSslP384_M0 instead. More...
 
#define SHARKSSL_ECC_P384_ASM_COMPACT   0
 Cortex-M4/M7/M33 with DSP/M85, GCC and IAR, with SHARKSSL_ECC_P384_ASM: select 1 to share one 4x4 multiply-accumulate block, 0 to inline all nine blocks. More...
 
#define SHARKSSL_OPTIMIZED_CHACHA_ASM   0
 Enabling assembler optimized CHACHA requires SharkSslCrypto_XX.s. More...
 
#define SHARKSSL_OPTIMIZED_POLY1305_ASM   0
 Enabling assembler optimized POLY requires SharkSslCrypto_XX.s. More...
 
#define SHARKSSL_OPTIMIZED_SHA256_ASM   0
 Enabling assembler SHA-256 requires the target backend. More...
 
#define SHARKSSL_OPTIMIZED_SHA384_ASM   0
 Enabling assembler SHA-384 and SHA-512 requires the target backend. More...
 
#define SHARKSSL_OPTIMIZED_GHASH_ASM   0
 Enabling assembler optimized GHASH requires SharkSslCrypto_XX.s. More...
 
#define SHARKSSL_OPTIMIZED_GCM_ASM   0
 Enabling the combined assembler AES-GCM block kernel requires SharkSslCrypto_XX.s. More...
 
#define SHARKSSL_OPTIMIZED_AES_ASM   0
 Enabling the assembler AES block cipher requires SharkSslAes_XX.s: AES-NI on x86/x64, AES-CE on ARM64 (with SharkSslCrypto_ARM64.c). More...
 
#define SHARKSSL_OPTIMIZED_GCM_VAES_ASM   0
 Enabling the VAES/VPCLMULQDQ AES-GCM backend requires the VAES assembly file and its CPUID probe in addition to the AES-NI kernel. More...
 
#define SHARKSSL_ESP32P4_HW_SHA1   0
 ESP32-P4 hardware acceleration. More...
 
#define SHARKSSL_ESP32P4_HW_SHA256   0
 Optional ESP32-P4 SHA-256 peripheral compression backend. More...
 
#define SHARKSSL_ESP32P4_HW_SHA384   0
 Optional ESP32-P4 SHA-384 peripheral compression backend. More...
 
#define SHARKSSL_ESP32P4_HW_SHA512   0
 Optional ESP32-P4 SHA-512 peripheral compression backend. More...
 
#define SHARKSSL_ESP32P4_HW_GCM   0
 Optional ESP32-P4 AES-GCM peripheral backend for native SharkSSL GCM. More...
 
#define SHARKSSL_ESP32P4_HW_AES   0
 Optional ESP32-P4 AES peripheral for native block and CBC APIs. More...
 
#define SHARKSSL_ESP32P4_HW_P256   0
 Optional ESP32-P4 constant-time ECC peripheral for P-256 point multiplication. More...
 
#define SHARKSSL_ESP32S3_HW_SHA1   0
 ESP32-S3 hardware acceleration. More...
 
#define SHARKSSL_ESP32S3_HW_SHA256   0
 Optional ESP32-S3 SHA-256 peripheral compression backend. More...
 
#define SHARKSSL_ESP32S3_HW_SHA384   0
 Optional ESP32-S3 SHA-384 peripheral compression backend. More...
 
#define SHARKSSL_ESP32S3_HW_SHA512   0
 Optional ESP32-S3 SHA-512 peripheral compression backend. More...
 
#define SHARKSSL_ESP32S3_HW_AES_CBC   0
 Optional ESP32-S3 AES-128/256 CBC peripheral backend. More...
 
#define SHARKSSL_ESP32S3_HW_AES_ECB   0
 Optional ESP32-S3 AES-128/256 single-block ECB peripheral backend. More...
 
#define SHARKSSL_ESP32S3_HW_GCM   0
 Optional ESP32-S3 AES-128/256 GCM backend. More...
 
#define SHARKSSL_RX_TSIP_TLS   0
 Renesas RX72N TSIP TLS 1.3 server acceleration. More...
 
#define SHARKSSL_RX_TSIP_HYBRID_GCM   0
 Use TSIP AES-GCM for TLS 1.3 records after hybrid ML-KEM key exchange. More...
 
#define SHARKSSL_RNG_MULTITHREADED   1
 Use a TSIP-protected P-256 identity key for TLS CertificateVerify. More...
 
#define SHARKSSL_NOPACK   0
 Select 1 to keep every optional field of the public structures whatever the configuration, so that their layout does not depend on the selected options. More...
 
#define SHARKSSL_CHECK_DATE   0
 SharkSslCon_trusted also checks certificate expiration and returns SharkSslConTrust_CertCnDate if date(s) are within: timeFrom <= now and timeTo >= now This setting requires baGetUnixTime() returning the correct time. More...
 

Macro Definition Documentation

◆ SHARKSSL_AES_CIPHER_LOOP_UNROLL

#define SHARKSSL_AES_CIPHER_LOOP_UNROLL   1

Select 0 for smaller AES loops or 1 to unroll them.

Measure code size and execution time with the application's compiler and target.

◆ SHARKSSL_AES_CT_KEY_ASM

#define SHARKSSL_AES_CT_KEY_ASM   0

Run the AES-128/192/256 key expansion of the bitsliced AES in Thumb-2 on little-endian Cortex-M4/M7/M33/M85: compile crypto/Cortex-M_GCC/SharkSslAesCT_M4.S (GCC) or crypto/Cortex-M_IAR/SharkSslAesCT_M4.s (IAR) with the same options.

The context and the API are unchanged.

◆ SHARKSSL_AES_GCM_CT_M4_ASM

#define SHARKSSL_AES_GCM_CT_M4_ASM   0

Select the Cortex-M4/M7/M85 GHASH helper for software CT AES-GCM.

Compile crypto/Cortex-M_GCC/SharkSslAesGcmCT_M4.S (GCC) or crypto/Cortex-M_IAR/SharkSslAesGcmCT_M4.s (IAR) with the same options. This uses fixed-latency UMULL on the supported little-endian cores. Cortex-M3 is not supported. The public AES-GCM context is unchanged.

◆ SHARKSSL_AES_GCM_CT_MVE_ASM

#define SHARKSSL_AES_GCM_CT_MVE_ASM   0

Select the Cortex-M85 Helium (MVE) GHASH for software CT AES-GCM, instead of SHARKSSL_AES_GCM_CT_M4_ASM.

Compile crypto/Cortex-M_GCC/SharkSslAesGcmCT_MVE.S (GCC) or crypto/Cortex-M_IAR/SharkSslAesGcmCT_MVE.s (IAR) with the same options. The core must implement MVE and the platform must enable CP10/CP11 in CPACR before AES-GCM is used. The public AES-GCM context is unchanged.

◆ SHARKSSL_AES_GCM_CT_RX_EMULU

#define SHARKSSL_AES_GCM_CT_RX_EMULU   0

Use RXv3 EMULU for the software AES-GCM GHASH on little-endian Renesas RX.

GNU RX and IAR compile the helper from C. The RX72N has been measured for operand-independent EMULU latency; verify timing on each other RXv3 core. The public AES-GCM context is unchanged.

◆ SHARKSSL_BIGINT_EXP_SLIDING_WINDOW_K

#define SHARKSSL_BIGINT_EXP_SLIDING_WINDOW_K   4

Select a window size between 1 (slower, less RAM) and 5.

◆ SHARKSSL_BIGINT_MULT_LOOP_UNROLL

#define SHARKSSL_BIGINT_MULT_LOOP_UNROLL   1

Select 0 for smaller multiplication loops or 1 to unroll them.

Measure code size and execution time with the application's compiler and target.

◆ SHARKSSL_CHECK_DATE

#define SHARKSSL_CHECK_DATE   0

SharkSslCon_trusted also checks certificate expiration and returns SharkSslConTrust_CertCnDate if date(s) are within: timeFrom <= now and timeTo >= now This setting requires baGetUnixTime() returning the correct time.

◆ SHARKSSL_DHE_MIN_PRIME_BITS

#define SHARKSSL_DHE_MIN_PRIME_BITS   2048

Minimum size in bits of the DHE_RSA prime p sent by a server: the client aborts the handshake with an insufficient_security alert when p is shorter.

2048 follows NIST SP 800-131A; 1024 is the lowest value accepted, for legacy servers only (512- and 768-bit groups are broken).

◆ SHARKSSL_ECC_FIXED_BASE_COMB

#define SHARKSSL_ECC_FIXED_BASE_COMB   1

Enable Ed25519/Ed448 support (RFC 8032).

Certificate parsing is available; signature verification currently requires the PSA consumer. Native verification and TLS signature scheme integration are not implemented. Compute k*G, for G the base point of SECP256R1 and SECP384R1 (key generation, ECDSA signing), with a fixed-base comb and a table of 16 precomputed points per curve in flash, and 16 more with their doubles unless SHARKSSL_ECC_SMALL_FOOTPRINT is set. The comb and generic implementations retain the same timing resistance. Set this option to 0 to omit the tables and use generic multiplication. Measure flash use and execution time for the selected curves and target.

◆ SHARKSSL_ECC_MULT_FIXED_WINDOW

#define SHARKSSL_ECC_MULT_FIXED_WINDOW   4

Compute k*Q for any other point Q of SECP256R1, SECP384R1 and SECP521R1 (ECDH shared secret) with a fixed window of this many bits and the same timing resistance as generic multiplication.

The window holds 2^(bits - 1) precomputed points in RAM during multiplication. Increasing the window increases temporary RAM use. Set it to 0 to use generic multiplication. Measure flash use, peak RAM and execution time for the selected curves and target.

◆ SHARKSSL_ECC_P256_ASM

#define SHARKSSL_ECC_P256_ASM   0

Select 1 to use the assembly for the P-256 (secp256r1) field arithmetic: on Cortex-M4/M7/M33 with DSP/M85 SharkSslP256_M4.S for GCC or Keil, SharkSslP256_M4.s for IAR; on M0/M0+/M23 use SharkSslP256_M0 instead.

On RXv2/RXv3 use SharkSslP256_RX.S for GCC, SharkSslP256_RX.s for IAR; on AArch64 SharkSslP256_ARM64.S for GCC or .s for IAR; on RV32IM SharkSslP256_RISCV.S for GCC. On x64 link SharkSslP256_X64.S for GCC or SharkSslP256_X64.asm for MSVC: BMI2 is selected at run time, otherwise the constant-time C field arithmetic remains in use. Multiplication, addition and subtraction modulo the P-256 prime then run in assembly and in constant time; the other curves are not affected. Independent of SHARKSSL_OPTIMIZED_BIGINT_ASM.

◆ SHARKSSL_ECC_P256_ASM_COMPACT

#define SHARKSSL_ECC_P256_ASM_COMPACT   0

Cortex-M4/M7/M33 with DSP/M85, GCC and IAR, with SHARKSSL_ECC_P256_ASM: select 1 for the compact P-256 multiplication of SharkSslP256_M4 (the field functions then take about 0.9 KB instead of 1.5 KB), 0 for the unrolled one.

The compact code executes more cycles, but it stays in a small flash instruction cache (about 1 KB on STM32 parts with the ART accelerator), so it is the faster one where instruction fetch from flash is the limit, and the slower one with zero-wait-state flash, code in RAM or a larger cache. Measured with GCC, TLS 1.3 handshake with P-256: STM32L496 at 80 MHz 6% faster, Kinetis K64F at 21 MHz 8% slower. Both are constant time.

◆ SHARKSSL_ECC_P384_ASM

#define SHARKSSL_ECC_P384_ASM   0

Select 1 to use a native P-384 (secp384r1) field backend: on Cortex-M4/M7/M33 with DSP/M85 SharkSslP384_M4.S for GCC or Keil, SharkSslP384_M4.s for IAR; on M0/M0+/M23 use SharkSslP384_M0 instead.

On RXv2/RXv3 use SharkSslP384_RX.S for GCC, SharkSslP384_RX.s for IAR; on AArch64 SharkSslP384_ARM64.S for GCC or .s for IAR. On RV32IM compile SharkSslP384_RISCV.c (which uses inline M-extension multiplication). On x64 link SharkSslP384_X64.S for GCC or SharkSslP384_X64.asm for MSVC: BMI2 is selected at run time, otherwise the constant-time C field arithmetic remains in use. Multiplication, addition and subtraction modulo the P-384 prime then use the native backend with fixed control and address schedules; the other curves are not affected. Independent of SHARKSSL_ECC_P256_ASM and SHARKSSL_OPTIMIZED_BIGINT_ASM.

◆ SHARKSSL_ECC_P384_ASM_COMPACT

#define SHARKSSL_ECC_P384_ASM_COMPACT   0

Cortex-M4/M7/M33 with DSP/M85, GCC and IAR, with SHARKSSL_ECC_P384_ASM: select 1 to share one 4x4 multiply-accumulate block, 0 to inline all nine blocks.

Both variants are constant time. The compact variant reduces code size and uses eight extra stack bytes during the private helper call, with no extra heap. Flash/cache behavior determines the speed tradeoff. Independent of SHARKSSL_ECC_WINDOW_CACHE_DOUBLES.

◆ SHARKSSL_ECC_SMALL_FOOTPRINT

#define SHARKSSL_ECC_SMALL_FOOTPRINT   0

Select 1 for smaller and slower ECDSA signing and fixed-base comb code with the same timing resistance.

The comb then keeps only the 16 points per curve and doubles the accumulator inside each complete addition, and the inversion modulo the curve order uses the generic fixed-window exponentiation. With 0 (default) the comb also stores the doubled points and has its own field-call path, and the inversion scans the public exponent with a sliding window. Measure flash use and signing time for the selected implementation and target.

◆ SHARKSSL_ECC_USE_BRAINPOOLP256R1

#define SHARKSSL_ECC_USE_BRAINPOOLP256R1   1

Enable/disable the brainpoolP256r1 curve (RFC 5639)

◆ SHARKSSL_ECC_USE_BRAINPOOLP384R1

#define SHARKSSL_ECC_USE_BRAINPOOLP384R1   1

Enable/disable the brainpoolP384r1 curve (RFC 5639)

◆ SHARKSSL_ECC_USE_BRAINPOOLP512R1

#define SHARKSSL_ECC_USE_BRAINPOOLP512R1   1

Enable/disable the brainpoolP512r1 curve (RFC 5639)

◆ SHARKSSL_ECC_USE_CURVE25519

#define SHARKSSL_ECC_USE_CURVE25519   1

Enable/disable the Curve25519 curve (RFC 7748)

◆ SHARKSSL_ECC_USE_CURVE448

#define SHARKSSL_ECC_USE_CURVE448   0

Enable/disable the Curve448 curve (RFC 7748)

◆ SHARKSSL_ECC_USE_SECP256R1

#define SHARKSSL_ECC_USE_SECP256R1   1

Enable/disable the SECP256R1 curve.

◆ SHARKSSL_ECC_USE_SECP384R1

#define SHARKSSL_ECC_USE_SECP384R1   1

Enable/disable the SECP384R1 curve.

◆ SHARKSSL_ECC_USE_SECP521R1

#define SHARKSSL_ECC_USE_SECP521R1   1

Enable/disable the SECP521R1 curve.

◆ SHARKSSL_ECC_VERIFY_POINT

#define SHARKSSL_ECC_VERIFY_POINT   1

Select 1 to verify that a point lies on a curve; TLS 1.3 always enables this verification for peer key shares.

Verification requires more ROM for curve parameters and code, and slightly increases execution time.

◆ SHARKSSL_ECC_WINDOW_CACHE_DOUBLES

#define SHARKSSL_ECC_WINDOW_CACHE_DOUBLES   1

Cache doubled points in the optimized P-256/P-384 variable-base window with native field ASM on Cortex-M, AArch64, RX and x64, and P-256 on RV32IM.

With window 4, this uses 864/1296 extra temporary heap bytes respectively. Set to 0 to omit the doubled table and selected double; complete additions then double unconditionally and select with masks. Both settings retain timing resistance and the same ASM field kernels. This does not change fixed-base comb tables, ASM_COMPACT, or paths excluded by SMALL_FOOTPRINT. Measure execution time and peak RAM for the selected target and window size.

◆ SHARKSSL_ECDSA_ONLY_VERIFY

#define SHARKSSL_ECDSA_ONLY_VERIFY   0

Disable ECDSA sign API functions (sharkssl_ECDSA_sign, SharkSslECDSA_siglen) - effective only if ECDSA API is compiled (SHARKSSL_ENABLE_ECDSA_API must be enabled); used to achieve minimum code size in crypto-only builds.

Must be 0 when the TLS client or server code is enabled

◆ SHARKSSL_ENABLE_AES_CTR_MODE

#define SHARKSSL_ENABLE_AES_CTR_MODE   1

Select 1 to include AES CTR mode (USE_AES_xxx must be enabled)

◆ SHARKSSL_ENABLE_AES_GCM

#define SHARKSSL_ENABLE_AES_GCM   1

AES-GCM requires AES: the AES-GCM ciphersuites are included.

◆ SHARKSSL_ENABLE_ALPN_EXTENSION

#define SHARKSSL_ENABLE_ALPN_EXTENSION   1

Enable/disable ALPN API (support for ALPN extension, RFC 7301)

◆ SHARKSSL_ENABLE_CA_EXTENSION

#define SHARKSSL_ENABLE_CA_EXTENSION   1

Select 1 to enable support for Certificate Authorities extension (RFC 8446 section 4.2.4) Note: SHARKSSL_TLS_1_3 and SHARKSSL_ENABLE_CA_LIST must be enabled.

◆ SHARKSSL_ENABLE_CA_LIST

#define SHARKSSL_ENABLE_CA_LIST   1

Select 1 to enable CA check (client or server with client auth)

◆ SHARKSSL_ENABLE_CERT_CHAIN

#define SHARKSSL_ENABLE_CERT_CHAIN   1

Select 1 to enable certificate chain support.

◆ SHARKSSL_ENABLE_CERT_COMMON_NAMES

#define SHARKSSL_ENABLE_CERT_COMMON_NAMES   0

Enable a per-connection policy hook for presented peer certificates.

The default omits the hook pointer from SharkSslCon. Retain the encoded subject Name in peer certificate information so applications can inspect all common names and their ASN.1 string types.

◆ SHARKSSL_ENABLE_CERT_KEYUSAGE

#define SHARKSSL_ENABLE_CERT_KEYUSAGE   0

Select 1 to enable SharkSslCertInfo_parseCert for local DER certificates.

Requires RSA or ECDSA and certificate parsing for TLS, CSR signing, or tools. Automatic certificate cloning - always enabled Select 1 to expose parsed KeyUsage and ExtendedKeyUsage information; TLS 1.3 always parses KeyUsage to enforce certificate signing policy.

◆ SHARKSSL_ENABLE_CERT_SPKI

#define SHARKSSL_ENABLE_CERT_SPKI   0

Retain the original DER SubjectPublicKeyInfo in cloned peer leaf certificates for public-key pinning.

Set consistently in all consumers.

◆ SHARKSSL_ENABLE_CERTSTORE_API

#define SHARKSSL_ENABLE_CERTSTORE_API   1

Select 1 to enable certificate storage.

◆ SHARKSSL_ENABLE_CLIENT_AUTH

#define SHARKSSL_ENABLE_CLIENT_AUTH   1

Select 1 to enable client authentication from server.

◆ SHARKSSL_ENABLE_DHE_RSA

#define SHARKSSL_ENABLE_DHE_RSA   0

Enable legacy TLS 1.2 DHE_RSA ciphersuites.

RFC 10015 requires clients not to offer and servers not to select these ciphersuites. Keep disabled for RFC 10015 compliance.

◆ SHARKSSL_ENABLE_ECDHE_ECDSA

#define SHARKSSL_ENABLE_ECDHE_ECDSA   1

Select 1 to enable ECDHE_ECDSA ciphersuites (RFC 8422) Elliptic Curve Cryptography (SHARKSSL_USE_ECC) must be enabled SHARKSSL_ENABLE_ECDSA must be set.

◆ SHARKSSL_ENABLE_ECDHE_RSA

#define SHARKSSL_ENABLE_ECDHE_RSA   1

Select 1 to enable ECDHE_RSA ciphersuites (RFC 8422) Elliptic Curve Cryptography (SHARKSSL_USE_ECC) must be enabled RSA (SHARKSSL_ENABLE_RSA) must be enabled.

◆ SHARKSSL_ENABLE_ECDSA

#define SHARKSSL_ENABLE_ECDSA   1

Select 1 to enable generation and verification of elliptic curve digital signatures.

◆ SHARKSSL_ENABLE_ECDSA_API

#define SHARKSSL_ENABLE_ECDSA_API   1

Enable/disable RSASSA-PSS padding in RSA API (RFC 8017) (SHARKSSL_ENABLE_RSA_API must be enabled to use RSASSA-PSS through the RSA API)

RSASSA-PSS is automatically enabled for RSA CertificateVerify signatures when TLS 1.3 and RSA are enabled Enable/disable OAEP padding in RSA API (SHARKSSL_ENABLE_RSA_API must be enabled) Enable/disable ECDSA API (sharkssl_ECDSA_sign, sharkssl_ECDSA_verify, SharkSslECDSA_siglen)

◆ SHARKSSL_ENABLE_HELLO_RETRY_REQUEST

#define SHARKSSL_ENABLE_HELLO_RETRY_REQUEST   SHARKSSL_TLS_1_3

Compile TLS 1.3 HelloRetryRequest handling.

It is enabled by default when TLS 1.3 is enabled. Set this to 0 to omit the retry path on constrained targets; an unsupported HelloRetryRequest is rejected explicitly.

◆ SHARKSSL_ENABLE_INFO_API

#define SHARKSSL_ENABLE_INFO_API   1

Enable/disable support for encrypted PKCS#8 certificates in sharkssl_PEM function (requires SHARKSSL_ENABLE_AES_CBC and SHARKSSL_USE_SHA_256)

Enable/disable SharkSslCon_getCiphersuite, SharkSslCon_getProtocol and SharkSslCon_isResumed. Also enables SharkSslCon_getNegotiatedGroup to report the negotiated TLS 1.3 group and SharkSslCon_wasHelloRetryRequest to report whether the handshake used HelloRetryRequest.

◆ SHARKSSL_ENABLE_KEY_UPDATE

#define SHARKSSL_ENABLE_KEY_UPDATE   SHARKSSL_TLS_1_3

Select 1 to enable TLS 1.3 KeyUpdate support (RFC 9846 section 4.7.3; RFC 8446 section 4.6.3).

Note: with the default define below, it is enabled whenever TLS 1.3 is. Disabling this option reduces the per-connection RAM and code footprint, but receiving a TLS 1.3 peer KeyUpdate then closes the connection with a fatal unexpected_message alert. The resulting constrained profile is not fully TLS 1.3 conformant.

◆ SHARKSSL_ENABLE_PEM_API

#define SHARKSSL_ENABLE_PEM_API   1

Select 1 to enable PEM certs/keys decoding If RSA_API is enabled, then also the functions sharkssl_PEM_to_RSAKey and SharkSslRSAKey_free are available If ECDSA_API is enabled, then also the functions sharkssl_PEM_to_ECCKey and SharkSslECCKey_free are available.

◆ SHARKSSL_ENABLE_RSA

#define SHARKSSL_ENABLE_RSA   1

Select 0 to disable RSA: the RSA ciphersuites in TLS 1.2 and RSA certificates and signatures in TLS 1.2 and TLS 1.3.

◆ SHARKSSL_ENABLE_RSA_API

#define SHARKSSL_ENABLE_RSA_API   1

Enable/disable RSA API (sharkssl_RSA_public_encrypt, sharkssl_RSA_private_decrypt, sharkssl_RSA_private_encrypt, sharkssl_RSA_public_decrypt, SharkSslRSAKey_size)

◆ SHARKSSL_ENABLE_RSA_PKCS1

#define SHARKSSL_ENABLE_RSA_PKCS1   1

Enable the native RSA key generator.

PSA library builds enable this option. Enable/disable PKCS1 padding in RSA API (SHARKSSL_ENABLE_RSA_API must be enabled to use PKCS1 through the RSA API) Also used by TLS for RSA certificate signatures, TLS 1.2 RSA signatures and the TLS 1.3 signature_algorithms_cert extension

◆ SHARKSSL_ENABLE_SECURE_RENEGOTIATION

#define SHARKSSL_ENABLE_SECURE_RENEGOTIATION   SHARKSSL_TLS_1_2

Select 1 to enable renegotiation Only secure renegotiation (RFC 5746) is supported Note: with the default define below, it is enabled whenever TLS 1.2 is NOTE: IMPLEMENTED ONLY ON THE SERVER SIDE.

◆ SHARKSSL_ENABLE_SELECT_CIPHERSUITE

#define SHARKSSL_ENABLE_SELECT_CIPHERSUITE   1

Enable/disable the SharkSslCon_selectCiphersuite API.

◆ SHARKSSL_ENABLE_SESSION_CACHE

#define SHARKSSL_ENABLE_SESSION_CACHE   1

Select 1 to enable session caching.

◆ SHARKSSL_ENABLE_SNI

#define SHARKSSL_ENABLE_SNI   1

Select 1 to enable support for Server Name Indication.

◆ SHARKSSL_ENABLE_X25519_API

#define SHARKSSL_ENABLE_X25519_API   1

Enable/disable the X25519 public API (sharkssl_X25519_createKeyPair, sharkssl_X25519_sharedSecret)

◆ SHARKSSL_ESP32P4_HW_AES

#define SHARKSSL_ESP32P4_HW_AES   0

Optional ESP32-P4 AES peripheral for native block and CBC APIs.

Link src/crypto/ESP32P4_GCC/SharkSslAes_ESP32P4.c with ESP-IDF 6.1 and enable CONFIG_MBEDTLS_HARDWARE_AES. AES-192 keeps the software path.

◆ SHARKSSL_ESP32P4_HW_GCM

#define SHARKSSL_ESP32P4_HW_GCM   0

Optional ESP32-P4 AES-GCM peripheral backend for native SharkSSL GCM.

Link src/crypto/ESP32P4_GCC/SharkSslGcm_ESP32P4.c with ESP-IDF 6.1 and enable CONFIG_MBEDTLS_HARDWARE_GCM. The backend uses full hardware GCM for DMA-capable messages of at least 256 bytes and keeps the native constant-time software implementation for other messages. Build without CONFIG_APP_BUILD_TYPE_PURE_RAM_APP, which forbids DMA allocations on P4.

◆ SHARKSSL_ESP32P4_HW_P256

#define SHARKSSL_ESP32P4_HW_P256   0

Optional ESP32-P4 constant-time ECC peripheral for P-256 point multiplication.

Link src/crypto/ESP32P4_GCC/SharkSslECC_ESP32P4.c with ESP-IDF 6.1 and enable CONFIG_MBEDTLS_HARDWARE_ECC. Other curves retain the native SharkSSL implementation.

◆ SHARKSSL_ESP32P4_HW_SHA1

#define SHARKSSL_ESP32P4_HW_SHA1   0

ESP32-P4 hardware acceleration.

Optional ESP32-P4 SHA-1 peripheral compression backend. Link src/crypto/ESP32P4_GCC/SharkSslSha1_ESP32P4.c with ESP-IDF 6.1 and enable CONFIG_MBEDTLS_HARDWARE_SHA. Native SHA-1 must be enabled too.

◆ SHARKSSL_ESP32P4_HW_SHA256

#define SHARKSSL_ESP32P4_HW_SHA256   0

Optional ESP32-P4 SHA-256 peripheral compression backend.

Link src/crypto/ESP32P4_GCC/SharkSslSha256_ESP32P4.c with ESP-IDF 6.1 and enable CONFIG_MBEDTLS_HARDWARE_SHA. The public SharkSSL hash context, cloning, padding and HMAC behavior remain unchanged.

◆ SHARKSSL_ESP32P4_HW_SHA384

#define SHARKSSL_ESP32P4_HW_SHA384   0

Optional ESP32-P4 SHA-384 peripheral compression backend.

Link src/crypto/ESP32P4_GCC/SharkSslSha384_ESP32P4.c with ESP-IDF 6.1 and enable CONFIG_MBEDTLS_HARDWARE_SHA. SHA-512 has a separate selector.

◆ SHARKSSL_ESP32P4_HW_SHA512

#define SHARKSSL_ESP32P4_HW_SHA512   0

Optional ESP32-P4 SHA-512 peripheral compression backend.

Link src/crypto/ESP32P4_GCC/SharkSslSha512_ESP32P4.c with ESP-IDF 6.1 and enable CONFIG_MBEDTLS_HARDWARE_SHA. The native context stays copyable.

◆ SHARKSSL_ESP32S3_HW_AES_CBC

#define SHARKSSL_ESP32S3_HW_AES_CBC   0

Optional ESP32-S3 AES-128/256 CBC peripheral backend.

Link src/crypto/ESP32S3_GCC/SharkSslAes_ESP32S3.c with ESP-IDF 6.1 and enable CONFIG_MBEDTLS_HARDWARE_AES. Other native AES modes retain the bitsliced implementation.

◆ SHARKSSL_ESP32S3_HW_AES_ECB

#define SHARKSSL_ESP32S3_HW_AES_ECB   0

Optional ESP32-S3 AES-128/256 single-block ECB peripheral backend.

Link src/crypto/ESP32S3_GCC/SharkSslAes_ESP32S3.c with ESP-IDF 6.1 and enable CONFIG_MBEDTLS_HARDWARE_AES.

◆ SHARKSSL_ESP32S3_HW_GCM

#define SHARKSSL_ESP32S3_HW_GCM   0

Optional ESP32-S3 AES-128/256 GCM backend.

AES-CTR uses the peripheral; GHASH remains the fixed-access SharkSSL implementation. Link the S3 AES adapter with ESP-IDF 6.1 and enable CONFIG_MBEDTLS_HARDWARE_AES.

◆ SHARKSSL_ESP32S3_HW_SHA1

#define SHARKSSL_ESP32S3_HW_SHA1   0

ESP32-S3 hardware acceleration.

Optional ESP32-S3 SHA-1 peripheral compression backend. Link src/crypto/ESP32S3_GCC/SharkSslSha1_ESP32S3.c with ESP-IDF 6.1 and enable CONFIG_MBEDTLS_HARDWARE_SHA. Native SHA-1 must be enabled too.

◆ SHARKSSL_ESP32S3_HW_SHA256

#define SHARKSSL_ESP32S3_HW_SHA256   0

Optional ESP32-S3 SHA-256 peripheral compression backend.

Link src/crypto/ESP32S3_GCC/SharkSslSha256_ESP32S3.c with ESP-IDF 6.1 and enable CONFIG_MBEDTLS_HARDWARE_SHA. Native SHA-256 only.

◆ SHARKSSL_ESP32S3_HW_SHA384

#define SHARKSSL_ESP32S3_HW_SHA384   0

Optional ESP32-S3 SHA-384 peripheral compression backend.

Link src/crypto/ESP32S3_GCC/SharkSslSha384_ESP32S3.c with ESP-IDF 6.1 and enable CONFIG_MBEDTLS_HARDWARE_SHA. Native SHA-384 only.

◆ SHARKSSL_ESP32S3_HW_SHA512

#define SHARKSSL_ESP32S3_HW_SHA512   0

Optional ESP32-S3 SHA-512 peripheral compression backend.

Link src/crypto/ESP32S3_GCC/SharkSslSha512_ESP32S3.c with ESP-IDF 6.1 and enable CONFIG_MBEDTLS_HARDWARE_SHA. Native SHA-512 only.

◆ SHARKSSL_KECCAK_FAST_C

#define SHARKSSL_KECCAK_FAST_C   0

Select the portable, two-bank C permutation for native PQC.

It uses 32-bit lane halves, compile-time rho/pi positions and 480 bytes of array scratch. GCC, Clang, IAR and MSVC can compile it directly. Leave at 0 for the smaller scalar permutation. In C-only ML-KEM-1024 benchmarks (GCC -O3), setting this to 1 cost about 4% more cycles on Cortex-M4 and saved 8-9% on Cortex-M7. Peak decapsulation stack grew from 648 to 1092 bytes on M4 and from 660 to 1092 bytes on M7. Use 0 with SHARKSSL_OPTIMIZED_KECCAK_ASM.

◆ SHARKSSL_MAX_HANDSHAKE_LENGTH

#define SHARKSSL_MAX_HANDSHAKE_LENGTH   0x00004000UL

Select 1 to enable support for Post Handshake Authentication (RFC 8446 sections 4.2.6 and 4.6.2)

Note: #SHARKSSL_TLS_1_3 and #SHARKSSL_ENABLE_CLIENT_AUTH must be enabled

EXPERIMENTAL! Application encrypted data returned by SharkSslCon_encrypt() must be sent before calling SharkSslCon_decrypt() again. Maximum accepted body length of one incoming TLS handshake message. The 16-KiB default preserves the embedded memory profile. Host builds may select, for example, 0x00040000UL (256 KiB); 0x00FFFFFFUL enables the full uint24 range defined by RFC 9846 section 4. Values above the default widen three internal buffer counters from U16 to U32. Input-buffer expansion must also be enabled for those values.

◆ SHARKSSL_MD5_SMALL_FOOTPRINT

#define SHARKSSL_MD5_SMALL_FOOTPRINT   0

Select 1 for smaller, but slower MD5.

◆ SHARKSSL_MLKEM_M4_ASM

#define SHARKSSL_MLKEM_M4_ASM   0

Select the native Thumb-2 polynomial and Keccak kernels for ML-KEM on little-endian Cortex-M4/M7 or Cortex-M33 with DSP.

Link the M4 sources for the chosen assembler (GNU .S or IAR .s).

◆ SHARKSSL_NOPACK

#define SHARKSSL_NOPACK   0

Select 1 to keep every optional field of the public structures whatever the configuration, so that their layout does not depend on the selected options.

◆ SHARKSSL_OPTIMIZED_AES_ASM

#define SHARKSSL_OPTIMIZED_AES_ASM   0

Enabling the assembler AES block cipher requires SharkSslAes_XX.s: AES-NI on x86/x64, AES-CE on ARM64 (with SharkSslCrypto_ARM64.c).

It serves SharkSslAesCtx: the block API, CBC, CTR and CCM. A processor without the AES instructions uses the constant-time bitsliced AES at run time. AES-GCM keeps its own selection, SHARKSSL_OPTIMIZED_GCM_ASM.

◆ SHARKSSL_OPTIMIZED_BIGINT_ASM

#define SHARKSSL_OPTIMIZED_BIGINT_ASM   0

Select the full BigInt assembly backend: add, subtract, right shift, multiplication and Montgomery reduction.

Link the matching port file. On x64 use SharkSslBigInt_X64.S (GCC ELF LP64) or SharkSslBigInt_X64.asm (MSVC x64), with baseline integer instructions and constant-time public-length loops. Zero retains the C backend. See Constant-time cryptography and assembly acceleration for timing properties and the target map.

◆ SHARKSSL_OPTIMIZED_BIGINT_WORD_ASM

#define SHARKSSL_OPTIMIZED_BIGINT_WORD_ASM   0

Select an assembly backend for BigInt add, subtract and right shift only.

Multiplication and Montgomery product remain in SharkSslBigInt.c. The MIPS32 big-endian GCC backend uses this option; it is independent of the all-BigInt assembler option above and must not be combined with it.

◆ SHARKSSL_OPTIMIZED_CHACHA_ASM

#define SHARKSSL_OPTIMIZED_CHACHA_ASM   0

Enabling assembler optimized CHACHA requires SharkSslCrypto_XX.s.

◆ SHARKSSL_OPTIMIZED_GCM_ASM

#define SHARKSSL_OPTIMIZED_GCM_ASM   0

Enabling the combined assembler AES-GCM block kernel requires SharkSslCrypto_XX.s.

Constant-time x86/x64 (AES-NI, PCLMULQDQ) and ARM64 (AES-CE, PMULL, ASIMD) assembler only, together with SHARKSSL_OPTIMIZED_GHASH_ASM. An x86/x64 processor without AES-NI and PCLMULQDQ uses the constant-time software AES-GCM at run time.

◆ SHARKSSL_OPTIMIZED_GCM_VAES_ASM

#define SHARKSSL_OPTIMIZED_GCM_VAES_ASM   0

Enabling the VAES/VPCLMULQDQ AES-GCM backend requires the VAES assembly file and its CPUID probe in addition to the AES-NI kernel.

Use SharkSslCrypto_X64_VAES.S for GCC ELF x64 or SharkSslCrypto_X64_VAES.asm for Microsoft x64, together with the matching port's SharkSslCrypto_X64_VAES_CPUID.c. Keep the probe on the baseline ISA; CPU and OS support are checked at run time. See SharkSSL 64-bit x86 cryptography (GCC) and SharkSSL 64-bit x86 cryptography (MSVC) for build requirements.

◆ SHARKSSL_OPTIMIZED_GHASH_ASM

#define SHARKSSL_OPTIMIZED_GHASH_ASM   0

Enabling assembler optimized GHASH requires SharkSslCrypto_XX.s.

Constant-time x86/x64 and ARM64 assembler only, and only together with SHARKSSL_OPTIMIZED_GCM_ASM.

◆ SHARKSSL_OPTIMIZED_KECCAK_ASM

#define SHARKSSL_OPTIMIZED_KECCAK_ASM   SHARKSSL_MLKEM_M4_ASM

Use native Keccak-f[1600] for SHA-3 and SHAKE in ML-KEM and ML-DSA.

Link the SharkSslKeccak assembly file for the target CPU and assembler. The x64 kernel uses baseline integer instructions and SSE2. Assemble the MSVC file with src/crypto on the include path. On ARM64, compile for +sha3 to use the SHA3 instructions, or select NEON alone. For IAR targets with SHA3, define SHARKSSL_ARM64_SHA3=1 in the assembler. SHARKSSL_MLKEM_M4_ASM selects both Keccak and polynomial arithmetic.

◆ SHARKSSL_OPTIMIZED_MLKEM_ASM

#define SHARKSSL_OPTIMIZED_MLKEM_ASM   SHARKSSL_MLKEM_M4_ASM

Select 1 to use the available assembly kernels for ML-KEM-768 and ML-KEM-1024.

Other operations use C. Link the SharkSslMLKEM assembly file for the target CPU and assembler. Use MVE on Cortex-M85 with Helium enabled, or M4 on Cortex-M33 with DSP. The ARM64 entry selects NEON from the target flags. On ESP32-P4, the RISC-V entry uses PIE with xespv2p1. The runtime must enable and preserve the PIE state.

◆ SHARKSSL_OPTIMIZED_POLY1305_ASM

#define SHARKSSL_OPTIMIZED_POLY1305_ASM   0

Enabling assembler optimized POLY requires SharkSslCrypto_XX.s.

◆ SHARKSSL_OPTIMIZED_SHA256_ASM

#define SHARKSSL_OPTIMIZED_SHA256_ASM   0

Enabling assembler SHA-256 requires the target backend.

On x86/x64, link SharkSslSha256_X86 or SharkSslSha256_X64: SHA-NI is selected at run time when SHA, SSSE3 and SSE2 are available, with the constant-time C compressor retained as fallback. Cortex-M and RX use SharkSslCrypto_XX.s. PSA consumers use their provider instead of these native compressors.

◆ SHARKSSL_OPTIMIZED_SHA384_ASM

#define SHARKSSL_OPTIMIZED_SHA384_ASM   0

Enabling assembler SHA-384 and SHA-512 requires the target backend.

On x64, link SharkSslSha512_X64: BMI2 is selected at run time with the constant-time C compressor retained as fallback. Other targets keep their existing backend. PSA consumers use their provider.

◆ SHARKSSL_PQC_DEFER_INITIAL_SHARE

#define SHARKSSL_PQC_DEFER_INITIAL_SHARE   0

With PQC and HelloRetryRequest enabled, send an empty initial key_share.

This saves client key generation until the server requests a group, at the cost of one extra round trip. Zero sends the hybrid share in ClientHello1.

◆ SHARKSSL_PSA_DYNAMIC_KEY_SLOTS

#define SHARKSSL_PSA_DYNAMIC_KEY_SLOTS   0

Select 1 to allocate SharkSSL PSA provider key slots on demand.

The static mode remains the default for deterministic embedded memory use.

◆ SHARKSSL_PSA_KEY_SLOTS

#define SHARKSSL_PSA_KEY_SLOTS   12

Number of volatile key slots in the SharkSSL PSA provider.

In the default static mode, all slots reserve memory even when unused; in dynamic mode, this value limits the number of allocated slots. Twelve covers one TLS 1.3 RSA/X25519 handshake with session caching and PSA secret handles, including a subsequent KeyUpdate. Increase it for concurrent handshakes or other keys kept alive by the application. This does not configure an external PSA provider used by SHARKSSL_PSA_CONSUMER.

◆ SHARKSSL_RANDOMIZE_EXTENSIONS

#define SHARKSSL_RANDOMIZE_EXTENSIONS   1

Select 1 to randomize the order of extensions in ClientHello.

◆ SHARKSSL_RFC_9846_CONFORMANCE_PROFILE

#define SHARKSSL_RFC_9846_CONFORMANCE_PROFILE   0

Select 1 to enforce the compile-time feature set required by the general RFC 9846 profile.

This verifies configuration prerequisites only; it is not a certification statement and does not replace protocol conformance tests.

◆ SHARKSSL_RNG_MULTITHREADED

#define SHARKSSL_RNG_MULTITHREADED   1

Use a TSIP-protected P-256 identity key for TLS CertificateVerify.

Setting this macro to 1 enables native sharkssl_rng use in a multithreaded environment. Initialize the native RNG with at least 48 unpredictable bytes through sharkssl_entropyEx before starting worker threads.

◆ SHARKSSL_RX_TSIP_HYBRID_GCM

#define SHARKSSL_RX_TSIP_HYBRID_GCM   0

Use TSIP AES-GCM for TLS 1.3 records after hybrid ML-KEM key exchange.

The software key schedule imports each traffic key through AES key wrap. Enable TSIP_AES_128_KEY_WRAP and TSIP_AES_128_ECB_ENCRYPT in FIT. Enable both FIT AES-256-GCM directions to also accelerate 256-bit keys.

◆ SHARKSSL_RX_TSIP_TLS

#define SHARKSSL_RX_TSIP_TLS   0

Renesas RX72N TSIP TLS 1.3 server acceleration.

Link SharkSslTls_TSIP.c with the RX TSIP FIT driver. The application opens TSIP before use and serializes all users of the peripheral over complete operations. Uses protected session keys for P-256 / TLS_AES_128_GCM_SHA256 when the server cache size is zero and post-handshake authentication is inactive.

◆ SHARKSSL_SELECT_CIPHERSUITE_LIST_DEPTH

#define SHARKSSL_SELECT_CIPHERSUITE_LIST_DEPTH   8

Determine the number of ciphersuites that can be selected, in decreasing order of preference; this value is only in effect if the SHARKSSL_ENABLE_SELECT_CIPHERSUITE is selected.

◆ SHARKSSL_SHA1_SMALL_FOOTPRINT

#define SHARKSSL_SHA1_SMALL_FOOTPRINT   0

Select 1 for smaller, but slower SHA1.

◆ SHARKSSL_SHA256_SMALL_FOOTPRINT

#define SHARKSSL_SHA256_SMALL_FOOTPRINT   0

Select 1 for smaller, but slower SHA256.

◆ SHARKSSL_SSL_CLIENT_CODE

#define SHARKSSL_SSL_CLIENT_CODE   1

Select 1 to enable CLIENT side TLS.

◆ SHARKSSL_SSL_SERVER_CODE

#define SHARKSSL_SSL_SERVER_CODE   1

Select 1 to enable SERVER side TLS.

◆ SHARKSSL_TLS_1_2

#define SHARKSSL_TLS_1_2   1

TLS 1.2 stack Disable by setting SHARKSSL_TLS_1_2=0.

◆ SHARKSSL_TLS_1_3

#define SHARKSSL_TLS_1_3   1

TLS 1.3 stack Disable by setting SHARKSSL_TLS_1_3=0.

◆ SHARKSSL_TLS_1_3_AES_GCM_KEY_UPDATE_THRESHOLD

#define SHARKSSL_TLS_1_3_AES_GCM_KEY_UPDATE_THRESHOLD   0x00800000UL

Number of TLS 1.3 records that may be encrypted with one AES-GCM key before SharkSSL proactively sends a KeyUpdate.

Every record is counted as a full-size record, which is conservative for smaller records. The value may be reduced, but must not exceed the default 2^23-record threshold; this leaves ample room below the RFC 9846 section 5.5 usage limit for a pending split write and the KeyUpdate record itself. This value is effective only when SHARKSSL_ENABLE_KEY_UPDATE is 1.

◆ SHARKSSL_TLS_1_3_INITIAL_BRAINPOOL_GROUP

#define SHARKSSL_TLS_1_3_INITIAL_BRAINPOOL_GROUP   0

Select one RFC 8734 Brainpool group as the initial TLS 1.3 key share Set to TLS_NAMEDGROUP_BRAINPOOLP256R1TLS13, P384R1TLS13, or P512R1TLS13 Zero retains the usual initial key shares.

◆ SHARKSSL_TLS_1_3_INITIAL_KEY_SHARE_X25519_ONLY

#define SHARKSSL_TLS_1_3_INITIAL_KEY_SHARE_X25519_ONLY   0

Select 1 to send only an X25519 key share in the initial TLS 1.3 ClientHello.

This setting is effective only when HelloRetryRequest and X25519 are enabled; otherwise the client sends every available TLS 1.3 key share as before. The PSA consumer sends one P-256 share when X25519 is disabled.

◆ SHARKSSL_UNALIGNED_ACCESS

#define SHARKSSL_UNALIGNED_ACCESS   0

Select 1 if your architecture supports unaligned memory access (x86, ARM-Cortex-M3, ColdFire)

◆ SHARKSSL_USE_AES_128

#define SHARKSSL_USE_AES_128   1

Enable/disable AES 128.

◆ SHARKSSL_USE_AES_192

#define SHARKSSL_USE_AES_192   0

AES-192 is not used in SSL/TLS enable only if needed in application using the crypto API.

◆ SHARKSSL_USE_AES_256

#define SHARKSSL_USE_AES_256   1

Enable/disable AES 256.

◆ SHARKSSL_USE_CHACHA20

#define SHARKSSL_USE_CHACHA20   1

AES-CCM requires AES: only for crypto functions - CCM TLS ciphersuites removed.

AES-CBC requires AES: CBC TLS ciphersuites removed for crypto functions and PEM certificate decryption Enable/disable CHACHA20 support. When POLY1305 is also enabled (SHARKSSL_USE_POLY1305), the CHACHA20-POLY1305 ciphersuites are included: TLS_CHACHA20_POLY1305_SHA256 for TLS 1.3 and the ECDHE_ECDSA, ECDHE_RSA and DHE_RSA variants for TLS 1.2

◆ SHARKSSL_USE_ECC

#define SHARKSSL_USE_ECC   1

Elliptic Curve Cryptography.

◆ SHARKSSL_USE_MLKEM

#define SHARKSSL_USE_MLKEM   SHARKSSL_ENABLE_PQC

Enable TLS 1.3 hybrid key agreement using ML-KEM-768 with X25519 or secp256r1, and ML-KEM-1024 with secp384r1 when that curve is enabled.

By default the client sends one hybrid share, preferring X25519MLKEM768 when available. Without HelloRetryRequest it also sends an independent X25519 share when the connection policy permits X25519. See Post-quantum cryptography for supported groups, policy selection and setup. Also enable the standalone MLKEM768 and MLKEM1024 TLS 1.3 Named Groups. Their shares contain only the ML-KEM public key or ciphertext. Keep these groups opt-in so enabling PQC preserves the hybrid-first group list. Enable standalone SHAKE128 and SHAKE256. Enable native ML-DSA-65 signature verification. See sharkssl_mldsa65_verify and Post-quantum cryptography. This does not enable ML-DSA signing or TLS certificate authentication. Enable native ML-KEM primitives. Consumer builds use the common ML-KEM sizes from the header and perform the operations through PSA instead.

◆ SHARKSSL_USE_SHA_256

#define SHARKSSL_USE_SHA_256   1

TLS 1.2/1.3 require SHA-256, do not modify the following settings.

◆ SHARKSSL_X25519_DEDICATED

#define SHARKSSL_X25519_DEDICATED   1

Select 1 to use dedicated Curve25519 field arithmetic (SharkSslBigInt.c) modulo p = 2^255 - 19, with a fixed inversion chain.

If SHARKSSL_X25519_ASM is also enabled, the dedicated whole-ASM backend is used instead. Select 0 for the generic BigInt ladder, which may use optional BigInt assembly kernels. This will reduce code size in flash at the cost of slower X25519 operations. This option has no effect unless Curve25519 (SHARKSSL_ECC_USE_CURVE25519) is enabled.