-
Notifications
You must be signed in to change notification settings - Fork 306
Description
For a variety of historic reasons not particularly interesting to downstream projects Wycheproof currently has two directories with test vector data, testvectors/
(hereafter referred to as v0
) and testvectors_v1/
(hereafter referred to as v1
). This is a confusing situation and requires downstream projects to make a decision about which to use (v0, v1, both?) without clear documentation on the differences between them, or which will be receiving updates into the future. Similarly, new contributors aren't certain where to place new algorithm vectors, or updates to existing vectors. We also have to maintain two schema files for the cases where there is a divergence in format between v0
and v1
(e.g. dsa_p1363_verify
).
This meta issue tracks work required to consolidate the vector data to a single unified directory, and motivates the choice to make that directory the v1
directory, discarding the v0
directory/structure. Within this issue discussion should be scoped specifically to the C2SP/Wycheproof
test vector data as it exists in repo today, and concrete suggestions for a consolidation plan.
v0 or v1?
I think we should centralize on v1
, principally for the reason that it maximizes the test vector coverage with the minimal amount of conversion work.
Here's my initial scoping, based more on algorithm coverage than test case coverage within algorithms. Please correct me if I've missed anything pertinent, there's a lot of files to go through :-)
From my first pass, there's not much in v0
that isn't present in v1/
:
- ECDH w/ sect283k1, sect283r1, sect409k1, sect409r1, sect571k1, sect571r1
- Stand-alone JOSE tests (
json_web_crypto_test.json
,json_web_encryption_test.json
,json_web_key_test.json
,json_web_signature_test.json
) - I think some of these are folded into per-algorithm v1 tests. - RSA PKCS1 signature generation (
rsa_sig_gen_misc_test.json
) - originally reported in No RsassaPkcs1Generate tests in testvectors_v1 #89 - Tag-in-ciphertext AES-GCM-SIV DaeadTests (
aes_siv_cmac_test.json
)
Conversely, in v1
there's a much broader set of algorithms that aren't present in v0/
:
- ML-KEM (
mlkem_test.json
) - ML-DSA (
mldsa_*_sign_[seed|noseed]_test.json
,mlds_*_verify_test.json
, ~9 files) - ARIA (
aria_gcm_test.json
,aria_cbc_pkcs5_test.json
,aria_wrap_test.json
,aria_cmac_test.json
,aria_ccm_test.json
,aria_kwp_test.json
) - Camelia (
camellia_wrap_test.json
,camellia_ccm_test.json
,camellia_cmac_test.json
,camellia_cbc_pkcs5_test.json
) - SEED (
seed_wrap_test.json
,seed_gcm_test.json
,seed_ccm_test.json
) - SM4 (
sm4_gcm_test.json
,sm4_ccm_test.json
) - SM3 (
hmac_sm3_test.json
) - ASCON (
ascon80pq_test.json
,ascon128_test.json
,ascon128a_test.json
) - MORUS (
morus640_test.json
,morus1280_test.json
) - AES-FF1 (
aes_ffi_*_test.json
~22 files) - PBES2 (
pbes2_hmac*_aes_*_test.json
, ~15 files) - PBKDF2 (
pbkdf2_hmacsha[1|512|224|256|384
) - KMAC (
kmac128_no_customization_test.json
,kmac256_no_customization_test.json
) - SipHash (
siphashx_2_4_test.json
,siphashx_4_8_test.json
,siphash_2_4_test.json
,siphash_1_3_test.json
,siphash_4_8_test.json
) - SHAKE (
ecdsa_secp*_shake_*_p1363_test.json
,ecdsa_secp*_shake_*_test.json
,rsa_pss_*_shake*_params_test.json
,rsa_pss_*_shake*_test.json
, ~21 files)
In sum I think the difference in algorithm support between the two makes consolidating on v1
seem most appealing.
Tasks
First, the v0
to v1
missing algorithm conversion work:
- Add/convert ECDH sect283k1, sect283r1, sect409k1, sect409r1, sect571k1, sect571r1 coverage to
v1
- Convert missing v0 ECDH sect* test vectors to v1 #158 - Add/convert RSA PKCS1 sig gen to
v1
- Convert v0 RSA PKCS1 sig gen to v1, improve v1 notes schema #154 - Add/convert tag-in-ciphertext AES-GCM-SIV DaedTests to
v1
- Convert aes_siv_cmac_test to v1 format #159 - Add/convert stand-alone JOSE tests to
v1
- Convert json_web_* vectors to v1 format #160
Afterwards, there are some misc. documentation/tooling updates to be made:
- Delete unused schema files post-consolidation.
- Update
tools/vectorlint/main.go
to update-vectors-dir
flag. - Update
CONTRIBUTING.md
to describe adding new vectors to the consolidated dir. - Update
README.md
to update/remove the FAQ element aboutv0
vsv1
. - Update
README.md
with comprehensive algorithm coverage, adding missing algorithms
Resolves #149