Crypto: Fixes for PSA Crypto API compliance
Details:
- Require that setup functions are called with handles initialised to
0. Make 0 the invalid handle and number handles from 1.
- Return PSA_ERROR_BUFFER_TOO_SMALL if the output buffer is too small
in psa_asymmetric_encrypt.
- Release generator operations if setup or abort operations fail.
Change-Id: Ic1da83e056a00364ef8eba3ea23cbf191f8886e4
Signed-off-by: Jamie Fox <jamie.fox@arm.com>
diff --git a/interface/include/tfm_crypto_defs.h b/interface/include/tfm_crypto_defs.h
index 436cc81..adddf4c 100644
--- a/interface/include/tfm_crypto_defs.h
+++ b/interface/include/tfm_crypto_defs.h
@@ -121,7 +121,7 @@
* \brief This value is used to mark an handle as invalid.
*
*/
-#define TFM_CRYPTO_INVALID_HANDLE (~0x0u)
+#define TFM_CRYPTO_INVALID_HANDLE (0x0u)
/**
* \brief Define miscellaneous literal constants that are used in the service