Skip to content

Commit 36b8787

Browse files
authored
Merge pull request #397 from shrutig-arm/main
Crypto v1.2.1 compliance suite
2 parents cf1d302 + e1e3e9c commit 36b8787

38 files changed

+1701
-133
lines changed

api-tests/dev_apis/README.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ This test suite is not a substitute for design verification. To review the test
1414
For more information on the architecture test suite framework and methodology to run the tests, refer to the [Validation Methodology](../docs/Arm_PSA_APIs_Arch_Test_Validation_Methodology.pdf) document.
1515

1616
## This release
17-
- Code Quality : REL v1.7
17+
- Code Quality: REL v1.8
1818
- This release contains following API tests: <br />
1919

2020
| Test Category | Specification Version |
2121
|--------------------------|--------------------------------------|
22-
| Crypto <br />Crypto PAKE | [Crypto API 1.1.0](https://arm-software.github.io/psa-api/crypto/) <br />[Crypto API 1.2 PAKE Extension](https://arm-software.github.io/psa-api/crypto/1.2/ext-pake/) |
22+
| Crypto | [Crypto API 1.2.1](https://arm-software.github.io/psa-api/crypto/) |
2323
| Storage (PS and ITS) | [Storage API 1.0.0](https://arm-software.github.io/psa-api/storage/) |
2424
| Attestation | [Attestation API 1.0.2](https://arm-software.github.io/psa-api/attestation/) |
2525

26-
- PAKE and PBKDF2 TestSuites have been validated against [Oberon PSA Crypto 1.3.2](https://www.oberon.ch/products/oberon-psa-crypto/)
27-
26+
- PAKE and PBKDF2 Test suites have been validated against [Oberon PSA Crypto 1.3.2](https://www.oberon.ch/products/oberon-psa-crypto/)
27+
- Crypto v1.1.0 to v1.2.1 compliance suite has been validated with [Oberon PSA Crypto 1.3.4](https://www.oberon.ch/products/oberon-psa-crypto/)
2828

2929

3030
## Release Tags
@@ -33,6 +33,7 @@ For more information on the architecture test suite framework and methodology to
3333

3434
| Release version | Release tag | Crypto API | Storage API | Attestation API |
3535
|-----------------|---------------|----------------|-----------------|---------------------|
36+
| REL v1.8 | [v25.02_API1.8_CRYPTO_1.2.1](https://github.com/ARM-software/psa-arch-tests/tree/v25.02_API1.8_CRYPTO_1.2.1/api-tests/dev_apis) | 1.2.1 | 1.0.0 | 1.0.2 |
3637
| REL v1.7 | [v24.10_API1.7_CRYPTO_PAKE](https://github.com/ARM-software/psa-arch-tests/tree/v24.10_API1.7_CRYPTO_PAKE/api-tests/dev_apis) | 1.1.0 <br /> 1.2 (PAKE Extension)| 1.1.0 | 1.0.2|
3738
| REL v1.6 | [v24.03_API1.6_CRYPTO_1.1.0](https://github.com/ARM-software/psa-arch-tests/tree/v24.03_API1.6_CRYPTO_1.1.0/api-tests/dev_apis) | 1.1.0 | 1.0.0 | 1.0.2 |
3839
| REL v1.5 | [v23.06_API1.5_ADAC_EAC](https://github.com/ARM-software/psa-arch-tests/tree/v23.06_API1.5_ADAC_EAC/api-tests/dev_apis) | 1.0.1 | 1.0.0 | 1.0.2 |
@@ -89,7 +90,7 @@ To build the test suite for your target platform, execute the following commands
8990
- -DWATCHDOG_AVAILABLE=<0|1>: Test harness may require to access watchdog timer to recover system hang. 0 means skip watchdog programming in the test suite and 1 means program the watchdog. Default is 1. Note, watchdog must be available for the tests which check the API behaviour on the system reset.
9091
- -DSUITE_TEST_RANGE="<test_start_number>;<test_end_number>" is to select range of tests for build. All tests under -DSUITE are considered by default if not specified.
9192
- -DTFM_PROFILE=<profile_small/profile_medium> is to work with TFM defined Profile Small/Medium definitions. Supported values are profile_small and profile_medium. Default profile is profile_large.<br />
92-
- -DSPEC_VERSION=<spec_version> is test suite specification version. Which will build for given specified spec_version. Supported values for CRYPTO test suite are 1.0-BETA1, 1.0-BETA2, 1.0-BETA3 , 1.0.0, 1.0.1, 1.1.0, for INITIAL_ATTESATATION test suite are 1.0-BETA0, 1.0.0, 1.0.1, 1.0.2, for STORAGE, INTERNAL_TRUSTED_STORAGE, PROTECTED_STORAGE test suite are 1.0-BETA2, 1.0 . Default is empty. <br />
93+
- -DSPEC_VERSION=<spec_version> is test suite specification version. Which will build for given specified spec_version. Supported values for CRYPTO test suite are 1.0-BETA1, 1.0-BETA2, 1.0-BETA3 , 1.0.0, 1.0.1, 1.1.0, for INITIAL_ATTESTATION test suite are 1.0-BETA0, 1.0.0, 1.0.1, 1.0.2, for STORAGE, INTERNAL_TRUSTED_STORAGE, PROTECTED_STORAGE test suite are 1.0-BETA2, 1.0 . Default is empty. <br />
9394
If -DSPEC_VERSION option is not given it will build for latest version of testsuite.
9495
For every spec version corresponds test list will be in spec_version_testsuite.db file in api-tests/dev_apis/test_suite_name/ folder.
9596
- -DCOMPILER_NAME=<compiler_name> Name to be used for selecting a compiler. It defaults to gcc. <br />
@@ -151,4 +152,4 @@ Arm PSA test suite is distributed under Apache v2.0 License.
151152

152153
--------------
153154

154-
*Copyright (c) 2018-2024, Arm Limited and Contributors. All rights reserved.*
155+
*Copyright (c) 2018-2025, Arm Limited and Contributors. All rights reserved.*

api-tests/dev_apis/crypto/common/test_crypto_common.c

+127-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file
2-
* Copyright (c) 2020-2024, Arm Limited or its affiliates. All rights reserved.
2+
* Copyright (c) 2020-2025, Arm Limited or its affiliates. All rights reserved.
33
* SPDX-License-Identifier : Apache-2.0
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -240,6 +240,12 @@ const uint8_t ec_keypair_deterministic[] = {
240240
0xab, 0x45, 0x43, 0x57, 0x12, 0x64, 0x9c, 0xb3, 0x0b, 0xbd, 0xda, 0xc4, 0x91, 0x97, 0xee, 0xbf,
241241
0x27, 0x40, 0xff, 0xc7, 0xf8, 0x74, 0xd9, 0x24, 0x4c, 0x34, 0x60, 0xf5, 0x4f, 0x32, 0x2d, 0x3a};
242242

243+
const uint8_t aes_mmo_hash_input[] = {0x83, 0xFE, 0xD3, 0x40, 0x7A, 0x93, 0x97, 0x23, 0xA5, 0xC6,
244+
0x39, 0xB2, 0x69, 0x16, 0xD5, 0x05};
245+
246+
const uint8_t aes_mmo_hash[] = {0x66, 0xB6, 0x90, 0x09, 0x81, 0xE1, 0xEE, 0x3C, 0xA4, 0x20, 0x6B,
247+
0x6B, 0x86, 0x1C, 0x02, 0xBB};
248+
243249
const uint8_t md2_hash[] = {
244250
0x8c, 0x9c, 0x17, 0x66, 0x5d, 0x25, 0xb3, 0x5f, 0xc4, 0x13, 0xc4, 0x18, 0x05, 0xc6, 0x79, 0xcf};
245251

@@ -481,18 +487,41 @@ const uint8_t aead_aria_cipher_test[] = {0x63, 0xC7, 0x70, 0xA6, 0xF3, 0x58, 0x3
481487
#endif
482488

483489
#ifdef ARCH_TEST_TWISTED_EDWARDS
484-
const uint8_t eddsa_25519ph_keypair[] = {0x4c, 0xcd, 0x08, 0x9b, 0x28, 0xff, 0x96, 0xda, 0x9d,
490+
const uint8_t eddsa_25519_keypair[] = {0x4c, 0xcd, 0x08, 0x9b, 0x28, 0xff, 0x96, 0xda, 0x9d,
485491
0xb6, 0xc3, 0x46, 0xec, 0x11, 0x4e, 0x0f, 0x5b, 0x8a, 0x31, 0x9f, 0x35, 0xab, 0xa6, 0x24, 0xda,
486492
0x8c, 0xf6, 0xed, 0x4f, 0xb8, 0xa6, 0xfb};
487-
const uint8_t eddsa_25519ph_pubkey[] = {0x3d, 0x40, 0x17, 0xc3, 0xe8, 0x43, 0x89, 0x5a, 0x92,
493+
const uint8_t eddsa_25519_pubkey[] = {0x3d, 0x40, 0x17, 0xc3, 0xe8, 0x43, 0x89, 0x5a, 0x92,
488494
0xb7, 0x0a, 0xa7, 0x4d, 0x1b, 0x7e, 0xbc, 0x9c, 0x98, 0x2c, 0xcf, 0x2e, 0xc4, 0x96, 0x8c, 0xc0,
489495
0xcd, 0x55, 0xf1, 0x2a, 0xf4, 0x66, 0x0c};
490-
const uint8_t eddsa_25519ph_signature[] = {0x92, 0xa0, 0x09, 0xa9, 0xf0, 0xd4, 0xca, 0xb8, 0x72,
496+
const uint8_t eddsa_25519_signature[] = {0x92, 0xa0, 0x09, 0xa9, 0xf0, 0xd4, 0xca, 0xb8, 0x72,
491497
0x0e, 0x82, 0x0b, 0x5f, 0x64, 0x25, 0x40, 0xa2, 0xb2, 0x7b, 0x54, 0x16, 0x50, 0x3f, 0x8f, 0xb3,
492498
0x76, 0x22, 0x23, 0xeb, 0xdb, 0x69, 0xda, 0x08, 0x5a, 0xc1, 0xe4, 0x3e, 0x15, 0x99, 0x6e, 0x45,
493499
0x8f, 0x36, 0x13, 0xd0, 0xf1, 0x1d, 0x8c, 0x38, 0x7b, 0x2e, 0xae, 0xb4, 0x30, 0x2a, 0xee, 0xb0,
494500
0x0d, 0x29, 0x16, 0x12, 0xbb, 0x0c, 0x00};
495-
const uint8_t eddsa_25519ph_message[] = {0x72};
501+
const uint8_t eddsa_25519_message[] = {0x72};
502+
503+
const uint8_t eddsa_25519ph_keypair[] = {0x83, 0x3f, 0xe6, 0x24, 0x09, 0x23, 0x7b, 0x9d, 0x62,
504+
0xec, 0x77, 0x58, 0x75, 0x20, 0x91, 0x1e, 0x9a, 0x75, 0x9c, 0xec, 0x1d, 0x19, 0x75, 0x5b, 0x7d,
505+
0xa9, 0x01, 0xb9, 0x6d, 0xca, 0x3d, 0x42};
506+
507+
const uint8_t eddsa_25519ph_pubkey[] = {0xec, 0x17, 0x2b, 0x93, 0xad, 0x5e, 0x56, 0x3b, 0xf4,
508+
0x93, 0x2c, 0x70, 0xe1, 0x24, 0x50, 0x34, 0xc3, 0x54, 0x67, 0xef, 0x2e, 0xfd, 0x4d, 0x64, 0xeb,
509+
0xf8, 0x19, 0x68, 0x34, 0x67, 0xe2, 0xbf};
510+
511+
const uint8_t eddsa_25519ph_message[] = {0x61, 0x62, 0x63};
512+
513+
const uint8_t eddsa_25519ph_signature[] = {0x98, 0xa7, 0x02, 0x22, 0xf0, 0xb8, 0x12, 0x1a, 0xa9,
514+
0xd3, 0x0f, 0x81, 0x3d, 0x68, 0x3f, 0x80, 0x9e, 0x46, 0x2b, 0x46, 0x9c, 0x7f, 0xf8, 0x76, 0x39,
515+
0x49, 0x9b, 0xb9, 0x4e, 0x6d, 0xae, 0x41, 0x31, 0xf8, 0x50, 0x42, 0x46, 0x3c, 0x2a, 0x35, 0x5a,
516+
0x20, 0x03, 0xd0, 0x62, 0xad, 0xf5, 0xaa, 0xa1, 0x0b, 0x8c, 0x61, 0xe6, 0x36, 0x06, 0x2a, 0xaa,
517+
0xd1, 0x1c, 0x2a, 0x26, 0x08, 0x34, 0x06};
518+
519+
const uint8_t sha_512_hash_eddsa519[] = {0xdd, 0xaf, 0x35, 0xa1, 0x93, 0x61, 0x7a, 0xba, 0xcc,
520+
0x41, 0x73, 0x49, 0xae, 0x20, 0x41, 0x31, 0x12, 0xe6, 0xfa, 0x4e, 0x89, 0xa9, 0x7e, 0xa2, 0x0a,
521+
0x9e, 0xee, 0xe6, 0x4b, 0x55, 0xd3, 0x9a, 0x21, 0x92, 0x99, 0x2a, 0x27, 0x4f, 0xc1, 0xa8, 0x36,
522+
0xba, 0x3c, 0x23, 0xa3, 0xfe, 0xeb, 0xbd, 0x45, 0x4d, 0x44, 0x23, 0x64, 0x3c, 0xe8, 0x0e, 0x2a,
523+
0x9a, 0xc9, 0x4f, 0xa5, 0x4c, 0xa4, 0x9f};
524+
496525

497526
const uint8_t eddsa_448_keypair[] = {0xc4, 0xea, 0xb0, 0x5d, 0x35, 0x70, 0x07, 0xc6, 0x32, 0xf3,
498527
0xdb, 0xb4, 0x84, 0x89, 0x92, 0x4d, 0x55, 0x2b, 0x08, 0xfe, 0x0c, 0x35, 0x3a, 0x0d, 0x4a, 0x1f,
@@ -514,7 +543,7 @@ const uint8_t eddsa_448_signature[] = {0x26, 0xb8, 0xf9, 0x17, 0x27, 0xbd, 0x62,
514543
#endif
515544

516545
const uint8_t nonce[] = {
517-
0x00, 0x41, 0x2B, 0x4E, 0xA9, 0xCD, 0xBE, 0x3C, 0x96, 0x96, 0x76, 0x6C, 0xFA};
546+
0x00, 0x41, 0x2B, 0x4E, 0xA9, 0xCD, 0xBE, 0x3C, 0x96, 0x96, 0x76, 0x6C, 0xFA};
518547

519548
const uint8_t additional_data[] = {
520549
0x40, 0xa2, 0x7c, 0x1d, 0x1e, 0x23, 0xea, 0x3d, 0xbe, 0x80, 0x56, 0xb2, 0x77, 0x48, 0x61, 0xa4,
@@ -726,6 +755,98 @@ const uint8_t spake2p_pub_key[] = {
726755
0xEF, 0x31, 0xDF, 0xAA, 0x90, 0x3B, 0x91, 0xD1, 0xFA, 0xEA, 0x70, 0x93, 0xD8, 0x35, 0x96, 0x6E,
727756
0xFD};
728757

758+
const uint8_t IKM[] = {0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B,
759+
0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B};
760+
761+
const uint8_t kdf_salt[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
762+
0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C};
763+
764+
const uint8_t PRK[] = {0x07, 0x77, 0x09, 0x36, 0x2C, 0x2E, 0x32, 0xDF, 0x0D, 0xDC, 0x3F, 0x0D,
765+
0xC4, 0x7B, 0xBA, 0x63, 0x90, 0xB6, 0xC7, 0x3B, 0xB5, 0x0F, 0x9C, 0x31,
766+
0x22, 0xEC, 0x84, 0x4A, 0xD7, 0xC2, 0xB3, 0xE5};
767+
768+
const uint8_t invalid_prk[] = {0x07, 0xAB, 0x09, 0x36, 0x2C, 0x2E, 0x32, 0xDF, 0x0D, 0xDC, 0x3F,
769+
0x0D, 0xC4, 0x7B, 0xBA, 0x63, 0x90, 0xB6, 0xC7, 0x3B, 0xB5, 0x0F,
770+
0x9C, 0x31, 0x22, 0xEC, 0x84, 0x00, 0xD7, 0xC2, 0xB3, 0xE5};
771+
772+
const uint8_t kdf_info[] = {0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9};
773+
774+
const uint8_t ccm_star_no_tag_key_data[] = {
775+
0x90, 0x92, 0x9a, 0x4b, 0x0a, 0xc6, 0x5b, 0x35, 0x0a, 0xd1, 0x59, 0x16, 0x11, 0xfe, 0x48, 0x29};
776+
777+
const uint8_t ccm_star_no_tag_plaintext[] = {0x4b, 0xfe, 0x4e, 0x35, 0x78, 0x4f, 0x0a, 0x65, 0xb5,
778+
0x45, 0x47, 0x7e, 0x5e, 0x2f, 0x4b, 0xae, 0x0e, 0x1e, 0x6f, 0xa7, 0x17, 0xea, 0xf2, 0xcb};
779+
780+
const uint8_t ccm_star_no_tag_iv[] = {0x5a, 0x8a, 0xa4, 0x85, 0xc3, 0x16, 0xe9, 0x40, 0x3a, 0xff,
781+
0x85, 0x9f, 0xbb};
782+
783+
const uint8_t ccm_star_no_tag_ciphertext[] = {0xa1, 0x6a, 0x2e, 0x74, 0x1f, 0x1c, 0xd9, 0x71, 0x72,
784+
0x85, 0xb6, 0xd8, 0x82, 0xc1, 0xfc, 0x53, 0x65, 0x5e, 0x97, 0x73, 0x76, 0x1a, 0xd6, 0x97};
785+
786+
const uint8_t chacha20_key[] = {
787+
0x1c, 0x92, 0x40, 0xa5, 0xeb, 0x55, 0xd3, 0x8a, 0xf3, 0x33, 0x88, 0x86, 0x04, 0xf6, 0xb5, 0xf0,
788+
0x47, 0x39, 0x17, 0xc1, 0x40, 0x2b, 0x80, 0x09, 0x9d, 0xca, 0x5c, 0xbc, 0x20, 0x70, 0x75, 0xc0};
789+
790+
const uint8_t chacha20_iv[] = {
791+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02};
792+
793+
const uint8_t plaintext_stream_cipher[] = {0x49, 0x74, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x73,
794+
0x65, 0x63, 0x72, 0x65, 0x74, 0x2E};
795+
796+
const uint8_t ciphertext_chacha20[] = {0xdf, 0x2a, 0x1b, 0xaf, 0x8a, 0xcc, 0x1f, 0xf9, 0x25, 0x6d,
797+
0x6b, 0x86, 0xb7, 0x5d, 0xd7};
798+
799+
const uint8_t ciphertext_xchacha20[] = {0x9c, 0xd4, 0xb4, 0x42, 0xb0, 0xd7, 0x1e, 0xe5, 0x00, 0x91,
800+
0x02, 0x6b, 0xe5, 0x74, 0x09};
801+
802+
const uint8_t xchacha20_key[] = {
803+
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
804+
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f};
805+
806+
const uint8_t xchacha20_iv[] = {0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a,
807+
0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x56, 0x57, 0x58};
808+
809+
const uint8_t aead_plaintext[] = {
810+
0x4c, 0x61, 0x64, 0x69, 0x65, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x47, 0x65, 0x6e, 0x74, 0x6c,
811+
0x65, 0x6d, 0x65, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x61, 0x73,
812+
0x73, 0x20, 0x6f, 0x66, 0x20, 0x27, 0x39, 0x39, 0x3a, 0x20, 0x49, 0x66, 0x20, 0x49, 0x20, 0x63,
813+
0x6f, 0x75, 0x6c, 0x64, 0x20, 0x6f, 0x66, 0x66, 0x65, 0x72, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x6f,
814+
0x6e, 0x6c, 0x79, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x74, 0x69, 0x70, 0x20, 0x66, 0x6f, 0x72, 0x20,
815+
0x74, 0x68, 0x65, 0x20, 0x66, 0x75, 0x74, 0x75, 0x72, 0x65, 0x2c, 0x20, 0x73, 0x75, 0x6e, 0x73,
816+
0x63, 0x72, 0x65, 0x65, 0x6e, 0x20, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x69,
817+
0x74, 0x2e};
818+
819+
const uint8_t aead_chacha20_poly1305_nonce[] = {0x07, 0x00, 0x00, 0x00, 0x40, 0x41, 0x42, 0x43,
820+
0x44, 0x45, 0x46, 0x47};
821+
822+
const uint8_t aead_xchacha20_poly1305_nonce[] = {0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
823+
0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57};
824+
825+
const uint8_t aead_add_data[] = {0x50, 0x51, 0x52, 0x53, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6,
826+
0xc7};
827+
828+
const uint8_t aead_chacha20_poly1305_ciphertext[] = {
829+
0xd3, 0x1a, 0x8d, 0x34, 0x64, 0x8e, 0x60, 0xdb, 0x7b, 0x86, 0xaf, 0xbc, 0x53, 0xef, 0x7e, 0xc2,
830+
0xa4, 0xad, 0xed, 0x51, 0x29, 0x6e, 0x08, 0xfe, 0xa9, 0xe2, 0xb5, 0xa7, 0x36, 0xee, 0x62, 0xd6,
831+
0x3d, 0xbe, 0xa4, 0x5e, 0x8c, 0xa9, 0x67, 0x12, 0x82, 0xfa, 0xfb, 0x69, 0xda, 0x92, 0x72, 0x8b,
832+
0x1a, 0x71, 0xde, 0x0a, 0x9e, 0x06, 0x0b, 0x29, 0x05, 0xd6, 0xa5, 0xb6, 0x7e, 0xcd, 0x3b, 0x36,
833+
0x92, 0xdd, 0xbd, 0x7f, 0x2d, 0x77, 0x8b, 0x8c, 0x98, 0x03, 0xae, 0xe3, 0x28, 0x09, 0x1b, 0x58,
834+
0xfa, 0xb3, 0x24, 0xe4, 0xfa, 0xd6, 0x75, 0x94, 0x55, 0x85, 0x80, 0x8b, 0x48, 0x31, 0xd7, 0xbc,
835+
0x3f, 0xf4, 0xde, 0xf0, 0x8e, 0x4b, 0x7a, 0x9d, 0xe5, 0x76, 0xd2, 0x65, 0x86, 0xce, 0xc6, 0x4b,
836+
0x61, 0x16, 0x1a, 0xe1, 0x0b, 0x59, 0x4f, 0x09, 0xe2, 0x6a, 0x7e, 0x90, 0x2e, 0xcb, 0xd0, 0x60,
837+
0x06, 0x91};
838+
839+
const uint8_t aead_xchacha20_poly1305_ciphertext[] = {
840+
0xbd, 0x6d, 0x17, 0x9d, 0x3e, 0x83, 0xd4, 0x3b, 0x95, 0x76, 0x57, 0x94, 0x93, 0xc0, 0xe9, 0x39,
841+
0x57, 0x2a, 0x17, 0x00, 0x25, 0x2b, 0xfa, 0xcc, 0xbe, 0xd2, 0x90, 0x2c, 0x21, 0x39, 0x6c, 0xbb,
842+
0x73, 0x1c, 0x7f, 0x1b, 0x0b, 0x4a, 0xa6, 0x44, 0x0b, 0xf3, 0xa8, 0x2f, 0x4e, 0xda, 0x7e, 0x39,
843+
0xae, 0x64, 0xc6, 0x70, 0x8c, 0x54, 0xc2, 0x16, 0xcb, 0x96, 0xb7, 0x2e, 0x12, 0x13, 0xb4, 0x52,
844+
0x2f, 0x8c, 0x9b, 0xa4, 0x0d, 0xb5, 0xd9, 0x45, 0xb1, 0x1b, 0x69, 0xb9, 0x82, 0xc1, 0xbb, 0x9e,
845+
0x3f, 0x3f, 0xac, 0x2b, 0xc3, 0x69, 0x48, 0x8f, 0x76, 0xb2, 0x38, 0x35, 0x65, 0xd3, 0xff, 0xf9,
846+
0x21, 0xf9, 0x66, 0x4c, 0x97, 0x63, 0x7d, 0xa9, 0x76, 0x88, 0x12, 0xf6, 0x15, 0xc6, 0x8b, 0x13,
847+
0xb5, 0x2e, 0xc0, 0x87, 0x59, 0x24, 0xc1, 0xc7, 0x98, 0x79, 0x47, 0xde, 0xaf, 0xd8, 0x78, 0x0a,
848+
0xcf, 0x49};
849+
729850
/* test inputs */
730851
const uint8_t hash_input = 0xbd;
731852
const uint8_t input_bytes_data[INPUT_BYTES_DATA_LEN] = "abcdefghijklmnop";

api-tests/dev_apis/crypto/common/test_crypto_common.h

+31-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file
2-
* Copyright (c) 2020-2024, Arm Limited or its affiliates. All rights reserved.
2+
* Copyright (c) 2020-2025, Arm Limited or its affiliates. All rights reserved.
33
* SPDX-License-Identifier : Apache-2.0
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -80,6 +80,8 @@ extern const uint8_t sha_256_hash[];
8080
extern const uint8_t sha_256_incorrect_hash[];
8181
extern const uint8_t sha_384_hash[];
8282
extern const uint8_t sha_512_hash[];
83+
extern const uint8_t aes_mmo_hash_input[];
84+
extern const uint8_t aes_mmo_hash[];
8385

8486
extern const uint8_t ecdh_secp_256_r1_prv_key[];
8587
extern const uint8_t ecdh_secp_256_r1_pub_key[];
@@ -98,6 +100,24 @@ extern const uint8_t aead_ciphertext_5[AEAD_CIPHERTEXT_LEN_5];
98100
extern const uint8_t aead_ciphertext_6[AEAD_CIPHERTEXT_LEN_6];
99101
extern const uint8_t aead_ciphertext_7[AEAD_CIPHERTEXT_LEN_7];
100102

103+
extern const uint8_t chacha20_key[];
104+
extern const uint8_t chacha20_iv[];
105+
extern const uint8_t plaintext_stream_cipher[];
106+
extern const uint8_t ciphertext_chacha20[];
107+
extern const uint8_t xchacha20_key[];
108+
extern const uint8_t xchacha20_iv[];
109+
extern const uint8_t ciphertext_xchacha20[];
110+
extern const uint8_t aead_plaintext[];
111+
extern const uint8_t aead_chacha20_poly1305_nonce[];
112+
extern const uint8_t aead_xchacha20_poly1305_nonce[];
113+
extern const uint8_t aead_add_data[];
114+
extern const uint8_t aead_chacha20_poly1305_ciphertext[];
115+
extern const uint8_t aead_xchacha20_poly1305_ciphertext[];
116+
extern const uint8_t ccm_star_no_tag_iv[];
117+
extern const uint8_t ccm_star_no_tag_plaintext[];
118+
extern const uint8_t ccm_star_no_tag_ciphertext[];
119+
extern const uint8_t ccm_star_no_tag_key_data[];
120+
101121
extern const uint8_t hash_input;
102122
extern const uint8_t input_bytes_data[INPUT_BYTES_DATA_LEN];
103123
extern const uint8_t input_salt[INPUT_SALT_LEN];
@@ -109,6 +129,11 @@ extern uint64_t input_rounds;
109129
extern const uint8_t userid[USER_ID_LEN];
110130
extern const uint8_t peerid[PEER_ID_LEN];
111131
extern const uint8_t context[CONTEXT_LEN];
132+
extern const uint8_t IKM[];
133+
extern const uint8_t kdf_salt[];
134+
extern const uint8_t kdf_info[];
135+
extern const uint8_t PRK[];
136+
extern const uint8_t invalid_prk[];
112137

113138
extern const unsigned char iv[];
114139

@@ -173,6 +198,11 @@ extern const uint8_t eddsa_25519ph_keypair[];
173198
extern const uint8_t eddsa_25519ph_pubkey[];
174199
extern const uint8_t eddsa_25519ph_message[];
175200
extern const uint8_t eddsa_25519ph_signature[];
201+
extern const uint8_t eddsa_25519_keypair[];
202+
extern const uint8_t eddsa_25519_pubkey[];
203+
extern const uint8_t eddsa_25519_message[];
204+
extern const uint8_t eddsa_25519_signature[];
205+
extern const uint8_t sha_512_hash_eddsa519[];
176206

177207
extern const uint8_t eddsa_448_keypair[];
178208
extern const uint8_t eddsa_448_pubkey[];

api-tests/dev_apis/crypto/test_c006/test_data.h

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file
2-
* Copyright (c) 2019-2023, Arm Limited or its affiliates. All rights reserved.
2+
* Copyright (c) 2019-2023, 2025, Arm Limited or its affiliates. All rights reserved.
33
* SPDX-License-Identifier : Apache-2.0
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -181,4 +181,19 @@ static const test_data check1[] = {
181181
.expected_hash_length = 64,
182182
.expected_status = PSA_ERROR_NOT_SUPPORTED,
183183
},
184+
185+
#ifdef ARCH_TEST_AES_MMO_ZIGBEE
186+
{
187+
.test_desc = "Test psa_hash_compute with AES MMO ZIGBEE algorithm\n",
188+
.alg = PSA_ALG_AES_MMO_ZIGBEE,
189+
.input = aes_mmo_hash_input,
190+
.input_length = sizeof(aes_mmo_hash_input),
191+
.hash = expected_output,
192+
.hash_size = BUFFER_SIZE,
193+
.expected_hash = aes_mmo_hash,
194+
.expected_hash_length = 16,
195+
.expected_status = PSA_SUCCESS,
196+
},
197+
#endif
198+
184199
};

api-tests/dev_apis/crypto/test_c013/test_data.h

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file
2-
* Copyright (c) 2018-2020, Arm Limited or its affiliates. All rights reserved.
2+
* Copyright (c) 2018-2020, 2025, Arm Limited or its affiliates. All rights reserved.
33
* SPDX-License-Identifier : Apache-2.0
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -157,4 +157,16 @@ static const test_data check1[] = {
157157
.expected_status = PSA_ERROR_INVALID_SIGNATURE,
158158
},
159159
#endif
160+
161+
#ifdef ARCH_TEST_AES_MMO_ZIGBEE
162+
{
163+
.test_desc = "Test psa_hash_verify with AES MMO ZIGBEE algorithm\n",
164+
.alg = PSA_ALG_SHA_512,
165+
.input = aes_mmo_hash_input,
166+
.input_length = sizeof(aes_mmo_hash_input),
167+
.hash = aes_mmo_hash,
168+
.hash_length = 16,
169+
.expected_status = PSA_SUCCESS,
170+
}
171+
#endif
160172
};

0 commit comments

Comments
 (0)