Crypto: Align implementation to pass PSA API compliance

-- Enable the option to specify maximum supported key
   length and maximum number of key slots at build time
   for the key module
-- Enable the option to specify internal buffer size
   for scratch allocation at build time for the
   engine module
-- Make sure that MD-2 and MD-4 hashes are enabled and
   supported by the back end as they are tested by the
   PSA API compliance tests
-- Other alignment needed to pass PSA API compliance
   tests, as changes in return codes, more error
   checking, and documentation update when needed

Change-Id: I4bb78b06de2fa01580c4cbd361c946d32c614240
Signed-off-by: Jamie Fox <jamie.fox@arm.com>
Co-Authored-by: Antonio de Angelis <antonio.deangelis@arm.com>
diff --git a/interface/include/tfm_crypto_defs.h b/interface/include/tfm_crypto_defs.h
index ed85dc8..4e532ca 100644
--- a/interface/include/tfm_crypto_defs.h
+++ b/interface/include/tfm_crypto_defs.h
@@ -22,12 +22,6 @@
 #define TFM_CRYPTO_ERR_PSA_ERROR_OFFSET (TFM_PARTITION_SPECIFIC_ERROR_MIN)
 
 /**
- * \brief This defines the maximum supported key length in bytes
- *
- */
-#define TFM_CRYPTO_MAX_KEY_LENGTH (32)
-
-/**
  * \brief This value is used to mark an handle as invalid.
  *
  */
@@ -92,7 +86,7 @@
  */
 #define PSA_STATUS_TO_TFM_CRYPTO_ERR(val) \
       ( (val == PSA_SUCCESS) ? (enum tfm_crypto_err_t)val : \
-                (enum tfm_crypto_err_t)(val + TFM_CRYPTO_ERR_PSA_ERROR_OFFSET) )
+              (enum tfm_crypto_err_t)(val + TFM_CRYPTO_ERR_PSA_ERROR_OFFSET-1) )
 
 #ifdef __cplusplus
 }