HKDS: Heirarchal Key Derivation System 1.0.0.2 (A2)
A fast post-quantum secure replacement for DUKPT
hkds_benchmark.h File Reference

HKDS performance benchmark tests. More...

#include "common.h"

Go to the source code of this file.

Functions

void hkdstest_benchmark_hkds_server_run (void)
 Tests the HKDS server implementation performance.
 
void hkdstest_benchmark_hkds_client_run (void)
 Tests the HKDS client encryption performance.
 
void hkdstest_benchmark_kmac_run (void)
 Tests the KMAC implementations performance.
 
void hkdstest_benchmark_shake_run (void)
 Tests the SHAKE implementations performance.
 

Detailed Description

HKDS performance benchmark tests.

This header defines functions to benchmark the performance of various HKDS cryptographic operations and primitives. The benchmark tests measure the timing performance for key generation, encryption/decryption, and MAC computations for both the server and client implementations, as well as for the underlying KMAC and SHAKE functions. The tests cover both scalar and vectorized (SIMD) implementations where applicable.

The benchmark test suite includes:

  • Server benchmarks: Timing the performance of server key generation, extraction, and decryption operations.
  • Client benchmarks: Timing the performance of the client's message encryption operations.
  • KMAC benchmarks: Measuring the throughput of the KMAC (Keccak-based MAC) implementations.
  • SHAKE benchmarks: Measuring the throughput of the various SHAKE (extendable-output function) implementations.

Function Documentation

◆ hkdstest_benchmark_hkds_client_run()

void hkdstest_benchmark_hkds_client_run ( void )

Tests the HKDS client encryption performance.

This function benchmarks the performance of the HKDS client encryption functions. It measures the time required to encrypt a fixed number of messages over multiple iterations.

◆ hkdstest_benchmark_hkds_server_run()

void hkdstest_benchmark_hkds_server_run ( void )

Tests the HKDS server implementation performance.

This function benchmarks the performance of the HKDS server functions. It tests the server key generation, extraction, and decryption functions over a fixed number of cycles, and prints the total elapsed time.

◆ hkdstest_benchmark_kmac_run()

void hkdstest_benchmark_kmac_run ( void )

Tests the KMAC implementations performance.

This function benchmarks the performance of the KMAC implementations for various security levels. It processes approximately 1GB of data using KMAC-128, KMAC-256, and KMAC-512 (including vectorized versions, if available) and prints the time taken.

◆ hkdstest_benchmark_shake_run()

void hkdstest_benchmark_shake_run ( void )

Tests the SHAKE implementations performance.

This function benchmarks the performance of various SHAKE implementations (SHAKE-128, SHAKE-256, and SHAKE-512). It processes approximately 1GB of data using both scalar and vectorized (if available) versions of SHAKE, and prints the timing results.