Library Functions

External API for System Stress Testing (ESST)

Overview

This section provides documentation for the external functions available in the ESST (Extreme System Stress Testing) library. These functions allow for programmatic initiation and control of various system stress tests, offering flexibility for integration into automated testing environments or custom benchmarking tools.

Available Functions

sha256

Executes SHA256 hash computations for a specified number of iterations, stressing the CPU's cryptographic capabilities.

extern "C" void sha256(long iterations);

Arguments:

  • long iterations: The number of SHA256 computations to perform.

initGPU

Initializes and executes the full suite of GPU stress tests, including memory, computational, and atomic operation tests. This is the primary entry point for triggering a comprehensive GPU stress evaluation.

extern "C" void initGPU(int iterations);

Arguments:

  • int iterations: Specifies the number of iterations each GPU stress test kernel will run.

p3np1E

Performs computations related to the 3n+1 problem (Collatz conjecture) for a given starting number, stressing integer arithmetic and branching.

extern "C" void p3np1E(unsigned long a, unsigned long * steps);

Arguments:

  • unsigned long a: The starting number for the 3n+1 computation.
  • unsigned long * steps: A pointer to an unsigned long where the number of steps taken will be stored.

primes

Calculates prime numbers up to a given limit, stressing integer arithmetic and basic logic.

extern "C" void primes(unsigned long a, unsigned long * steps);

Arguments:

  • unsigned long a: The upper limit for prime number calculation.
  • unsigned long * steps: A pointer to an unsigned long where the number of operations or primes found will be stored.

avx

Performs AVX (Advanced Vector Extensions) operations on floating-point arrays, stressing SIMD (Single Instruction, Multiple Data) capabilities.

extern "C" void avx(float * a, float * b, float * c);

Arguments:

  • float * a: Pointer to the first input float array.
  • float * b: Pointer to the second input float array.
  • float * c: Pointer to the third input float array.

floodL1L2

Floods and stresses the CPU's L1 and L2 caches by performing rapid memory accesses within a specified buffer.

extern "C" void floodL1L2(void* buffer, unsigned long * iterations_ptr, size_t buffer1_size);

Arguments:

  • void* buffer: A pointer to the memory buffer to be used for cache flooding.
  • unsigned long * iterations_ptr: A pointer to an unsigned long that controls the number of iterations and stores the actual iterations performed.
  • size_t buffer1_size: The size of the buffer in bytes.

floodMemory

Continuously accesses a large memory buffer to stress the system's main memory (RAM) bandwidth and latency.

extern "C" void floodMemory(void* buffer, unsigned long * iterations_ptr, size_t buffer_size);

Arguments:

  • void* buffer: A pointer to the memory buffer to be flooded.
  • unsigned long * iterations_ptr: A pointer to an unsigned long that controls the number of iterations and stores the actual iterations performed.
  • size_t buffer_size: The size of the buffer in bytes.

rowhammerAttack

Attempts to trigger the Rowhammer vulnerability by repeatedly accessing specific memory rows.

extern "C" void rowhammerAttack(void* buffer, unsigned long * iterations_ptr, size_t buffer_size);

Arguments:

  • void* buffer: A pointer to the memory buffer to be used for the attack.
  • unsigned long * iterations_ptr: A pointer to an unsigned long that controls the number of iterations and stores the actual iterations performed.
  • size_t buffer_size: The size of the buffer in bytes.

floodNt

Likely a memory flooding routine targeting NT (Non-Temporal) memory accesses, aiming to bypass caches and stress memory controllers directly.

extern "C" void floodNt(void * buffer, unsigned long * iterations_ptr, size_t buffer_size);

Arguments:

  • void * buffer: A pointer to the memory buffer for non-temporal access.
  • unsigned long * iterations_ptr: A pointer to an unsigned long that controls the number of iterations and stores the actual iterations performed.
  • size_t buffer_size: The size of the buffer in bytes.

aes128EncryptBlock

Encrypts a single 128-bit block using AES-128 encryption.

extern "C" void aes128EncryptBlock(void * out, const void * in, const void * key);

Arguments:

  • void * out: Pointer to the output buffer for the encrypted block.
  • const void * in: Pointer to the input buffer containing the 128-bit plaintext block.
  • const void * key: Pointer to the 128-bit AES key.

aes256Keygen

Generates an expanded key for AES-256 encryption/decryption from a 256-bit initial key.

extern "C" void aes256Keygen(void* expanded_key);

Arguments:

  • void* expanded_key: Pointer to the buffer where the generated expanded key will be stored.

aesXtsEncrypt

Encrypts multiple blocks using AES XTS (XEX-based tweaked-codebook mode with ciphertext stealing) mode.

extern "C" void aesXtsEncrypt(void * out, const void * in, const void* key, const void * tweak, size_t blocks);

Arguments:

  • void * out: Pointer to the output buffer for encrypted data.
  • const void * in: Pointer to the input buffer containing plaintext data.
  • const void* key: Pointer to the AES key.
  • const void * tweak: Pointer to the tweak value for XTS mode.
  • size_t blocks: The number of 128-bit blocks to encrypt.

aes128DecryptBlock

Decrypts a single 128-bit block using AES-128 decryption.

extern "C" void aes128DecryptBlock(void * out, const void * in, const void * key);

Arguments:

  • void * out: Pointer to the output buffer for the decrypted block.
  • const void * in: Pointer to the input buffer containing the 128-bit ciphertext block.
  • const void * key: Pointer to the 128-bit AES key.

aesXtsDecrypt

Decrypts multiple blocks using AES XTS (XEX-based tweaked-codebook mode with ciphertext stealing) mode.

extern "C" void aesXtsDecrypt(void * out, const void * in, const void* key, const void * tweak, size_t blocks);

Arguments:

  • void * out: Pointer to the output buffer for decrypted data.
  • const void * in: Pointer to the input buffer containing ciphertext data.
  • const void* key: Pointer to the AES key.
  • const void * tweak: Pointer to the tweak value for XTS mode.
  • size_t blocks: The number of 128-bit blocks to decrypt.

diskWrite

Performs write operations to a specified disk file, designed to stress storage I/O performance.

extern "C" void diskWrite(const char * name);

Arguments:

  • const char * name: A C-style string specifying the name or path of the file to write to.
ℹ️ Usage Information

This library function is typically called from an external C++ or C application after linking against the compiled ESST library. Ensure your environment is correctly set up for the respective operations (e.g., HIP/CUDA for GPU functions, appropriate libraries for AES, etc.) if you intend to integrate this into your own projects.

← Back to Modules