The DEVICE_FOO macros are always defined (either 0 or 1).
This patch replaces any instances of a define check on a DEVICE_FOO
macro with value test instead.
Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
Update the cryptocell 310 GCC_ARM libraries with known version.
The libraries were built from the Cryptocell 310 release
version 1.1.0.1285, using arm-none-eabi-gcc 6.3.1 20170620 (release) (release).
Update the cryptocell 310 ARM libraries with known version.
The libraries were built from the Cryptocell 310 release version
1.1.0.1285, using `ARM Compiler 5.06 update 4 (build 422)`.
Update the cryptocell 310 IAR libraries, since the previous ones were not
built correct. The libraries were built from the Cryptocell 310
release version 1.1.0.1285, using IAR version 7.80.1.11864.
1. Change camelcase variables to Mbed OS style.
2. Remove functions declarations from the `_alt` header, since they
are now added from the module header regardless whether an alternative
implementation exists.
3. Remove the `extern "c"` declaration from the `_alt` headers.
4. Remove redundant extra lines.
Return `MBEDTLS_ERR_AES_FEATURE_UNAVAILABLE` only for valid key lengths,
that are not supported by Cryptocell 310. For other key sizes, return
`MBEDTLS_ERR_CCM_BAD_INPUT`
1. Change camelcase variables to Mbed OS style.
2. Remove functions declarations from the `_alt` header, since they
are now added from the module header regardless whether an alternative
implementation exists.
3. Remove the `extern "c"` declaration from the `_alt` headers.
4. Remove whitespaces before opening parenthesis.
5. Fix alignment of function parameters.
6. Fix indentations.
7. Limit lines to 80 characters.
Return `MBEDTLS_ERR_ECP_INVALID_KEY` when Cryptocell returns
`CRYS_ECPKI_BUILD_KEY_INVALID_PRIV_KEY_SIZE_ERROR`
or `CRYS_ECPKI_BUILD_KEY_INVALID_PUBL_KEY_SIZE_ERROR`,
When the key size is invalid. Found by the "ECDSA zero private parameter"
tests.
An additional fix for ccm_alt, when the message length is too big.
Check for specific error returned from CC310, and return
`MBEDTLS_ERR_CCM_BAD_INPUT`.
Have the HW accelearation drivers return the platform module
errors about feature unsupported, and hw acceleration failure,
because the moduel specific errors will be removed.
Change error from `MBEDTLS_PLATFORM_HW_FAILED` to
`MBEDTLS_PLATFORM_HW_ACCEL_FAILED` and the value to 0x70,
as the previous value cannot be used as a low level error code.
1. Move the `mbedtls_platform_context` to be platform code, in `features/mbedtls/platfrom/`.
2. Add static refernce counter, to setup and teardown the platform code only once.
3. Adjust Cryptocell porting accordingly.