Hi,
I am trying to use 'an elliptic curve' for signing and verifying in Trustzone,
but it seems that there is no example of it.
There is a benchmark using mbedTLS, so I've been trying to port it into my trustzone project,
but whenever I debugged, the board always was stuck in 'hashcrypt_sha_finalize', more specifically,
/* poll wait for final digest */
while (0U == (base->STATUS & HASHCRYPT_STATUS_DIGEST_MASK))
{
}
I searched what this status means, but I couldn't find meaningful results.
Any comments would be greatly appreciated.
Let me specify what I have done in the program.
- Copy and paste 'lpcxpresso55s69_mbedtls_benchmark' project into my project
- Due to the size limitation of secure flash memory, increase the flash size in build setting and adjust secure flash memory and non-secure flash memory in TZ setting
- Call functions from the example, in order,
- CRYPTO_InitHardware()
- mbedtls_ecdsa_init( &ecdsa )
- mbedtls_ecdsa_genkey( &ecdsa, curve_info->grp_id, myrand, NULL )
- mbedtls_ecdsa_write_signature( &ecdsa, MBEDTLS_MD_SHA256, buf, curve_info->bit_size, tmp, &sig_len, myrand, NULL )
Everything goes fine except for the last one, mbedtls_ecdsa_write_signature().
During calling the function, it's stuck at the sha function as I mentioned above.
Thank you so much for reading!