iPXE
wycheproof_test.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2026 Michael Brown <mbrown@fensystems.co.uk>.
3 *
4 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation
6 * files (the "Software"), to deal in the Software without
7 * restriction, including without limitation the rights to use, copy,
8 * modify, merge, publish, distribute, sublicense, and/or sell copies
9 * of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 *
24 */
25
26FILE_LICENCE ( BSD2 );
27
28/** @file
29 *
30 * Cryptographic test vectors imported from Project Wycheproof
31 *
32 * Project Wycheproof (https://github.com/C2SP/wycheproof) provides
33 * test vectors designed to exercise cryptographic algorithms with
34 * corner cases that are not covered by the standard known-answer
35 * tests such as those provided by NIST or in RFCs.
36 *
37 * The full applicable test set is extremely large and slow to run.
38 * We deliberately choose not to included these tests within the
39 * standard per-commit test suite, since this would substantially
40 * delay all test runs for no significant benefit.
41 *
42 * The test vectors are provided as JSON files, and are imported into
43 * iPXE using the import tool within the "wycheproof" directory.
44 *
45 */
46
47/* Forcibly enable assertions */
48#undef NDEBUG
49
50#include <ipxe/test.h>
51#include "wycheproof_test.h"
52
53/* Drag in all Wycheproof self-tests */
55REQUIRE_OBJECT ( wycheproof_aes_gcm );
56REQUIRE_OBJECT ( wycheproof_hkdf_sha1 );
57REQUIRE_OBJECT ( wycheproof_hkdf_sha256 );
58REQUIRE_OBJECT ( wycheproof_hkdf_sha384 );
59REQUIRE_OBJECT ( wycheproof_hkdf_sha512 );
60REQUIRE_OBJECT ( wycheproof_hmac_sha1 );
61REQUIRE_OBJECT ( wycheproof_hmac_sha224 );
62REQUIRE_OBJECT ( wycheproof_hmac_sha256 );
63REQUIRE_OBJECT ( wycheproof_hmac_sha384 );
64REQUIRE_OBJECT ( wycheproof_hmac_sha512 );
65REQUIRE_OBJECT ( wycheproof_hmac_sha512_224 );
66REQUIRE_OBJECT ( wycheproof_hmac_sha512_256 );
67REQUIRE_OBJECT ( wycheproof_p256 );
68REQUIRE_OBJECT ( wycheproof_p256_sha256_verify );
69REQUIRE_OBJECT ( wycheproof_p256_sha512_verify );
70REQUIRE_OBJECT ( wycheproof_p384 );
71REQUIRE_OBJECT ( wycheproof_p384_sha256_verify );
72REQUIRE_OBJECT ( wycheproof_p384_sha384_verify );
73REQUIRE_OBJECT ( wycheproof_p384_sha512_verify );
74REQUIRE_OBJECT ( wycheproof_rsa_pkcs1_1024_sign );
75REQUIRE_OBJECT ( wycheproof_rsa_pkcs1_1536_sign );
76REQUIRE_OBJECT ( wycheproof_rsa_pkcs1_2048_decrypt );
77REQUIRE_OBJECT ( wycheproof_rsa_pkcs1_2048_sha224_verify );
78REQUIRE_OBJECT ( wycheproof_rsa_pkcs1_2048_sha256_verify );
79REQUIRE_OBJECT ( wycheproof_rsa_pkcs1_2048_sha384_verify );
80REQUIRE_OBJECT ( wycheproof_rsa_pkcs1_2048_sha512_224_verify );
81REQUIRE_OBJECT ( wycheproof_rsa_pkcs1_2048_sha512_256_verify );
82REQUIRE_OBJECT ( wycheproof_rsa_pkcs1_2048_sha512_verify );
83REQUIRE_OBJECT ( wycheproof_rsa_pkcs1_2048_sign );
84REQUIRE_OBJECT ( wycheproof_rsa_pkcs1_3072_decrypt );
85REQUIRE_OBJECT ( wycheproof_rsa_pkcs1_3072_sha256_verify );
86REQUIRE_OBJECT ( wycheproof_rsa_pkcs1_3072_sha384_verify );
87REQUIRE_OBJECT ( wycheproof_rsa_pkcs1_3072_sha512_256_verify );
88REQUIRE_OBJECT ( wycheproof_rsa_pkcs1_3072_sha512_verify );
89REQUIRE_OBJECT ( wycheproof_rsa_pkcs1_3072_sign );
90REQUIRE_OBJECT ( wycheproof_rsa_pkcs1_4096_decrypt );
91REQUIRE_OBJECT ( wycheproof_rsa_pkcs1_4096_sha256_verify );
92REQUIRE_OBJECT ( wycheproof_rsa_pkcs1_4096_sha384_verify );
93REQUIRE_OBJECT ( wycheproof_rsa_pkcs1_4096_sha512_256_verify );
94REQUIRE_OBJECT ( wycheproof_rsa_pkcs1_4096_sha512_verify );
95REQUIRE_OBJECT ( wycheproof_rsa_pkcs1_4096_sign );
96REQUIRE_OBJECT ( wycheproof_rsa_pkcs1_8192_sha256_verify );
97REQUIRE_OBJECT ( wycheproof_rsa_pkcs1_8192_sha384_verify );
98REQUIRE_OBJECT ( wycheproof_rsa_pkcs1_8192_sha512_verify );
99REQUIRE_OBJECT ( wycheproof_rsa_pss_2048_sha1_verify );
100REQUIRE_OBJECT ( wycheproof_rsa_pss_2048_sha256_verify );
101REQUIRE_OBJECT ( wycheproof_rsa_pss_2048_sha384_verify );
102REQUIRE_OBJECT ( wycheproof_rsa_pss_2048_sha512_224_verify );
103REQUIRE_OBJECT ( wycheproof_rsa_pss_2048_sha512_256_verify );
104REQUIRE_OBJECT ( wycheproof_rsa_pss_3072_sha256_verify );
105REQUIRE_OBJECT ( wycheproof_rsa_pss_4096_sha256_verify );
106REQUIRE_OBJECT ( wycheproof_rsa_pss_4096_sha384_verify );
107REQUIRE_OBJECT ( wycheproof_rsa_pss_4096_sha512_verify );
108REQUIRE_OBJECT ( wycheproof_x25519 );
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:921
#define REQUIRE_OBJECT(object)
Require an object.
Definition compiler.h:227
Self-test infrastructure.
PROVIDE_REQUIRING_SYMBOL()
Cryptographic test vectors imported from Project Wycheproof.