QSC Post Quantum Cryptographic Library 1.2.0.0 (B1)
A post quantum secure library written in Ansi C
Loading...
Searching...
No Matches
qsccommon.h File Reference

Contains common definitions for the Quantum Secure Cryptographic (QSC) library. More...

#include <assert.h>
#include <errno.h>
#include <limits.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Macros

#define QSC_CPLUSPLUS_ENABLED_START
#define QSC_CPLUSPLUS_ENABLED_END
#define QSC_ASSERT(expr)
#define QSC_PRAGMA_STR(x)
 The stringify function.
#define QSC_NO_INLINE
 Tells the compiler not to inline a function.
#define QSC_SYSTEM_SOCKETS_BERKELEY
 Defined when using Berkeley sockets.
#define QSC_ATTRIBUTE(a)
#define QSC_EXPORT_API
 API export macro for Microsoft compilers when importing from a DLL.
#define QSC_SYSTEM_IS_X86
 Defined when the target system is 32-bit.
#define QSC_SIZE_MAX   UINT32_MAX
 The maximum integer size for a 32-bit system.
#define QSC_SYSTEM_IS_LITTLE_ENDIAN
 Defined if the system is little endian.
#define QSC_SYSTEM_MAX_NAME   260ULL
 The maximum system name length supported by the system.
#define QSC_SYSTEM_MAX_PATH   260ULL
 The maximum path length supported by the system.
#define QSC_SYSTEM_SECMEMALLOC_DEFAULT   4096ULL
 Default secure memory buffer allocation size (in bytes).
#define QSC_SYSTEM_SECMEMALLOC_MIN   16ULL
 Minimum secure memory allocation size (in bytes).
#define QSC_SYSTEM_SECMEMALLOC_MAX   131072ULL
 Maximum secure memory allocation size (in bytes).
#define QSC_SYSTEM_SECMEMALLOC_MAXKB   512ULL
 Maximum secure memory allocation in kilobytes.
#define QSC_SYSTEM_OPTIMIZE_IGNORE
 Compiler hint to disable optimization in MSVC.
#define QSC_SYSTEM_OPTIMIZE_RESUME
 Compiler hint to resume optimization in MSVC.
#define QSC_SYSTEM_CONDITION_IGNORE(x)
 A macro to disable a specific warning condition.
#define QSC_SYSTEM_CONDITION_RESUME(x)
 A macro to re-enable a specific warning condition.
#define QSC_ALIGN(x)
 Macro for aligning data to 'x' bytes using GCC/Clang.
#define QSC_SIMD_ALIGNMENT   8
 Alignment value for enabled intrinsic.
#define QSC_SIMD_ALIGN
 Macro to align data on supported intrinsics size.
#define QSC_STATUS_SUCCESS   0LL
 Function return value indicating successful operation.
#define QSC_STATUS_FAILURE   -1LL
 Function return value indicating failed operation.
#define QSC_TLS_SECURITY_CLASS_1
 Selects the QSC TLS Security Class 1 build profile.
#define QSC_EDDH_S1EC25519
 Enable the EDDH S1EC25519 parameter set.
#define QSC_KYBER_S3K3P768
 Enable the Kyber S3K3P768 parameter set.
#define QSC_DILITHIUM_S3P65
 Enable the Dilithium S3P65 parameter set.
#define QSC_ECDSA_S1P256
 Enable the ECDSA S1EC256 (NIST P-256) parameter set.
#define QSC_EDDSA_S1EC25519
 Enable the EDDSA S1EC25519 parameter set.
#define QSC_ECDH_S1P256
 Enable the ECDH S1P256 parameter set (NIST P-256 / secp256r1).
#define QSC_HQC_S1N2321
 Enable the HQC S1N17669 parameter set.
#define QSC_MCELIECE_S1N3488T64
 Enable the McEliece S1-N3488T64 parameter set.
#define QSC_FALCON_S3SHAKE256F512
 Enable the Falcon S3SHAKE256F512 parameter set.
#define QSC_SPHINCSPLUS_S1S128SHAKERS
 Enable the SphincsPlus S1S128SHAKERS robust small parameter set.

Typedefs

typedef int32_t errno_t

Detailed Description

Contains common definitions for the Quantum Secure Cryptographic (QSC) library.

This file provides common macros, type definitions, compiler/OS/architecture detection, API export macros, alignment macros, secure memory allocation definitions, and other utility macros. These definitions are used throughout the QSC library to ensure portability and performance.

Macro Definition Documentation

◆ QSC_ASSERT

#define QSC_ASSERT ( expr)
Value:
((void)0)

◆ QSC_PRAGMA_STR

#define QSC_PRAGMA_STR ( x)
Value:
_Pragma(#x)

The stringify function.

◆ QSC_TLS_SECURITY_CLASS_1

#define QSC_TLS_SECURITY_CLASS_1

Selects the QSC TLS Security Class 1 build profile.

This profile enables the lowest predefined TLS-oriented parameter-set bundle in QSC. When this macro is defined, the header enables the following primitive parameter sets:

  • QSC_ECDH_S1P256
  • QSC_EDDH_S1EC25519
  • QSC_KYBER_S1K2P512
  • QSC_DILITHIUM_S1P44
  • QSC_ECDSA_S1P256
  • QSC_EDDSA_S1EC25519

This profile is intended for compact builds that expose the 128-bit-class parameter selections associated with X25519, Ed25519, NIST P-256, ML-KEM-512, and ML-DSA-44.

Only one QSC_TLS_SECURITY_CLASS_X macro should be defined in a build.