Skip to content

Commit 6c69f46

Browse files
committed
[crypto] Add missing tests to the testplan
The testplan located in `sw/device/lib/crypto/data` is missing some of the cryptotests that we have. Add them to the testplan. Signed-off-by: Pascal Nasahl <[email protected]>
1 parent f297caf commit 6c69f46

File tree

1 file changed

+114
-32
lines changed

1 file changed

+114
-32
lines changed

sw/device/lib/crypto/data/crypto_testplan.hjson

Lines changed: 114 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,25 @@
55
name: "crypto"
66
testpoints: [
77
{
8-
name: crypto_lib_hash_stress
9-
desc: '''Check that the hash algorithms are correct.
8+
name: crypto_lib_aes_stress
9+
desc: '''Check that the aes implementation is correct.
1010

11-
Run the hash algorithms Sha256, Sha384 and Sha512 and compare the digist against
12-
the NIST test vector.
11+
Run the following operations and compare the result against the NIST test vector:
12+
- AES-CBC/CFB/ECB/OFB encryption.
13+
- AES-CBC/CFB/ECB/OFB decryption.
14+
- AES-GCM encryption.
15+
- AES-GCM decryption.
1316
'''
1417
stage: N.A.
1518
si_stage: SV3
1619
tests: []
1720
bazel: [
18-
"//sw/device/tests/crypto:sha256_functest",
19-
"//sw/device/tests/crypto:sha384_functest",
20-
"//sw/device/tests/crypto:sha512_functest",
21-
"//sw/device/tests/crypto:hkdf_functest",
22-
"//sw/device/tests/crypto:otcrypto_hash_test",
23-
"//sw/device/tests/crypto:otcrypto_export_test"
21+
"//sw/device/tests/crypto:aes_functest",
22+
"//sw/device/tests/crypto:aes_kwp_kat_functest",
23+
"//sw/device/tests/crypto:aes_kwp_functest",
24+
"//sw/device/tests/crypto:aes_gcm_functest",
25+
"//sw/device/tests/crypto/cryptotest:aes_kat"
26+
"//sw/device/tests/crypto/cryptotest:aes_gcm_kat"
2427
]
2528
lc_states: ["PROD"]
2629
}
@@ -45,23 +48,69 @@
4548
]
4649
}
4750
{
48-
name: crypto_lib_rsa_key_gen_stress
49-
desc: '''Check that the implementation of RSA key generation is correct.
51+
name: crypto_lib_hash_stress
52+
desc: '''Check that the hash algorithms are correct.
5053

51-
Generate RSA key pairs with sizes 2048, 3072 and 4096 bits.
52-
The key generation should take an appropriate time based on the key size and the
53-
platform (FPGA or Silicon).
54-
For each key pair:
55-
- Sign a message with the private key.
56-
- Verify the signature with the public key.
54+
Run the hash algorithms Sha256, Sha384, Sha512, SHA3-224, SHA3-256,
55+
SHA3-384 and SHA3-512 and compare the digest against the NIST test
56+
vector.
5757
'''
5858
stage: N.A.
5959
si_stage: SV3
6060
tests: []
6161
bazel: [
62-
"//sw/device/tests/crypto:rsa_2048_keygen_functest",
63-
"//sw/device/tests/crypto:rsa_3072_keygen_functest",
64-
"//sw/device/tests/crypto:rsa_4096_keygen_functest",
62+
"//sw/device/tests/crypto:sha256_functest",
63+
"//sw/device/tests/crypto:sha384_functest",
64+
"//sw/device/tests/crypto:sha512_functest",
65+
"//sw/device/tests/crypto:hkdf_functest",
66+
"//sw/device/tests/crypto:otcrypto_hash_test",
67+
"//sw/device/tests/crypto:otcrypto_export_test"
68+
"//sw/device/tests/crypto/cryptotest:sha256_kat",
69+
"//sw/device/tests/crypto/cryptotest:sha384_kat",
70+
"//sw/device/tests/crypto/cryptotest:sha3_224_kat",
71+
"//sw/device/tests/crypto/cryptotest:sha3_256_kat",
72+
"//sw/device/tests/crypto/cryptotest:sha3_384_kat",
73+
"//sw/device/tests/crypto/cryptotest:sha3_512_kat",
74+
"//sw/device/tests/crypto/cryptotest:sha512_kat",
75+
]
76+
lc_states: ["PROD"]
77+
}
78+
{
79+
name: crypto_lib_hmac_stress
80+
desc: '''Check that HMAC works correctly.
81+
82+
Run HMAC Sha256, Sha384 and Sha512 and compare the output against
83+
the NIST test vector.
84+
'''
85+
stage: N.A.
86+
si_stage: SV3
87+
tests: []
88+
bazel: [
89+
"//sw/device/tests/crypto:hmac_sha256_functest",
90+
"//sw/device/tests/crypto:hmac_sha384_functest",
91+
"//sw/device/tests/crypto:hmac_sha512_functest",
92+
"//sw/device/tests/crypto:hmac_functest",
93+
"//sw/device/tests/crypto:hmac_multistream_functest",
94+
"//sw/device/tests/crypto/cryptotest:acvp_hmac_sha256",
95+
"//sw/device/tests/crypto/cryptotest:hmac_sha256_kat",
96+
"//sw/device/tests/crypto/cryptotest:hmac_sha384_kat",
97+
"//sw/device/tests/crypto/cryptotest:hmac_sha512_kat",
98+
]
99+
lc_states: ["PROD"]
100+
}
101+
{
102+
name: crypto_lib_kmac_stress
103+
desc: '''Check that KMAC works correctly.
104+
105+
Run KMAC and compare the output against
106+
the wycheproof test vector.
107+
'''
108+
stage: N.A.
109+
si_stage: SV3
110+
tests: []
111+
bazel: [
112+
"//sw/device/tests/crypto:kmac_functest_hardcoded",
113+
"//sw/device/tests/crypto/cryptotest:kmac_kat",
65114
]
66115
lc_states: ["PROD"]
67116
}
@@ -72,6 +121,7 @@
72121
Run the follow operations and compare the result against the NIST test vector:
73122
- RSA signature.
74123
- RSA signature verification.
124+
- RSA encryption and decryption.
75125
With the keys sizes 2048, 3072 and 4096 bits.
76126
'''
77127
stage: N.A.
@@ -85,27 +135,59 @@
85135
"//sw/device/tests/crypto:rsa_3072_signature_functest",
86136
"//sw/device/tests/crypto:rsa_4096_encryption_functest",
87137
"//sw/device/tests/crypto:rsa_4096_signature_functest",
138+
"//sw/device/tests/crypto/cryptotest:rsa_kat",
88139
]
89140
lc_states: ["PROD"]
90141
}
91142
{
92-
name: crypto_lib_aes_stress
93-
desc: '''Check that the aes implementation is correct.
143+
name: crypto_lib_rsa_key_gen_stress
144+
desc: '''Check that the implementation of RSA key generation is correct.
94145

95-
Run the following operations and compare the result against the NIST test vector:
96-
- AES-CBC encryption.
97-
- AES-CBC decryption.
98-
- AES-GCM encryption.
99-
- AES-GCM decryption.
146+
Generate RSA key pairs with sizes 2048, 3072 and 4096 bits.
147+
The key generation should take an appropriate time based on the key size and the
148+
platform (FPGA or Silicon).
149+
For each key pair:
150+
- Sign a message with the private key.
151+
- Verify the signature with the public key.
100152
'''
101153
stage: N.A.
102154
si_stage: SV3
103155
tests: []
104156
bazel: [
105-
"//sw/device/tests/crypto:aes_kwp_kat_functest",
106-
"//sw/device/tests/crypto:aes_kwp_functest",
107-
"//sw/device/tests/crypto:aes_gcm_functest",
108-
"//sw/device/tests/crypto/cryptotest:aes_kat"
157+
"//sw/device/tests/crypto:rsa_2048_keygen_functest",
158+
"//sw/device/tests/crypto:rsa_3072_keygen_functest",
159+
"//sw/device/tests/crypto:rsa_4096_keygen_functest",
160+
]
161+
lc_states: ["PROD"]
162+
}
163+
{
164+
name: crypto_lib_shake_stress
165+
desc: '''Check that the implementation of SHAKE is correct.
166+
167+
Run CShake128 and CShake256 and compare the output against
168+
the NIST test vector.
169+
'''
170+
stage: N.A.
171+
si_stage: SV3
172+
tests: []
173+
bazel: [
174+
"//sw/device/tests/crypto:cshake_kat",
175+
"//sw/device/tests/crypto:shake128_kat",
176+
"//sw/device/tests/crypto:shake256_kat",
177+
]
178+
lc_states: ["PROD"]
179+
}
180+
{
181+
name: crypto_lib_sphincsplus_stress
182+
desc: '''Check that the implementation of SPHINCS+ is correct.
183+
184+
Run SPHINCS+ and compare the output against the test vector.
185+
'''
186+
stage: N.A.
187+
si_stage: SV3
188+
tests: []
189+
bazel: [
190+
"//sw/device/tests/crypto:sphincsplus_kat",
109191
]
110192
lc_states: ["PROD"]
111193
}

0 commit comments

Comments
 (0)