Skip to content

Commit 8de7aa8

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 03a6058 commit 8de7aa8

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,67 @@
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 and Sha512 and compare the digist against
55+
the NIST test vector.
5756
'''
5857
stage: N.A.
5958
si_stage: SV3
6059
tests: []
6160
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",
61+
"//sw/device/tests/crypto:sha256_functest",
62+
"//sw/device/tests/crypto:sha384_functest",
63+
"//sw/device/tests/crypto:sha512_functest",
64+
"//sw/device/tests/crypto:hkdf_functest",
65+
"//sw/device/tests/crypto:otcrypto_hash_test",
66+
"//sw/device/tests/crypto:otcrypto_export_test"
67+
"//sw/device/tests/crypto/cryptotest:sha256_kat",
68+
"//sw/device/tests/crypto/cryptotest:sha384_kat",
69+
"//sw/device/tests/crypto/cryptotest:sha3_224_kat",
70+
"//sw/device/tests/crypto/cryptotest:sha3_256_kat",
71+
"//sw/device/tests/crypto/cryptotest:sha3_384_kat",
72+
"//sw/device/tests/crypto/cryptotest:sha3_512_kat",
73+
"//sw/device/tests/crypto/cryptotest:sha512_kat",
74+
]
75+
lc_states: ["PROD"]
76+
}
77+
{
78+
name: crypto_lib_hmac_stress
79+
desc: '''Check that HMAC works correctly.
80+
81+
Run HMAC Sha256, Sha384 and Sha512 and compare the output against
82+
the NIST test vector.
83+
'''
84+
stage: N.A.
85+
si_stage: SV3
86+
tests: []
87+
bazel: [
88+
"//sw/device/tests/crypto:hmac_sha256_functest",
89+
"//sw/device/tests/crypto:hmac_sha384_functest",
90+
"//sw/device/tests/crypto:hmac_sha512_functest",
91+
"//sw/device/tests/crypto:hmac_functest",
92+
"//sw/device/tests/crypto:hmac_multistream_functest",
93+
"//sw/device/tests/crypto/cryptotest:hmac_sha256_kat",
94+
"//sw/device/tests/crypto/cryptotest:hmac_sha384_kat",
95+
"//sw/device/tests/crypto/cryptotest:hmac_sha512_kat",
96+
]
97+
lc_states: ["PROD"]
98+
}
99+
{
100+
name: crypto_lib_kmac_stress
101+
desc: '''Check that KMAC works correctly.
102+
103+
Run KMAC and compare the output against
104+
the wycheproof test vector.
105+
'''
106+
stage: N.A.
107+
si_stage: SV3
108+
tests: []
109+
bazel: [
110+
"//sw/device/tests/crypto:kmac_functest_hardcoded",
111+
"//sw/device/tests/crypto/cryptotest:kmac_kat",
65112
]
66113
lc_states: ["PROD"]
67114
}
@@ -72,6 +119,7 @@
72119
Run the follow operations and compare the result against the NIST test vector:
73120
- RSA signature.
74121
- RSA signature verification.
122+
- RSA encryption and decryption.
75123
With the keys sizes 2048, 3072 and 4096 bits.
76124
'''
77125
stage: N.A.
@@ -85,27 +133,61 @@
85133
"//sw/device/tests/crypto:rsa_3072_signature_functest",
86134
"//sw/device/tests/crypto:rsa_4096_encryption_functest",
87135
"//sw/device/tests/crypto:rsa_4096_signature_functest",
136+
"//sw/device/tests/crypto/cryptotest:rsa_kat",
88137
]
89138
lc_states: ["PROD"]
90139
}
91140
{
92-
name: crypto_lib_aes_stress
93-
desc: '''Check that the aes implementation is correct.
141+
name: crypto_lib_rsa_key_gen_stress
142+
desc: '''Check that the implementation of RSA key generation is correct.
94143

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.
144+
Generate RSA key pairs with sizes 2048, 3072 and 4096 bits.
145+
The key generation should take an appropriate time based on the key size and the
146+
platform (FPGA or Silicon).
147+
For each key pair:
148+
- Sign a message with the private key.
149+
- Verify the signature with the public key.
100150
'''
101151
stage: N.A.
102152
si_stage: SV3
103153
tests: []
104154
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"
155+
"//sw/device/tests/crypto:rsa_2048_keygen_functest",
156+
"//sw/device/tests/crypto:rsa_3072_keygen_functest",
157+
"//sw/device/tests/crypto:rsa_4096_keygen_functest",
158+
]
159+
lc_states: ["PROD"]
160+
}
161+
{
162+
name: crypto_lib_shake_stress
163+
desc: '''Check that the implementation of SHAKE is correct.
164+
165+
Run CShake, Shake128 and Shake256 and compare the output against
166+
the NIST test vector.
167+
'''
168+
stage: N.A.
169+
si_stage: SV3
170+
tests: []
171+
bazel: [
172+
"//sw/device/tests/crypto:cshake_kat",
173+
"//sw/device/tests/crypto:shake128_kat",
174+
"//sw/device/tests/crypto:shake256_kat",
175+
]
176+
lc_states: ["PROD"]
177+
}
178+
{
179+
name: crypto_lib_sphincsplus_stress
180+
desc: '''Check that the implementation of SPHINCS+ is correct.
181+
182+
Run SPHINCS+ and compare the output against the test vector.
183+
'''
184+
stage: N.A.
185+
si_stage: SV3
186+
tests: []
187+
bazel: [
188+
"//sw/device/tests/crypto:cshake_kat",
189+
"//sw/device/tests/crypto:shake128_kat",
190+
"//sw/device/tests/crypto:shake256_kat",
109191
]
110192
lc_states: ["PROD"]
111193
}

0 commit comments

Comments
 (0)