Page MenuHome GnuPG

libgcrypt: Adding Known Answer Tests for KEM
Testing, NormalPublic

Description

FIPS 203 is published. It's good to add KAT for libgcrypt/tests/t-kem.c.

Currently, it simply does: generate, encaps, decaps.

generate and encaps use RNG, so, if we want to test them, some interface to access RNG in use might be needed for tests.

Or, simply adding tests for decaps (only) makes sense.

Event Timeline

gniibe triaged this task as Normal priority.Aug 29 2024, 8:18 AM
gniibe created this task.

I was confused. We already have KAT for decap in t-mlkem.c.

I found that we need to extend our API for FIPS 140 testing with FIPS 203, since the test vector for FIPS 203 assumes that the API has derand variant, supplying random "coins" from application.

I created gniibe/t7277 branch: https://dev.gnupg.org/source/libgcrypt/history/gniibe%252Ft7277/

I re-consider. Adding arguments to existing gcry_kem_keypair is not good since it introduces API break.
Instead, I add gcry_kem_genkey with additional arguments (which can be used for deterministic key generation).