Skip to content

Commit 1882496

Browse files
committed
crypto: psa_crypto: mark expected_shared_secret as __unused
Mark expected_shared_secret as __unused so the variable is always defined but does not trigger compiler warnings when CONFIG_TEST_WRAPPED_KEYS is enabled and the value is not referenced. This aligns with Zephyr coding conventions for conditionally used constants and avoids build errors in tests compiled with -Werror. Signed-off-by: Aasim Shaik <[email protected]>
1 parent 43c55ef commit 1882496

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

tests/crypto/psa_crypto/src/key_agreement.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,11 @@ static const uint8_t server_public_key[] = {
2828
0x8D, 0x49, 0x85, 0x8C, 0x7A, 0x9F, 0xC1, 0x46, 0xDA, 0xCC, 0x96,
2929
0xEF, 0x6E, 0xD4, 0xDA, 0x71, 0xBF, 0xED, 0x32, 0x0D, 0x76,
3030
};
31-
#if !IS_ENABLE(CONFIG_TEST_WRAPPED_KEYS)
32-
static const uint8_t expected_shared_secret[] = {
33-
0xF2, 0xE6, 0x0E, 0x1C, 0xB7, 0x64, 0xBC, 0x48, 0xF2, 0x9D, 0xBB,
34-
0x12, 0xFB, 0x12, 0x17, 0x31, 0x32, 0x1D, 0x79, 0xAF, 0x0A, 0x9F,
35-
0xAB, 0xAD, 0x34, 0x05, 0xA2, 0x07, 0x39, 0x9C, 0x5F, 0x15,
36-
};
37-
#endif
31+
static const uint8_t expected_shared_secret[] __unused = {
32+
0xF2, 0xE6, 0x0E, 0x1C, 0xB7, 0x64, 0xBC, 0x48, 0xF2, 0x9D, 0xBB,
33+
0x12, 0xFB, 0x12, 0x17, 0x31, 0x32, 0x1D, 0x79, 0xAF, 0x0A, 0x9F,
34+
0xAB, 0xAD, 0x34, 0x05, 0xA2, 0x07, 0x39, 0x9C, 0x5F, 0x15,
35+
};
3836
ZTEST(psa_crypto_test, test_key_agreement_ecdh_25519)
3937
{
4038
uint8_t shared_secret_buf[32];

0 commit comments

Comments
 (0)