mirror of
https://github.com/ipxe/ipxe
synced 2026-10-07 15:05:42 +03:00
[test] Allow for invocation of individual Project Wycheproof tests
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -313,7 +313,8 @@ class TestFile:
|
||||
def source(self):
|
||||
"""Generate source code"""
|
||||
generator = Path(__file__).name
|
||||
execname = "wycheproof_%s_exec" % self.basename
|
||||
testname = "wycheproof_%s" % self.basename
|
||||
execname = "%s_exec" % testname
|
||||
tests = self.tests
|
||||
label = tests[0].test_label
|
||||
definitions = "\n".join(x.definition() for x in self.testGroups)
|
||||
@@ -332,12 +333,20 @@ class TestFile:
|
||||
definitions +
|
||||
textwrap.dedent(f"""
|
||||
/** Perform Wycheproof {label} self-tests */
|
||||
void {execname} ( void ) {{
|
||||
static void {execname} ( void ) {{
|
||||
|
||||
\t/* Perform tests in tcId order */
|
||||
""") +
|
||||
invocations +
|
||||
"}\n"
|
||||
"}\n" +
|
||||
textwrap.dedent(f"""
|
||||
/** Wycheproof {label} self-tests */
|
||||
struct self_test {testname} __self_test = {{
|
||||
\t.name = "{testname}",
|
||||
\t.exec = {execname},
|
||||
}};
|
||||
REQUIRING_SYMBOL ( {testname} );
|
||||
""")
|
||||
)
|
||||
return code
|
||||
|
||||
|
||||
@@ -6798,7 +6798,7 @@ CIPHER_TEST ( wycheproof_aes_gcm_5356a2cb, &aes_gcm_algorithm,
|
||||
0xd2, 0x28, 0x45, 0x43, 0x63, 0xfa ) );
|
||||
|
||||
/** Perform Wycheproof AES-GCM self-tests */
|
||||
void wycheproof_aes_gcm_exec ( void ) {
|
||||
static void wycheproof_aes_gcm_exec ( void ) {
|
||||
|
||||
/* Perform tests in tcId order */
|
||||
cipher_ok ( &wycheproof_aes_gcm_157a9714 );
|
||||
@@ -7037,3 +7037,10 @@ void wycheproof_aes_gcm_exec ( void ) {
|
||||
cipher_iv_fail_ok ( &wycheproof_aes_gcm_59e33b44 );
|
||||
cipher_iv_fail_ok ( &wycheproof_aes_gcm_5356a2cb );
|
||||
}
|
||||
|
||||
/** Wycheproof AES-GCM self-tests */
|
||||
struct self_test wycheproof_aes_gcm __self_test = {
|
||||
.name = "wycheproof_aes_gcm",
|
||||
.exec = wycheproof_aes_gcm_exec,
|
||||
};
|
||||
REQUIRING_SYMBOL ( wycheproof_aes_gcm );
|
||||
|
||||
@@ -2851,7 +2851,7 @@ HKDF_TEST ( wycheproof_hkdf_sha1_cb77a554, &sha1_algorithm, 0,
|
||||
0x1c, 0x75, 0xbb, 0xe5, 0xc6, 0xd4, 0xd9, 0x9f, 0x50, 0x4f ) );
|
||||
|
||||
/** Perform Wycheproof HKDF-SHA1 self-tests */
|
||||
void wycheproof_hkdf_sha1_exec ( void ) {
|
||||
static void wycheproof_hkdf_sha1_exec ( void ) {
|
||||
|
||||
/* Perform tests in tcId order */
|
||||
hkdf_ok ( &wycheproof_hkdf_sha1_51d53903 );
|
||||
@@ -2939,3 +2939,10 @@ void wycheproof_hkdf_sha1_exec ( void ) {
|
||||
hkdf_ok ( &wycheproof_hkdf_sha1_1e6d40dd );
|
||||
hkdf_ok ( &wycheproof_hkdf_sha1_cb77a554 );
|
||||
}
|
||||
|
||||
/** Wycheproof HKDF-SHA1 self-tests */
|
||||
struct self_test wycheproof_hkdf_sha1 __self_test = {
|
||||
.name = "wycheproof_hkdf_sha1",
|
||||
.exec = wycheproof_hkdf_sha1_exec,
|
||||
};
|
||||
REQUIRING_SYMBOL ( wycheproof_hkdf_sha1 );
|
||||
|
||||
@@ -3809,7 +3809,7 @@ HKDF_TEST ( wycheproof_hkdf_sha256_dab8c22b, &sha256_algorithm, 1,
|
||||
0x94, 0x9c ) );
|
||||
|
||||
/** Perform Wycheproof HKDF-SHA256 self-tests */
|
||||
void wycheproof_hkdf_sha256_exec ( void ) {
|
||||
static void wycheproof_hkdf_sha256_exec ( void ) {
|
||||
|
||||
/* Perform tests in tcId order */
|
||||
hkdf_ok ( &wycheproof_hkdf_sha256_a0d947f7 );
|
||||
@@ -3896,3 +3896,10 @@ void wycheproof_hkdf_sha256_exec ( void ) {
|
||||
hkdf_ok ( &wycheproof_hkdf_sha256_44908c9b );
|
||||
hkdf_ok ( &wycheproof_hkdf_sha256_dab8c22b );
|
||||
}
|
||||
|
||||
/** Wycheproof HKDF-SHA256 self-tests */
|
||||
struct self_test wycheproof_hkdf_sha256 __self_test = {
|
||||
.name = "wycheproof_hkdf_sha256",
|
||||
.exec = wycheproof_hkdf_sha256_exec,
|
||||
};
|
||||
REQUIRING_SYMBOL ( wycheproof_hkdf_sha256 );
|
||||
|
||||
@@ -5000,7 +5000,7 @@ HKDF_TEST ( wycheproof_hkdf_sha384_9f8922d1, &sha384_algorithm, 1,
|
||||
0x99, 0x50 ) );
|
||||
|
||||
/** Perform Wycheproof HKDF-SHA384 self-tests */
|
||||
void wycheproof_hkdf_sha384_exec ( void ) {
|
||||
static void wycheproof_hkdf_sha384_exec ( void ) {
|
||||
|
||||
/* Perform tests in tcId order */
|
||||
hkdf_ok ( &wycheproof_hkdf_sha384_95a892ba );
|
||||
@@ -5084,3 +5084,10 @@ void wycheproof_hkdf_sha384_exec ( void ) {
|
||||
hkdf_ok ( &wycheproof_hkdf_sha384_91245a0e );
|
||||
hkdf_ok ( &wycheproof_hkdf_sha384_9f8922d1 );
|
||||
}
|
||||
|
||||
/** Wycheproof HKDF-SHA384 self-tests */
|
||||
struct self_test wycheproof_hkdf_sha384 __self_test = {
|
||||
.name = "wycheproof_hkdf_sha384",
|
||||
.exec = wycheproof_hkdf_sha384_exec,
|
||||
};
|
||||
REQUIRING_SYMBOL ( wycheproof_hkdf_sha384 );
|
||||
|
||||
@@ -6279,7 +6279,7 @@ HKDF_TEST ( wycheproof_hkdf_sha512_4c1af171, &sha512_algorithm, 1,
|
||||
0x1f, 0x98 ) );
|
||||
|
||||
/** Perform Wycheproof HKDF-SHA512 self-tests */
|
||||
void wycheproof_hkdf_sha512_exec ( void ) {
|
||||
static void wycheproof_hkdf_sha512_exec ( void ) {
|
||||
|
||||
/* Perform tests in tcId order */
|
||||
hkdf_ok ( &wycheproof_hkdf_sha512_a3697e50 );
|
||||
@@ -6363,3 +6363,10 @@ void wycheproof_hkdf_sha512_exec ( void ) {
|
||||
hkdf_ok ( &wycheproof_hkdf_sha512_ccb68099 );
|
||||
hkdf_ok ( &wycheproof_hkdf_sha512_4c1af171 );
|
||||
}
|
||||
|
||||
/** Wycheproof HKDF-SHA512 self-tests */
|
||||
struct self_test wycheproof_hkdf_sha512 __self_test = {
|
||||
.name = "wycheproof_hkdf_sha512",
|
||||
.exec = wycheproof_hkdf_sha512_exec,
|
||||
};
|
||||
REQUIRING_SYMBOL ( wycheproof_hkdf_sha512 );
|
||||
|
||||
@@ -984,7 +984,7 @@ HMAC_TEST ( wycheproof_hmac_sha1_31fa7435, &sha1_algorithm,
|
||||
0x6e ) );
|
||||
|
||||
/** Perform Wycheproof HMAC-SHA1 self-tests */
|
||||
void wycheproof_hmac_sha1_exec ( void ) {
|
||||
static void wycheproof_hmac_sha1_exec ( void ) {
|
||||
|
||||
/* Perform tests in tcId order */
|
||||
hmac_ok ( &wycheproof_hmac_sha1_34c35b06 );
|
||||
@@ -1054,3 +1054,10 @@ void wycheproof_hmac_sha1_exec ( void ) {
|
||||
hmac_ok ( &wycheproof_hmac_sha1_80c177c9 );
|
||||
hmac_ok ( &wycheproof_hmac_sha1_31fa7435 );
|
||||
}
|
||||
|
||||
/** Wycheproof HMAC-SHA1 self-tests */
|
||||
struct self_test wycheproof_hmac_sha1 __self_test = {
|
||||
.name = "wycheproof_hmac_sha1",
|
||||
.exec = wycheproof_hmac_sha1_exec,
|
||||
};
|
||||
REQUIRING_SYMBOL ( wycheproof_hmac_sha1 );
|
||||
|
||||
@@ -1081,7 +1081,7 @@ HMAC_TEST ( wycheproof_hmac_sha224_19a04f15, &sha224_algorithm,
|
||||
0x63, 0xee, 0xa0, 0x0b, 0x86 ) );
|
||||
|
||||
/** Perform Wycheproof HMAC-SHA224 self-tests */
|
||||
void wycheproof_hmac_sha224_exec ( void ) {
|
||||
static void wycheproof_hmac_sha224_exec ( void ) {
|
||||
|
||||
/* Perform tests in tcId order */
|
||||
hmac_ok ( &wycheproof_hmac_sha224_ca23d586 );
|
||||
@@ -1151,3 +1151,10 @@ void wycheproof_hmac_sha224_exec ( void ) {
|
||||
hmac_ok ( &wycheproof_hmac_sha224_eb99418d );
|
||||
hmac_ok ( &wycheproof_hmac_sha224_19a04f15 );
|
||||
}
|
||||
|
||||
/** Wycheproof HMAC-SHA224 self-tests */
|
||||
struct self_test wycheproof_hmac_sha224 __self_test = {
|
||||
.name = "wycheproof_hmac_sha224",
|
||||
.exec = wycheproof_hmac_sha224_exec,
|
||||
};
|
||||
REQUIRING_SYMBOL ( wycheproof_hmac_sha224 );
|
||||
|
||||
@@ -1139,7 +1139,7 @@ HMAC_TEST ( wycheproof_hmac_sha256_d67d39a0, &sha256_algorithm,
|
||||
0xdd, 0xba, 0x68, 0xab, 0x34, 0xf5, 0xf1 ) );
|
||||
|
||||
/** Perform Wycheproof HMAC-SHA256 self-tests */
|
||||
void wycheproof_hmac_sha256_exec ( void ) {
|
||||
static void wycheproof_hmac_sha256_exec ( void ) {
|
||||
|
||||
/* Perform tests in tcId order */
|
||||
hmac_ok ( &wycheproof_hmac_sha256_7c4140b3 );
|
||||
@@ -1209,3 +1209,10 @@ void wycheproof_hmac_sha256_exec ( void ) {
|
||||
hmac_ok ( &wycheproof_hmac_sha256_08887d89 );
|
||||
hmac_ok ( &wycheproof_hmac_sha256_d67d39a0 );
|
||||
}
|
||||
|
||||
/** Wycheproof HMAC-SHA256 self-tests */
|
||||
struct self_test wycheproof_hmac_sha256 __self_test = {
|
||||
.name = "wycheproof_hmac_sha256",
|
||||
.exec = wycheproof_hmac_sha256_exec,
|
||||
};
|
||||
REQUIRING_SYMBOL ( wycheproof_hmac_sha256 );
|
||||
|
||||
@@ -1298,7 +1298,7 @@ HMAC_TEST ( wycheproof_hmac_sha384_2cc77d41, &sha384_algorithm,
|
||||
0x8a, 0x37, 0x70, 0x7a, 0x63, 0x30 ) );
|
||||
|
||||
/** Perform Wycheproof HMAC-SHA384 self-tests */
|
||||
void wycheproof_hmac_sha384_exec ( void ) {
|
||||
static void wycheproof_hmac_sha384_exec ( void ) {
|
||||
|
||||
/* Perform tests in tcId order */
|
||||
hmac_ok ( &wycheproof_hmac_sha384_bd862db0 );
|
||||
@@ -1368,3 +1368,10 @@ void wycheproof_hmac_sha384_exec ( void ) {
|
||||
hmac_ok ( &wycheproof_hmac_sha384_e022fc1f );
|
||||
hmac_ok ( &wycheproof_hmac_sha384_2cc77d41 );
|
||||
}
|
||||
|
||||
/** Wycheproof HMAC-SHA384 self-tests */
|
||||
struct self_test wycheproof_hmac_sha384 __self_test = {
|
||||
.name = "wycheproof_hmac_sha384",
|
||||
.exec = wycheproof_hmac_sha384_exec,
|
||||
};
|
||||
REQUIRING_SYMBOL ( wycheproof_hmac_sha384 );
|
||||
|
||||
@@ -1511,7 +1511,7 @@ HMAC_TEST ( wycheproof_hmac_sha512_570df7ed, &sha512_algorithm,
|
||||
0x4d, 0x0e, 0x41, 0x12, 0x32 ) );
|
||||
|
||||
/** Perform Wycheproof HMAC-SHA512 self-tests */
|
||||
void wycheproof_hmac_sha512_exec ( void ) {
|
||||
static void wycheproof_hmac_sha512_exec ( void ) {
|
||||
|
||||
/* Perform tests in tcId order */
|
||||
hmac_ok ( &wycheproof_hmac_sha512_cb791442 );
|
||||
@@ -1581,3 +1581,10 @@ void wycheproof_hmac_sha512_exec ( void ) {
|
||||
hmac_ok ( &wycheproof_hmac_sha512_7514bc88 );
|
||||
hmac_ok ( &wycheproof_hmac_sha512_570df7ed );
|
||||
}
|
||||
|
||||
/** Wycheproof HMAC-SHA512 self-tests */
|
||||
struct self_test wycheproof_hmac_sha512 __self_test = {
|
||||
.name = "wycheproof_hmac_sha512",
|
||||
.exec = wycheproof_hmac_sha512_exec,
|
||||
};
|
||||
REQUIRING_SYMBOL ( wycheproof_hmac_sha512 );
|
||||
|
||||
@@ -1083,7 +1083,7 @@ HMAC_TEST ( wycheproof_hmac_sha512_224_0e3ad29e, &sha512_224_algorithm,
|
||||
0x02, 0xd3, 0x25, 0x1a, 0xa6 ) );
|
||||
|
||||
/** Perform Wycheproof HMAC-SHA512/224 self-tests */
|
||||
void wycheproof_hmac_sha512_224_exec ( void ) {
|
||||
static void wycheproof_hmac_sha512_224_exec ( void ) {
|
||||
|
||||
/* Perform tests in tcId order */
|
||||
hmac_ok ( &wycheproof_hmac_sha512_224_de4aa7c9 );
|
||||
@@ -1153,3 +1153,10 @@ void wycheproof_hmac_sha512_224_exec ( void ) {
|
||||
hmac_ok ( &wycheproof_hmac_sha512_224_77fdbab9 );
|
||||
hmac_ok ( &wycheproof_hmac_sha512_224_0e3ad29e );
|
||||
}
|
||||
|
||||
/** Wycheproof HMAC-SHA512/224 self-tests */
|
||||
struct self_test wycheproof_hmac_sha512_224 __self_test = {
|
||||
.name = "wycheproof_hmac_sha512_224",
|
||||
.exec = wycheproof_hmac_sha512_224_exec,
|
||||
};
|
||||
REQUIRING_SYMBOL ( wycheproof_hmac_sha512_224 );
|
||||
|
||||
@@ -1141,7 +1141,7 @@ HMAC_TEST ( wycheproof_hmac_sha512_256_ac9f347b, &sha512_256_algorithm,
|
||||
0x2b, 0x1e, 0xc6, 0xb7, 0xe0, 0x0d, 0x60 ) );
|
||||
|
||||
/** Perform Wycheproof HMAC-SHA512/256 self-tests */
|
||||
void wycheproof_hmac_sha512_256_exec ( void ) {
|
||||
static void wycheproof_hmac_sha512_256_exec ( void ) {
|
||||
|
||||
/* Perform tests in tcId order */
|
||||
hmac_ok ( &wycheproof_hmac_sha512_256_0b2d4593 );
|
||||
@@ -1211,3 +1211,10 @@ void wycheproof_hmac_sha512_256_exec ( void ) {
|
||||
hmac_ok ( &wycheproof_hmac_sha512_256_b8fe66a6 );
|
||||
hmac_ok ( &wycheproof_hmac_sha512_256_ac9f347b );
|
||||
}
|
||||
|
||||
/** Wycheproof HMAC-SHA512/256 self-tests */
|
||||
struct self_test wycheproof_hmac_sha512_256 __self_test = {
|
||||
.name = "wycheproof_hmac_sha512_256",
|
||||
.exec = wycheproof_hmac_sha512_256_exec,
|
||||
};
|
||||
REQUIRING_SYMBOL ( wycheproof_hmac_sha512_256 );
|
||||
|
||||
@@ -6551,7 +6551,7 @@ EXCHANGE_TEST ( wycheproof_p256_3551fa82, &p256_algorithm,
|
||||
/* P256 test case 355 (skipped: compressed) */
|
||||
|
||||
/** Perform Wycheproof P256 self-tests */
|
||||
void wycheproof_p256_exec ( void ) {
|
||||
static void wycheproof_p256_exec ( void ) {
|
||||
|
||||
/* Perform tests in tcId order */
|
||||
exchange_ok ( &wycheproof_p256_0275e48b );
|
||||
@@ -6901,3 +6901,10 @@ void wycheproof_p256_exec ( void ) {
|
||||
exchange_ok ( &wycheproof_p256_fb2466c2 );
|
||||
exchange_ok ( &wycheproof_p256_3551fa82 );
|
||||
}
|
||||
|
||||
/** Wycheproof P256 self-tests */
|
||||
struct self_test wycheproof_p256 __self_test = {
|
||||
.name = "wycheproof_p256",
|
||||
.exec = wycheproof_p256_exec,
|
||||
};
|
||||
REQUIRING_SYMBOL ( wycheproof_p256 );
|
||||
|
||||
@@ -18837,7 +18837,7 @@ EXCHANGE_TEST ( wycheproof_p384_4b73134e, &p384_algorithm,
|
||||
/* P384 test case 790 (skipped: compressed) */
|
||||
|
||||
/** Perform Wycheproof P384 self-tests */
|
||||
void wycheproof_p384_exec ( void ) {
|
||||
static void wycheproof_p384_exec ( void ) {
|
||||
|
||||
/* Perform tests in tcId order */
|
||||
exchange_ok ( &wycheproof_p384_20c88bb9 );
|
||||
@@ -19628,3 +19628,10 @@ void wycheproof_p384_exec ( void ) {
|
||||
exchange_ok ( &wycheproof_p384_5e35963a );
|
||||
exchange_ok ( &wycheproof_p384_4b73134e );
|
||||
}
|
||||
|
||||
/** Wycheproof P384 self-tests */
|
||||
struct self_test wycheproof_p384 __self_test = {
|
||||
.name = "wycheproof_p384",
|
||||
.exec = wycheproof_p384_exec,
|
||||
};
|
||||
REQUIRING_SYMBOL ( wycheproof_p384 );
|
||||
|
||||
@@ -6907,7 +6907,7 @@ PUBKEY_ENCRYPTION_TEST ( wycheproof_rsa_pkcs1_2048_decrypt_74dff8e4,
|
||||
0x00, 0x00, 0x00, 0x00 ) );
|
||||
|
||||
/** Perform Wycheproof RSA-PKCS#1 (2048-bit) self-tests */
|
||||
void wycheproof_rsa_pkcs1_2048_decrypt_exec ( void ) {
|
||||
static void wycheproof_rsa_pkcs1_2048_decrypt_exec ( void ) {
|
||||
|
||||
/* Perform tests in tcId order */
|
||||
pubkey_decrypt_ok ( &wycheproof_rsa_pkcs1_2048_decrypt_d9c1bea2 );
|
||||
@@ -6978,3 +6978,10 @@ void wycheproof_rsa_pkcs1_2048_decrypt_exec ( void ) {
|
||||
pubkey_decrypt_ok ( &wycheproof_rsa_pkcs1_2048_decrypt_4b59a6c8 );
|
||||
pubkey_decrypt_ok ( &wycheproof_rsa_pkcs1_2048_decrypt_74dff8e4 );
|
||||
}
|
||||
|
||||
/** Wycheproof RSA-PKCS#1 (2048-bit) self-tests */
|
||||
struct self_test wycheproof_rsa_pkcs1_2048_decrypt __self_test = {
|
||||
.name = "wycheproof_rsa_pkcs1_2048_decrypt",
|
||||
.exec = wycheproof_rsa_pkcs1_2048_decrypt_exec,
|
||||
};
|
||||
REQUIRING_SYMBOL ( wycheproof_rsa_pkcs1_2048_decrypt );
|
||||
|
||||
@@ -10166,7 +10166,7 @@ PUBKEY_ENCRYPTION_TEST ( wycheproof_rsa_pkcs1_3072_decrypt_63dfd100,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ) );
|
||||
|
||||
/** Perform Wycheproof RSA-PKCS#1 (3072-bit) self-tests */
|
||||
void wycheproof_rsa_pkcs1_3072_decrypt_exec ( void ) {
|
||||
static void wycheproof_rsa_pkcs1_3072_decrypt_exec ( void ) {
|
||||
|
||||
/* Perform tests in tcId order */
|
||||
pubkey_decrypt_ok ( &wycheproof_rsa_pkcs1_3072_decrypt_983cf533 );
|
||||
@@ -10237,3 +10237,10 @@ void wycheproof_rsa_pkcs1_3072_decrypt_exec ( void ) {
|
||||
pubkey_decrypt_ok ( &wycheproof_rsa_pkcs1_3072_decrypt_2025e7f4 );
|
||||
pubkey_decrypt_ok ( &wycheproof_rsa_pkcs1_3072_decrypt_63dfd100 );
|
||||
}
|
||||
|
||||
/** Wycheproof RSA-PKCS#1 (3072-bit) self-tests */
|
||||
struct self_test wycheproof_rsa_pkcs1_3072_decrypt __self_test = {
|
||||
.name = "wycheproof_rsa_pkcs1_3072_decrypt",
|
||||
.exec = wycheproof_rsa_pkcs1_3072_decrypt_exec,
|
||||
};
|
||||
REQUIRING_SYMBOL ( wycheproof_rsa_pkcs1_3072_decrypt );
|
||||
|
||||
@@ -13281,7 +13281,7 @@ PUBKEY_ENCRYPTION_TEST ( wycheproof_rsa_pkcs1_4096_decrypt_3f4e6b53,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ) );
|
||||
|
||||
/** Perform Wycheproof RSA-PKCS#1 (4096-bit) self-tests */
|
||||
void wycheproof_rsa_pkcs1_4096_decrypt_exec ( void ) {
|
||||
static void wycheproof_rsa_pkcs1_4096_decrypt_exec ( void ) {
|
||||
|
||||
/* Perform tests in tcId order */
|
||||
pubkey_decrypt_ok ( &wycheproof_rsa_pkcs1_4096_decrypt_5051ae08 );
|
||||
@@ -13352,3 +13352,10 @@ void wycheproof_rsa_pkcs1_4096_decrypt_exec ( void ) {
|
||||
pubkey_decrypt_ok ( &wycheproof_rsa_pkcs1_4096_decrypt_89dd834c );
|
||||
pubkey_decrypt_ok ( &wycheproof_rsa_pkcs1_4096_decrypt_3f4e6b53 );
|
||||
}
|
||||
|
||||
/** Wycheproof RSA-PKCS#1 (4096-bit) self-tests */
|
||||
struct self_test wycheproof_rsa_pkcs1_4096_decrypt __self_test = {
|
||||
.name = "wycheproof_rsa_pkcs1_4096_decrypt",
|
||||
.exec = wycheproof_rsa_pkcs1_4096_decrypt_exec,
|
||||
};
|
||||
REQUIRING_SYMBOL ( wycheproof_rsa_pkcs1_4096_decrypt );
|
||||
|
||||
@@ -8202,7 +8202,7 @@ EXCHANGE_TEST ( wycheproof_x25519_fad4ba69, &x25519_algorithm,
|
||||
0xf9, 0x14 ) );
|
||||
|
||||
/** Perform Wycheproof X25519 self-tests */
|
||||
void wycheproof_x25519_exec ( void ) {
|
||||
static void wycheproof_x25519_exec ( void ) {
|
||||
|
||||
/* Perform tests in tcId order */
|
||||
exchange_ok ( &wycheproof_x25519_08be174f );
|
||||
@@ -8724,3 +8724,10 @@ void wycheproof_x25519_exec ( void ) {
|
||||
exchange_ok ( &wycheproof_x25519_b00860fc );
|
||||
exchange_ok ( &wycheproof_x25519_fad4ba69 );
|
||||
}
|
||||
|
||||
/** Wycheproof X25519 self-tests */
|
||||
struct self_test wycheproof_x25519 __self_test = {
|
||||
.name = "wycheproof_x25519",
|
||||
.exec = wycheproof_x25519_exec,
|
||||
};
|
||||
REQUIRING_SYMBOL ( wycheproof_x25519 );
|
||||
|
||||
+20
-75
@@ -50,78 +50,23 @@ FILE_LICENCE ( BSD2 );
|
||||
#include <ipxe/test.h>
|
||||
#include "wycheproof_test.h"
|
||||
|
||||
/** Self-tests */
|
||||
struct self_test wycheproof_test[] __self_test = {
|
||||
{
|
||||
.name = "wycheproof:aes-gcm",
|
||||
.exec = wycheproof_aes_gcm_exec,
|
||||
},
|
||||
{
|
||||
.name = "wycheproof:hkdf-sha1",
|
||||
.exec = wycheproof_hkdf_sha1_exec,
|
||||
},
|
||||
{
|
||||
.name = "wycheproof:hkdf-sha256",
|
||||
.exec = wycheproof_hkdf_sha256_exec,
|
||||
},
|
||||
{
|
||||
.name = "wycheproof:hkdf-sha384",
|
||||
.exec = wycheproof_hkdf_sha384_exec,
|
||||
},
|
||||
{
|
||||
.name = "wycheproof:hkdf-sha512",
|
||||
.exec = wycheproof_hkdf_sha512_exec,
|
||||
},
|
||||
{
|
||||
.name = "wycheproof:hmac-sha1",
|
||||
.exec = wycheproof_hmac_sha1_exec,
|
||||
},
|
||||
{
|
||||
.name = "wycheproof:hmac-sha224",
|
||||
.exec = wycheproof_hmac_sha224_exec,
|
||||
},
|
||||
{
|
||||
.name = "wycheproof:hmac-sha256",
|
||||
.exec = wycheproof_hmac_sha256_exec,
|
||||
},
|
||||
{
|
||||
.name = "wycheproof:hmac-sha384",
|
||||
.exec = wycheproof_hmac_sha384_exec,
|
||||
},
|
||||
{
|
||||
.name = "wycheproof:hmac-sha512",
|
||||
.exec = wycheproof_hmac_sha512_exec,
|
||||
},
|
||||
{
|
||||
.name = "wycheproof:hmac-sha512/224",
|
||||
.exec = wycheproof_hmac_sha512_224_exec,
|
||||
},
|
||||
{
|
||||
.name = "wycheproof:hmac-sha512/256",
|
||||
.exec = wycheproof_hmac_sha512_256_exec,
|
||||
},
|
||||
{
|
||||
.name = "wycheproof:p256",
|
||||
.exec = wycheproof_p256_exec,
|
||||
},
|
||||
{
|
||||
.name = "wycheproof:p384",
|
||||
.exec = wycheproof_p384_exec,
|
||||
},
|
||||
{
|
||||
.name = "wycheproof:rsa-pkcs1-2048-decrypt",
|
||||
.exec = wycheproof_rsa_pkcs1_3072_decrypt_exec,
|
||||
},
|
||||
{
|
||||
.name = "wycheproof:rsa-pkcs1-3072-decrypt",
|
||||
.exec = wycheproof_rsa_pkcs1_3072_decrypt_exec,
|
||||
},
|
||||
{
|
||||
.name = "wycheproof:rsa-pkcs1-4096-decrypt",
|
||||
.exec = wycheproof_rsa_pkcs1_3072_decrypt_exec,
|
||||
},
|
||||
{
|
||||
.name = "wycheproof:x25519",
|
||||
.exec = wycheproof_x25519_exec,
|
||||
},
|
||||
};
|
||||
/* Drag in all Wycheproof self-tests */
|
||||
PROVIDE_REQUIRING_SYMBOL();
|
||||
REQUIRE_OBJECT ( wycheproof_aes_gcm );
|
||||
REQUIRE_OBJECT ( wycheproof_hkdf_sha1 );
|
||||
REQUIRE_OBJECT ( wycheproof_hkdf_sha256 );
|
||||
REQUIRE_OBJECT ( wycheproof_hkdf_sha384 );
|
||||
REQUIRE_OBJECT ( wycheproof_hkdf_sha512 );
|
||||
REQUIRE_OBJECT ( wycheproof_hmac_sha1 );
|
||||
REQUIRE_OBJECT ( wycheproof_hmac_sha224 );
|
||||
REQUIRE_OBJECT ( wycheproof_hmac_sha256 );
|
||||
REQUIRE_OBJECT ( wycheproof_hmac_sha384 );
|
||||
REQUIRE_OBJECT ( wycheproof_hmac_sha512_224 );
|
||||
REQUIRE_OBJECT ( wycheproof_hmac_sha512_256 );
|
||||
REQUIRE_OBJECT ( wycheproof_hmac_sha512 );
|
||||
REQUIRE_OBJECT ( wycheproof_p256 );
|
||||
REQUIRE_OBJECT ( wycheproof_p384 );
|
||||
REQUIRE_OBJECT ( wycheproof_rsa_pkcs1_2048_decrypt );
|
||||
REQUIRE_OBJECT ( wycheproof_rsa_pkcs1_3072_decrypt );
|
||||
REQUIRE_OBJECT ( wycheproof_rsa_pkcs1_4096_decrypt );
|
||||
REQUIRE_OBJECT ( wycheproof_x25519 );
|
||||
|
||||
@@ -24,23 +24,4 @@ FILE_LICENCE ( BSD2 );
|
||||
#include "hmac_test.h"
|
||||
#include "pubkey_test.h"
|
||||
|
||||
extern void wycheproof_aes_gcm_exec ( void );
|
||||
extern void wycheproof_hkdf_sha1_exec ( void );
|
||||
extern void wycheproof_hkdf_sha256_exec ( void );
|
||||
extern void wycheproof_hkdf_sha384_exec ( void );
|
||||
extern void wycheproof_hkdf_sha512_exec ( void );
|
||||
extern void wycheproof_hmac_sha1_exec ( void );
|
||||
extern void wycheproof_hmac_sha224_exec ( void );
|
||||
extern void wycheproof_hmac_sha256_exec ( void );
|
||||
extern void wycheproof_hmac_sha384_exec ( void );
|
||||
extern void wycheproof_hmac_sha512_exec ( void );
|
||||
extern void wycheproof_hmac_sha512_224_exec ( void );
|
||||
extern void wycheproof_hmac_sha512_256_exec ( void );
|
||||
extern void wycheproof_p256_exec ( void );
|
||||
extern void wycheproof_p384_exec ( void );
|
||||
extern void wycheproof_rsa_pkcs1_2048_decrypt_exec ( void );
|
||||
extern void wycheproof_rsa_pkcs1_3072_decrypt_exec ( void );
|
||||
extern void wycheproof_rsa_pkcs1_4096_decrypt_exec ( void );
|
||||
extern void wycheproof_x25519_exec ( void );
|
||||
|
||||
#endif /* _WYCHEPROOF_TEST_H */
|
||||
|
||||
Reference in New Issue
Block a user