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

This file contains HKDS self-test definitions. More...

#include "common.h"

Go to the source code of this file.

Functions

HKDS_EXPORT_API bool hkds_selftest_symmetric_run (void)
 Runs the library self tests.
 

Detailed Description

This file contains HKDS self-test definitions.

This header defines the self-test function for the HKDS library. The self-test validates the correctness of the symmetric cryptographic primitives implemented within the library (including various SHAKE and KMAC variants) by comparing computed outputs against predetermined known-answer test vectors. Successful execution of these tests ensures that the cryptographic functions are operating as expected.

Function Documentation

◆ hkds_selftest_symmetric_run()

HKDS_EXPORT_API bool hkds_selftest_symmetric_run ( void )

Runs the library self tests.

This function executes a comprehensive suite of self-tests for the symmetric primitives used in HKDS. The tests cover:

  • Known-answer tests for SHAKE-128, SHAKE-256, and SHAKE-512.
  • Known-answer tests for KMAC with different security parameters (e.g., KMAC-128, KMAC-256, and KMAC-512).
  • Additional equality tests for vectorized implementations (if supported by the system, such as AVX2/AVX512).

The function returns true if all tests pass successfully, indicating that the library's cryptographic functions are correctly implemented. Otherwise, it returns false.

Returns
Returns true if all tests pass successfully; otherwise, false.