Skip to content

Commit b77cc98

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 3d7dbf3 commit b77cc98

File tree

1 file changed

+113
-32
lines changed

1 file changed

+113
-32
lines changed

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

Lines changed: 113 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,68 @@
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:hmac_sha256_kat",
95+
"//sw/device/tests/crypto/cryptotest:hmac_sha384_kat",
96+
"//sw/device/tests/crypto/cryptotest:hmac_sha512_kat",
97+
]
98+
lc_states: ["PROD"]
99+
}
100+
{
101+
name: crypto_lib_kmac_stress
102+
desc: '''Check that KMAC works correctly.
103+
104+
Run KMAC and compare the output against
105+
the wycheproof test vector.
106+
'''
107+
stage: N.A.
108+
si_stage: SV3
109+
tests: []
110+
bazel: [
111+
"//sw/device/tests/crypto:kmac_functest_hardcoded",
112+
"//sw/device/tests/crypto/cryptotest:kmac_kat",
65113
]
66114
lc_states: ["PROD"]
67115
}
@@ -72,6 +120,7 @@
72120
Run the follow operations and compare the result against the NIST test vector:
73121
- RSA signature.
74122
- RSA signature verification.
123+
- RSA encryption and decryption.
75124
With the keys sizes 2048, 3072 and 4096 bits.
76125
'''
77126
stage: N.A.
@@ -85,27 +134,59 @@
85134
"//sw/device/tests/crypto:rsa_3072_signature_functest",
86135
"//sw/device/tests/crypto:rsa_4096_encryption_functest",
87136
"//sw/device/tests/crypto:rsa_4096_signature_functest",
137+
"//sw/device/tests/crypto/cryptotest:rsa_kat",
88138
]
89139
lc_states: ["PROD"]
90140
}
91141
{
92-
name: crypto_lib_aes_stress
93-
desc: '''Check that the aes implementation is correct.
142+
name: crypto_lib_rsa_key_gen_stress
143+
desc: '''Check that the implementation of RSA key generation is correct.
94144

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

0 commit comments

Comments
 (0)