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

CPU Jitter Entropy Provider. More...

#include "qsccommon.h"

Go to the source code of this file.

Macros

#define QSC_CJP_SEED_MAX   1024000U
 The maximum number of bytes that can be generated in one provider call.

Functions

QSC_EXPORT_API bool qsc_cjp_available (void)
 Test whether the platform exposes a usable high-resolution timer.
QSC_EXPORT_API bool qsc_cjp_generate (uint8_t *output, size_t length)
 Generate an array of random bytes using the CPU jitter entropy provider.
QSC_EXPORT_API uint16_t qsc_cjp_uint16 (void)
 Generate a random 16-bit unsigned integer using the CPU jitter entropy provider.
QSC_EXPORT_API uint32_t qsc_cjp_uint32 (void)
 Generate a random 32-bit unsigned integer using the CPU jitter entropy provider.
QSC_EXPORT_API uint64_t qsc_cjp_uint64 (void)
 Generate a random 64-bit unsigned integer using the CPU jitter entropy provider.

Detailed Description

CPU Jitter Entropy Provider.

The CPU Jitter Provider collects timing variance produced by CPU execution, memory/cache disturbance, and the active high-resolution platform timer. The provider follows the QSC entropy-provider interface used by CSP, RDP, and ACP.

The raw timing samples are subjected to online health checks and are never returned directly. Accepted samples and auxiliary provider material are concentrated through SHAKE-512 before output is produced.

Function Documentation

◆ qsc_cjp_available()

QSC_EXPORT_API bool qsc_cjp_available ( void )

Test whether the platform exposes a usable high-resolution timer.

Returns
[bool] Returns true when the CJP timing source passes the timer test.

◆ qsc_cjp_generate()

QSC_EXPORT_API bool qsc_cjp_generate ( uint8_t * output,
size_t length )

Generate an array of random bytes using the CPU jitter entropy provider.

Parameters
output[uint8_t*] Pointer to the output byte array.
length[size_t] The number of bytes to generate.
Returns
[bool] Returns true if the entropy generation was successful; false otherwise.

◆ qsc_cjp_uint16()

QSC_EXPORT_API uint16_t qsc_cjp_uint16 ( void )

Generate a random 16-bit unsigned integer using the CPU jitter entropy provider.

Returns
[uint16_t] Returns a random 16-bit unsigned integer.

◆ qsc_cjp_uint32()

QSC_EXPORT_API uint32_t qsc_cjp_uint32 ( void )

Generate a random 32-bit unsigned integer using the CPU jitter entropy provider.

Returns
[uint32_t] Returns a random 32-bit unsigned integer.

◆ qsc_cjp_uint64()

QSC_EXPORT_API uint64_t qsc_cjp_uint64 ( void )

Generate a random 64-bit unsigned integer using the CPU jitter entropy provider.

Returns
[uint64_t] Returns a random 64-bit unsigned integer.