Skip to content

Commit

Permalink
Merge pull request #148 from jaypit02/master
Browse files Browse the repository at this point in the history
Changes for v1.0 release
  • Loading branch information
kotegowder authored Feb 26, 2020
2 parents 65b2f7a + 6c3b808 commit 541cf68
Show file tree
Hide file tree
Showing 109 changed files with 4,096 additions and 652 deletions.
114 changes: 68 additions & 46 deletions api-tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#/** @file
# * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
# * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
# * SPDX-License-Identifier : Apache-2.0
# *
# * Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -31,6 +31,7 @@ get_filename_component(PSA_ROOT_DIR . ABSOLUTE)
list(APPEND CMAKE_MODULE_PATH ${PSA_ROOT_DIR}/tools/cmake)
include("common/Utils")
include(${PSA_ROOT_DIR}/tools/cmake/common/CMakeSettings.cmake)
include(${PSA_ROOT_DIR}/tools/cmake/common/CMakeExternal.cmake)

# list of supported suites
list(APPEND PSA_SUITES
Expand Down Expand Up @@ -109,6 +110,8 @@ string(TOLOWER ${SUITE} SUITE_LOWER)
_get_sub_dir_list(PSA_TARGET_LIST ${PSA_ROOT_DIR}/platform/targets)
if(NOT ${TARGET} IN_LIST PSA_TARGET_LIST)
message(FATAL_ERROR "[PSA] : Error: Unspported value for -DTARGET=, supported targets are : ${PSA_TARGET_LIST}")
else()
message(STATUS "[PSA] : TARGET is set to ${TARGET}")
endif()

# Check for the presence of required test suite directories
Expand All @@ -128,14 +131,18 @@ endif()
# Check for valid suite cmake argument passed
if(NOT ${SUITE} IN_LIST PSA_SUITES)
message(FATAL_ERROR "[PSA] : Error: Unsupported value for -DSUITE=, select one from supported suites which are : ${PSA_SUITES}")
else()
message(STATUS "[PSA] : SUITE is set to ${SUITE}")
endif()

# Project variables
set(PSA_TARGET_PRE_BUILD psa_pre_build)
set(PSA_TARGET_GENERATE_DATABASE_PRE psa_generate_database_prerequisite)
set(PSA_TARGET_GENERATE_DATABASE psa_generate_database)
set(PSA_TARGET_GENERATE_DATABASE_POST psa_generate_database_cleanup)
set(PSA_TARGET_QCBOR psa_qcbor)
if(${SUITE} STREQUAL "INITIAL_ATTESTATION")
set(PSA_TARGET_QCBOR psa_qcbor)
endif()
set(PSA_TARGET_PAL_NSPE_LIB pal_nspe)
set(PSA_TARGET_VAL_NSPE_LIB val_nspe)
set(PSA_TARGET_TEST_COMBINE_LIB test_combine)
Expand All @@ -158,17 +165,16 @@ set(DATABASE_TABLE_NAME target_database)
set(DATABASE_TABLE_SECTION_NAME "NOSECTION")
set(TARGET_HEADER_GEN_INCLUDE_PATHS "${PSA_ROOT_DIR}/val/nspe|${PSA_ROOT_DIR}/val/common|${PSA_ROOT_DIR}/platform/targets/${TARGET}/nspe/common|${PSA_ROOT_DIR}/platform/targets/${TARGET}/nspe/crypto")
set(TESTSUITE_DB ${PSA_SUITE_DIR}/testsuite.db)
if(${SUITE} STREQUAL "INITIAL_ATTESTATION")
set(PSA_QCBOR_GIT_REPO_LINK https://github.com/laurencelundblade/QCBOR.git)
set(PSA_QCBOR_INCLUDE_PATH ${CMAKE_CURRENT_BINARY_DIR}/src/psa_qcbor/inc)
endif()
set(PSA_TESTLIST_FILE ${CMAKE_CURRENT_BINARY_DIR}/testlist.txt)
set(PSA_TEST_ENTRY_LIST_INC ${CMAKE_CURRENT_BINARY_DIR}/test_entry_list.inc)
set(PSA_TEST_ENTRY_FUN_DECLARE_INC ${CMAKE_CURRENT_BINARY_DIR}/test_entry_fn_declare_list.inc)
set(PSA_CLIENT_TEST_LIST_DELCARE_INC ${CMAKE_CURRENT_BINARY_DIR}/client_tests_list_declare.inc)
set(PSA_CLIENT_TEST_LIST_INC ${CMAKE_CURRENT_BINARY_DIR}/client_tests_list.inc)
set(PSA_SERVER_TEST_LIST_DECLARE_INC ${CMAKE_CURRENT_BINARY_DIR}/server_tests_list_declare.inc)
set(PSA_SERVER_TEST_LIST ${CMAKE_CURRENT_BINARY_DIR}/server_tests_list.inc)
if(${SUITE} STREQUAL "INITIAL_ATTESTATION")
set(PSA_QCBOR_INCLUDE_PATH ${CMAKE_CURRENT_BINARY_DIR}/${PSA_TARGET_QCBOR}/inc)
endif()

# Validity check for required files for a given suite
if(NOT DEFINED PSA_${SUITE}_FILES)
Expand All @@ -192,6 +198,8 @@ endforeach()
if(NOT DEFINED TOOLCHAIN)
set(TOOLCHAIN "GNUARM" CACHE INTERNAL "Compiler used" FORCE)
message(STATUS "[PSA] : Defaulting compiler to ${TOOLCHAIN}")
else()
message(STATUS "[PSA] : TOOLCHAIN is set to ${TOOLCHAIN}")
endif()

if(${TOOLCHAIN} STREQUAL "ARMCLANG" OR ${TOOLCHAIN} STREQUAL "GNUARM")
Expand All @@ -203,65 +211,99 @@ if(${TOOLCHAIN} STREQUAL "ARMCLANG" OR ${TOOLCHAIN} STREQUAL "GNUARM")
message(FATAL_ERROR "[PSA] : Error: Unsupported value for -DCPU_ARCH=, supported CPU arch are : ${PSA_CPU_ARCH_SUPPORT}")
endif()
endif()
message(STATUS "[PSA] : CPU_ARCH is set to ${CPU_ARCH}")
endif()

# Check for VERBOSE
if(NOT DEFINED VERBOSE)
set(VERBOSE 3 CACHE INTERNAL "Default VERBOSE value" FORCE)
message(STATUS "[PSA] : Defaulting to VERBOSE=${VERBOSE}")
message(STATUS "[PSA] : Defaulting VERBOSE to ${VERBOSE}")
else()
if(NOT ${VERBOSE} IN_LIST PSA_VERBOSE_OPTIONS)
message(FATAL_ERROR "[PSA] : Error: Unspported value for -DVERBOSE=, supported values are : ${PSA_VERBOSE_OPTIONS}")
endif()
message(STATUS "[PSA] : VERBOSE is set to ${VERBOSE}")
endif()

# Check for PLATFORM_PSA_ISOLATION_LEVEL
if(NOT DEFINED PLATFORM_PSA_ISOLATION_LEVEL)
set(PLATFORM_PSA_ISOLATION_LEVEL 3 CACHE INTERNAL "Default PLATFORM_PSA_ISOLATION_LEVEL value" FORCE)
message(STATUS "[PSA] : Defaulting to PLATFORM_PSA_ISOLATION_LEVEL=${PLATFORM_PSA_ISOLATION_LEVEL}")
if(${SUITE} STREQUAL "IPC")
message(STATUS "[PSA] : Defaulting PLATFORM_PSA_ISOLATION_LEVEL to ${PLATFORM_PSA_ISOLATION_LEVEL}")
endif()
else()
if(NOT ${PLATFORM_PSA_ISOLATION_LEVEL} IN_LIST PLATFORM_PSA_ISOLATION_LEVEL_OPTIONS)
message(FATAL_ERROR "[PSA] : Error: Unspported value for -DPLATFORM_PSA_ISOLATION_LEVEL=, supported values are : ${PLATFORM_PSA_ISOLATION_LEVEL_OPTIONS}")
endif()
if(${SUITE} STREQUAL "IPC")
message(STATUS "[PSA] : PLATFORM_PSA_ISOLATION_LEVEL is set to ${PLATFORM_PSA_ISOLATION_LEVEL}")
endif()
endif()

if(NOT DEFINED INCLUDE_PANIC_TESTS)
set(INCLUDE_PANIC_TESTS 0 CACHE INTERNAL "By default panic tests are disabled" FORCE)
message(STATUS "[PSA] : Defaulting to INCLUDE_PANIC_TESTS=${INCLUDE_PANIC_TESTS}")
#By default panic tests are disabled
set(INCLUDE_PANIC_TESTS 0 CACHE INTERNAL "Default INCLUDE_PANIC_TESTS value" FORCE)
message(STATUS "[PSA] : Defaulting INCLUDE_PANIC_TESTS to ${INCLUDE_PANIC_TESTS}")
else()
if(INCLUDE_PANIC_TESTS EQUAL 1)
message(STATUS "[PSA] : Ensure you set watchdog.num to 1 in ${PSA_ROOT_DIR}/platform/targets/${TARGET}/target.cfg")
message(STATUS "[PSA] : To test PSA APIs panic conditions, test harness may require to access watchdog timer "
"to recover from panic and to be able to continue with next test. "
"Ignore this warning if system under test has capability to reset the system "
"when it encounters panic condition.")
message(STATUS "[PSA] : "
"INCLUDE_PANIC_TESTS set to 1, therefore including PSA APIs panic tests into the regression,\n"
"\tensure that watchdog.num is set to 1 in ${PSA_ROOT_DIR}/platform/targets/${TARGET}/target.cfg")
endif()
endif()

if(NOT DEFINED WATCHDOG_AVAILABLE)
set(WATCHDOG_AVAILABLE 1 CACHE INTERNAL "Assuming watchdog is available to program by test suite" FORCE)
message(STATUS "[PSA] : Watchdog is available by default")
#Assuming watchdog is available to program by test suite
set(WATCHDOG_AVAILABLE 1 CACHE INTERNAL "Default WATCHDOG_AVAILABLE value" FORCE)
message(STATUS "[PSA] : Defaulting WATCHDOG_AVAILABLE to ${WATCHDOG_AVAILABLE}")
else()
message(STATUS "[PSA] : WATCHDOG_AVAILABLE is set to ${WATCHDOG_AVAILABLE}")
endif()

if((INCLUDE_PANIC_TESTS EQUAL 1) AND
(WATCHDOG_AVAILABLE EQUAL 0))
message(FATAL_ERROR "[PSA]: Panic test execution needs watchdog access. set -DWATCHDOG_AVAILABLE=1")
message(WARNING "[PSA]: "
"Note that to test PSA APIs panic conditions, test harness may require to access"
"the watchdog timer in oder to recover from panic and to be able to continue with"
"next test. Ignore this warning if system under test has capability to reset the"
"system when it encounters panic condition.")
endif()

if(NOT DEFINED SP_HEAP_MEM_SUPP)
set(SP_HEAP_MEM_SUPP 1 CACHE INTERNAL "Are dynamic memory functions available to secure partition?" FORCE)
message(STATUS "[PSA] : Default value for SP_HEAP_MEM_SUPP is ${SP_HEAP_MEM_SUPP}")
#Are dynamic memory functions available to secure partition?
set(SP_HEAP_MEM_SUPP 1 CACHE INTERNAL "Default SP_HEAP_MEM_SUPP value" FORCE)
message(STATUS "[PSA] : Defaulting SP_HEAP_MEM_SUPP to ${SP_HEAP_MEM_SUPP}")
endif()

if(NOT DEFINED TEST_COMBINE_ARCHIVE)
set(TEST_COMBINE_ARCHIVE 1 CACHE INTERNAL "Default option is to create archive" FORCE)
message(STATUS "[PSA] : Default value for TEST_COMBINE_ARCHIVE is ${TEST_COMBINE_ARCHIVE}")
#Default option is to create archive
set(TEST_COMBINE_ARCHIVE 1 CACHE INTERNAL "Default TEST_COMBINE_ARCHIVE value" FORCE)
message(STATUS "[PSA] : Defaulting TEST_COMBINE_ARCHIVE to ${TEST_COMBINE_ARCHIVE}")
else()
message(STATUS "[PSA] : TEST_COMBINE_ARCHIVE is set to ${TEST_COMBINE_ARCHIVE}")
endif()

message(STATUS "[PSA] : ----------Process input arguments- complete-------------")

# Build PAL NSPE LIB
include(${PSA_ROOT_DIR}/platform/targets/${TARGET}/target.cmake)

if((${SUITE} STREQUAL "INITIAL_ATTESTATION") AND (NOT EXISTS ${PSA_TARGET_QCBOR}))
# Clone QCBOR and move to specified tag
execute_process(COMMAND ${GIT_EXECUTABLE} clone ${PSA_QCBOR_GIT_REPO_LINK} ${PSA_TARGET_QCBOR}
RESULT_VARIABLE ${PSA_TARGET_QCBOR}_clone_result
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
if(${PSA_TARGET_QCBOR}_clone_result)
message(FATAL_ERROR "git clone failed for ${PSA_QCBOR_GIT_REPO_LINK}")
endif()

if(NOT ${PSA_TARGET_QCBOR}_clone_result)
execute_process(COMMAND ${GIT_EXECUTABLE} checkout -q "${PSA_QCBOR_GIT_REPO_TAG}"
RESULT_VARIABLE ${PSA_TARGET_QCBOR}_checkout_result
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${PSA_TARGET_QCBOR})
if(${PSA_TARGET_QCBOR}_checkout_result)
message(FATAL_ERROR "git checkout failed for Repo : ${PSA_QCBOR_GIT_REPO_LINK}, Tag : ${PSA_QCBOR_GIT_REPO_TAG}")
endif()
endif()
endif()

# Create PSA clean list
list(APPEND PSA_CLEAN_LIST
Expand Down Expand Up @@ -332,22 +374,6 @@ add_custom_target(
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/src/${PSA_TARGET_GENERATE_DATABASE}-build/ -- clean
)

if(${SUITE} STREQUAL "INITIAL_ATTESTATION")
# Cloning CMSIS_5 repo
ExternalProject_Add(
${PSA_TARGET_QCBOR}
PREFIX ${CMAKE_CURRENT_BINARY_DIR}
GIT_REPOSITORY ${PSA_QCBOR_GIT_REPO_LINK}
GIT_TAG ${PSA_QCBOR_GIT_REPO_TAG}
CONFIGURE_COMMAND ""
UPDATE_COMMAND ""
PATCH_COMMAND ""
BUILD_COMMAND ""
TEST_COMMAND ""
INSTALL_COMMAND ""
)
endif()

# Check for supported toolchain/s
if(${TOOLCHAIN} IN_LIST PSA_TOOLCHAIN_SUPPORT)
include(${PSA_ROOT_DIR}/tools/cmake/compiler/${TOOLCHAIN}.cmake)
Expand All @@ -365,6 +391,8 @@ if(${SP_HEAP_MEM_SUPP} EQUAL 1)
add_definitions(-DSP_HEAP_MEM_SUPP)
endif()

# Build PAL NSPE LIB
include(${PSA_ROOT_DIR}/platform/targets/${TARGET}/target.cmake)
# Build VAL NSPE LIB
#add_definitions(-DVAL_NSPE_BUILD)
include(${PSA_ROOT_DIR}/val/val_nspe.cmake)
Expand All @@ -377,13 +405,7 @@ endif()

add_dependencies(${PSA_TARGET_GENERATE_DATABASE} ${PSA_TARGET_GENERATE_DATABASE_PRE})
add_dependencies(${PSA_TARGET_GENERATE_DATABASE_POST} ${PSA_TARGET_GENERATE_DATABASE})
if(${SUITE} STREQUAL "INITIAL_ATTESTATION")
add_dependencies(${PSA_TARGET_QCBOR} ${PSA_TARGET_GENERATE_DATABASE_POST})
add_dependencies(${PSA_TARGET_PAL_NSPE_LIB} ${PSA_TARGET_QCBOR})
add_dependencies(${PSA_TARGET_VAL_NSPE_LIB} ${PSA_TARGET_QCBOR})
else()
add_dependencies(${PSA_TARGET_PAL_NSPE_LIB} ${PSA_TARGET_GENERATE_DATABASE_POST})
endif()
add_dependencies(${PSA_TARGET_VAL_NSPE_LIB} ${PSA_TARGET_PAL_NSPE_LIB})
add_dependencies(${PSA_TARGET_TEST_COMBINE_LIB} ${PSA_TARGET_VAL_NSPE_LIB})
if(${SUITE} STREQUAL "IPC")
Expand Down
7 changes: 3 additions & 4 deletions api-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ The test suite for this specification is located in the **ff** directory of this
The test suite for this specification is located in the **dev_apis** directory of this repository. See the [PSA Developer APIs README](dev_apis/README.md) file for more details.

## Release Update
- Release Version: 0.9
- Code quality: Arm welcomes suggestions for enhancements and error corrections.
- Code Quality : REL v1.0
- This release contains following tests: <br />

1. Developer APIs test list:
Expand All @@ -31,7 +30,7 @@ The test suite for this specification is located in the **dev_apis** directory o
| Internal Trusted Storage | [PSA Internal Trusted Storage API 1.0.0](../api-specs/storage/v1.0/doc/) |
| Initial Attestation | [PSA Initial Attestation API 1.0.0](../api-specs/attestation/v1.0/doc/) |

2. PSA-FF tests that are written for version 1.0-Beta1 of the PSA FF specification.
2. PSA-FF tests that are written for the PSA FF 1.0 specification.

## License

Expand All @@ -46,4 +45,4 @@ Arm PSA test suite is distributed under Apache v2.0 License.

--------------

*Copyright (c) 2018-2019, Arm Limited and Contributors. All rights reserved.*
*Copyright (c) 2018-2020, Arm Limited and Contributors. All rights reserved.*
6 changes: 3 additions & 3 deletions api-tests/dev_apis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ To build the test suite for your target platform, execute the following commands
<br />Options information:<br />

- -G"<generator_name>" : "Unix Makefiles" to generate Makefiles for Linux and Cygwin. "MinGW Makefiles" to generate Makefiles for cmd.exe on Windows <br />
- -DTARGET=<platform_name> is the same as the name of the target-specific directory created in the **platform/targets/** directory. The current release has been tested on **tgt_dev_apis_tfm_an521**, **tgt_dev_apis_tfm_musca_b1** and **tgt_dev_apis_tfm_musca_a** platforms.<br />
- -DTARGET=<platform_name> is the same as the name of the target-specific directory created in the **platform/targets/** directory. The current release has been tested on **tgt_dev_apis_tfm_an521**, **tgt_dev_apis_tfm_musca_b1** and **tgt_dev_apis_tfm_musca_a** platforms. Refer [Test_failure analysis](../docs/test_failure_analysis.md) document to know the reason for any known test fail.<br />
- -DTOOLCHAIN=<tool_chain> Compiler toolchain to be used for test suite compilation. Supported values are GNUARM (GNU Arm Embedded), ARMCLANG (ARM Compiler 6.x) and HOST_GCC. Default is GNUARM.<br />
- -DCPU_ARCH=<cpu_architecture_version> is the Arm Architecture version name for which the tests should be compiled. Supported CPU arch are armv8m_ml, armv8m_bl and armv7m. Default is empty. This option is unused when TOOLCHAIN type is HOST_GCC.<br />
- -DSUITE=<suite_name> is the suite name that is the same as the suite name available in **dev_apis/** directory.<br />
- -DVERBOSE=<verbose_level>. Print verbosity level. Default is 3. Supported print levels are 1(INFO & above), 2(DEBUG & above), 3(TEST & above), 4(WARN & ERROR) and 5(ERROR).
- -DBUILD=<BUILD_DIR> : To select the build directory to keep output files. Default is BUILD/ inside current directory.
- -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 depend on the system reset conditions.
- -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 PSA API behaviour on the system reset.
- -DPSA_INCLUDE_PATHS="<include_path1>;<include_path2>;...;<include_pathn>" is an additional directory to be included into the compiler search path.You must provide Developer APIs header files implementation to the test suite build system using this option. For example, to compile Crypto tests, the include path must point to the path where **psa/crypto.h** is located in your build system. Bydefault, PSA_INCLUDE_PATHS accepts absolute path. However, relative path can be provided using below format:<br />
```
-DPSA_INCLUDE_PATHS=`readlink -f <relative_include_path>`
Expand Down Expand Up @@ -99,4 +99,4 @@ Arm PSA test suite is distributed under Apache v2.0 License.

--------------

*Copyright (c) 2018-2019, Arm Limited and Contributors. All rights reserved.*
*Copyright (c) 2018-2020, Arm Limited and Contributors. All rights reserved.*
25 changes: 11 additions & 14 deletions api-tests/dev_apis/crypto/test_c039/test_data.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @file
* Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
* Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -41,12 +41,11 @@ static const uint8_t rsa_256_keypair[1];
static const uint8_t rsa_256_keydata[1];

static const uint8_t ec_keydata[] = {
0x30, 0x49, 0x30, 0x13, 0x06, 0x07, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x02, 0x01, 0x06,
0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x01, 0x03, 0x32, 0x00, 0x04, 0xBC,
0x79, 0x7D, 0xB3, 0xAE, 0x7F, 0x08, 0xEC, 0x3D, 0x49, 0x6B, 0x4F, 0xB4, 0x11, 0xB3,
0xF6, 0x20, 0xA5, 0x58, 0xA5, 0x01, 0xE0, 0x22, 0x2D, 0x08, 0xCF, 0xE0, 0xDC, 0x8A,
0xEC, 0x8B, 0x1A, 0x7B, 0xF2, 0x4B, 0xE9, 0x29, 0x51, 0xCC, 0x5B, 0xA1, 0xBE, 0xBB,
0x24, 0x74, 0x90, 0x9A, 0xE0};
0x04, 0xde, 0xa5, 0xe4, 0x5d, 0x0e, 0xa3, 0x7f, 0xc5, 0x66, 0x23, 0x2a, 0x50, 0x8f,
0x4a, 0xd2, 0x0e, 0xa1, 0x3d, 0x47, 0xe4, 0xbf, 0x5f, 0xa4, 0xd5, 0x4a, 0x57, 0xa0,
0xba, 0x01, 0x20, 0x42, 0x08, 0x70, 0x97, 0x49, 0x6e, 0xfc, 0x58, 0x3f, 0xed, 0x8b,
0x24, 0xa5, 0xb9, 0xbe, 0x9a, 0x51, 0xde, 0x06, 0x3f, 0x5a, 0x00, 0xa8, 0xb6, 0x98,
0xa1, 0x6f, 0xd7, 0xf2, 0x9b, 0x54, 0x85, 0xf3, 0x20};

static const uint8_t ec_keypair[] = {
0x30, 0x5F, 0x02, 0x01, 0x01, 0x04, 0x18, 0x33, 0x8E, 0x86, 0xA8, 0x81, 0xE2, 0x38,
Expand Down Expand Up @@ -216,27 +215,25 @@ static test_data check1[] = {
#endif

#ifdef ARCH_TEST_ECDSA
#ifdef ARCH_TEST_ECC_CURVE_SECP192R1
#ifdef ARCH_TEST_ECC_CURVE_SECP256R1
{"Test psa_asymmetric_encrypt - ECC public key\n", 9,
PSA_KEY_TYPE_ECC_PUBLIC_KEY(PSA_ECC_CURVE_SECP192R1),
{0}, 75, PSA_KEY_USAGE_ENCRYPT, PSA_ALG_ECDSA_ANY,
PSA_KEY_TYPE_ECC_PUBLIC_KEY(PSA_ECC_CURVE_SECP256R1),
{0}, 65, PSA_KEY_USAGE_ENCRYPT, PSA_ALG_CATEGORY_ASYMMETRIC_ENCRYPTION,
{0}, 0,
{0xba, 0x78, 0x16, 0xbf, 0x8f, 0x01, 0xcf, 0xea, 0x41, 0x41, 0x40, 0xde, 0x5d,
0xae, 0x22, 0x23, 0xb0, 0x03, 0x61, 0xa3, 0x96, 0x17, 0x7a, 0x9c, 0xb4, 0x10,
0xff, 0x61, 0xf2, 0x00, 0x15, 0xad}, 22, 128,
0, 192, PSA_SUCCESS
128, 256, PSA_SUCCESS
},
#endif

#ifdef ARCH_TEST_ECC_CURVE_SECP256R1
{"Test psa_asymmetric_encrypt - ECC keypair\n", 10,
PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_CURVE_SECP256R1),
{0}, 97, PSA_KEY_USAGE_ENCRYPT, PSA_ALG_DETERMINISTIC_ECDSA(PSA_ALG_SHA_256),
{0}, 0,
{0xba, 0x78, 0x16, 0xbf, 0x8f, 0x01, 0xcf, 0xea, 0x41, 0x41, 0x40, 0xde, 0x5d,
0xae, 0x22, 0x23, 0xb0, 0x03, 0x61, 0xa3, 0x96, 0x17, 0x7a, 0x9c, 0xb4, 0x10,
0xff, 0x61, 0xf2, 0x00, 0x15, 0xad}, 22, 128,
0, 192, PSA_SUCCESS
128, 256, PSA_SUCCESS
}
#endif
#endif
Expand Down
4 changes: 2 additions & 2 deletions api-tests/dev_apis/crypto/test_c042/test_data.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @file
* Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
* Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -212,7 +212,7 @@ PSA_KEY_TYPE_RSA_PUBLIC_KEY,
0x28, 0x1d, 0xb1, 0xe0, 0x02, 0x5c, 0x3b, 0xfb, 0x55, 0x12, 0x96, 0x3e, 0xc3,
0xb9, 0x8d, 0xda, 0xa6, 0x9e, 0x38, 0xbc, 0x3c, 0x84, 0xb1, 0xb6, 0x1a, 0x04,
0xe5, 0x64, 0x86, 0x40, 0x85, 0x6a, 0xac, 0xc6, 0xfc, 0x73, 0x11},
120, 1024, PSA_ERROR_BUFFER_TOO_SMALL
120, 1024, PSA_ERROR_INVALID_SIGNATURE
},
#endif

Expand Down
Loading

0 comments on commit 541cf68

Please sign in to comment.