iPXE
tests
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
26
FILE_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 */
54
PROVIDE_REQUIRING_SYMBOL
();
55
REQUIRE_OBJECT
( wycheproof_aes_gcm );
56
REQUIRE_OBJECT
( wycheproof_hkdf_sha1 );
57
REQUIRE_OBJECT
( wycheproof_hkdf_sha256 );
58
REQUIRE_OBJECT
( wycheproof_hkdf_sha384 );
59
REQUIRE_OBJECT
( wycheproof_hkdf_sha512 );
60
REQUIRE_OBJECT
( wycheproof_hmac_sha1 );
61
REQUIRE_OBJECT
( wycheproof_hmac_sha224 );
62
REQUIRE_OBJECT
( wycheproof_hmac_sha256 );
63
REQUIRE_OBJECT
( wycheproof_hmac_sha384 );
64
REQUIRE_OBJECT
( wycheproof_hmac_sha512 );
65
REQUIRE_OBJECT
( wycheproof_hmac_sha512_224 );
66
REQUIRE_OBJECT
( wycheproof_hmac_sha512_256 );
67
REQUIRE_OBJECT
( wycheproof_p256 );
68
REQUIRE_OBJECT
( wycheproof_p256_sha256_verify );
69
REQUIRE_OBJECT
( wycheproof_p256_sha512_verify );
70
REQUIRE_OBJECT
( wycheproof_p384 );
71
REQUIRE_OBJECT
( wycheproof_p384_sha256_verify );
72
REQUIRE_OBJECT
( wycheproof_p384_sha384_verify );
73
REQUIRE_OBJECT
( wycheproof_p384_sha512_verify );
74
REQUIRE_OBJECT
( wycheproof_rsa_pkcs1_1024_sign );
75
REQUIRE_OBJECT
( wycheproof_rsa_pkcs1_1536_sign );
76
REQUIRE_OBJECT
( wycheproof_rsa_pkcs1_2048_decrypt );
77
REQUIRE_OBJECT
( wycheproof_rsa_pkcs1_2048_sha224_verify );
78
REQUIRE_OBJECT
( wycheproof_rsa_pkcs1_2048_sha256_verify );
79
REQUIRE_OBJECT
( wycheproof_rsa_pkcs1_2048_sha384_verify );
80
REQUIRE_OBJECT
( wycheproof_rsa_pkcs1_2048_sha512_224_verify );
81
REQUIRE_OBJECT
( wycheproof_rsa_pkcs1_2048_sha512_256_verify );
82
REQUIRE_OBJECT
( wycheproof_rsa_pkcs1_2048_sha512_verify );
83
REQUIRE_OBJECT
( wycheproof_rsa_pkcs1_2048_sign );
84
REQUIRE_OBJECT
( wycheproof_rsa_pkcs1_3072_decrypt );
85
REQUIRE_OBJECT
( wycheproof_rsa_pkcs1_3072_sha256_verify );
86
REQUIRE_OBJECT
( wycheproof_rsa_pkcs1_3072_sha384_verify );
87
REQUIRE_OBJECT
( wycheproof_rsa_pkcs1_3072_sha512_256_verify );
88
REQUIRE_OBJECT
( wycheproof_rsa_pkcs1_3072_sha512_verify );
89
REQUIRE_OBJECT
( wycheproof_rsa_pkcs1_3072_sign );
90
REQUIRE_OBJECT
( wycheproof_rsa_pkcs1_4096_decrypt );
91
REQUIRE_OBJECT
( wycheproof_rsa_pkcs1_4096_sha256_verify );
92
REQUIRE_OBJECT
( wycheproof_rsa_pkcs1_4096_sha384_verify );
93
REQUIRE_OBJECT
( wycheproof_rsa_pkcs1_4096_sha512_256_verify );
94
REQUIRE_OBJECT
( wycheproof_rsa_pkcs1_4096_sha512_verify );
95
REQUIRE_OBJECT
( wycheproof_rsa_pkcs1_4096_sign );
96
REQUIRE_OBJECT
( wycheproof_rsa_pkcs1_8192_sha256_verify );
97
REQUIRE_OBJECT
( wycheproof_rsa_pkcs1_8192_sha384_verify );
98
REQUIRE_OBJECT
( wycheproof_rsa_pkcs1_8192_sha512_verify );
99
REQUIRE_OBJECT
( wycheproof_rsa_pss_2048_sha1_verify );
100
REQUIRE_OBJECT
( wycheproof_rsa_pss_2048_sha256_verify );
101
REQUIRE_OBJECT
( wycheproof_rsa_pss_2048_sha384_verify );
102
REQUIRE_OBJECT
( wycheproof_rsa_pss_2048_sha512_224_verify );
103
REQUIRE_OBJECT
( wycheproof_rsa_pss_2048_sha512_256_verify );
104
REQUIRE_OBJECT
( wycheproof_rsa_pss_3072_sha256_verify );
105
REQUIRE_OBJECT
( wycheproof_rsa_pss_4096_sha256_verify );
106
REQUIRE_OBJECT
( wycheproof_rsa_pss_4096_sha384_verify );
107
REQUIRE_OBJECT
( wycheproof_rsa_pss_4096_sha512_verify );
108
REQUIRE_OBJECT
( wycheproof_x25519 );
FILE_LICENCE
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition
compiler.h:921
REQUIRE_OBJECT
#define REQUIRE_OBJECT(object)
Require an object.
Definition
compiler.h:227
test.h
Self-test infrastructure.
PROVIDE_REQUIRING_SYMBOL
PROVIDE_REQUIRING_SYMBOL()
wycheproof_test.h
Cryptographic test vectors imported from Project Wycheproof.
Generated by
1.16.1