aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD/CRYPv1
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/ports/STM32/LLD/CRYPv1')
-rw-r--r--os/hal/ports/STM32/LLD/CRYPv1/hal_crypto_lld.c18
-rw-r--r--os/hal/ports/STM32/LLD/CRYPv1/hal_crypto_lld.h25
2 files changed, 16 insertions, 27 deletions
diff --git a/os/hal/ports/STM32/LLD/CRYPv1/hal_crypto_lld.c b/os/hal/ports/STM32/LLD/CRYPv1/hal_crypto_lld.c
index 9268e5398..f871ff4d4 100644
--- a/os/hal/ports/STM32/LLD/CRYPv1/hal_crypto_lld.c
+++ b/os/hal/ports/STM32/LLD/CRYPv1/hal_crypto_lld.c
@@ -35,7 +35,7 @@
/*===========================================================================*/
/** @brief CRY1 driver identifier.*/
-#if PLATFORM_CRY_USE_CRY1 || defined(__DOXYGEN__)
+#if STM32_CRY_USE_CRYP1 || defined(__DOXYGEN__)
CRYDriver CRYD1;
#endif
@@ -151,7 +151,7 @@ cryerror_t cry_lld_encrypt_AES_ECB(CRYDriver *cryp,
(void)in;
(void)out;
- return CRY_NOERROR;
+ return CRY_ERR_INV_ALGO;
}
/**
@@ -187,7 +187,7 @@ cryerror_t cry_lld_decrypt_AES_ECB(CRYDriver *cryp,
(void)in;
(void)out;
- return CRY_NOERROR;
+ return CRY_ERR_INV_ALGO;
}
/**
@@ -226,7 +226,7 @@ cryerror_t cry_lld_encrypt_AES_CBC(CRYDriver *cryp,
(void)out;
(void)iv;
- return CRY_NOERROR;
+ return CRY_ERR_INV_ALGO;
}
/**
@@ -265,7 +265,7 @@ cryerror_t cry_lld_decrypt_AES_CBC(CRYDriver *cryp,
(void)out;
(void)iv;
- return CRY_NOERROR;
+ return CRY_ERR_INV_ALGO;
}
/**
@@ -304,7 +304,7 @@ cryerror_t cry_lld_encrypt_AES_CFB(CRYDriver *cryp,
(void)out;
(void)iv;
- return CRY_NOERROR;
+ return CRY_ERR_INV_ALGO;
}
/**
@@ -343,7 +343,7 @@ cryerror_t cry_lld_decrypt_AES_CFB(CRYDriver *cryp,
(void)out;
(void)iv;
- return CRY_NOERROR;
+ return CRY_ERR_INV_ALGO;
}
/**
@@ -385,7 +385,7 @@ cryerror_t cry_lld_encrypt_AES_CTR(CRYDriver *cryp,
(void)nonce;
(void)cnt;
- return CRY_NOERROR;
+ return CRY_ERR_INV_ALGO;
}
/**
@@ -427,7 +427,7 @@ cryerror_t cry_lld_decrypt_AES_CTR(CRYDriver *cryp,
(void)nonce;
(void)cnt;
- return CRY_NOERROR;
+ return CRY_ERR_INV_ALGO;
}
#endif /* HAL_USE_CRY == TRUE */
diff --git a/os/hal/ports/STM32/LLD/CRYPv1/hal_crypto_lld.h b/os/hal/ports/STM32/LLD/CRYPv1/hal_crypto_lld.h
index 2bc94b31d..4273340ad 100644
--- a/os/hal/ports/STM32/LLD/CRYPv1/hal_crypto_lld.h
+++ b/os/hal/ports/STM32/LLD/CRYPv1/hal_crypto_lld.h
@@ -37,7 +37,7 @@
*/
#define CRY_LLD_SUPPORTS_AES_ECB TRUE
#define CRY_LLD_SUPPORTS_AES_CBC TRUE
-#define CRY_LLD_SUPPORTS_AES_CFB TRUE
+#define CRY_LLD_SUPPORTS_AES_CFB FALSE
#define CRY_LLD_SUPPORTS_AES_CTR TRUE
/** @{ */
@@ -78,23 +78,6 @@ typedef uint32_t crykey_t;
typedef struct CRYDriver CRYDriver;
/**
- * @brief CRY notification callback type.
- *
- * @param[in] cryp pointer to the @p CRYDriver object triggering the
- * callback
- */
-typedef void (*crycallback_t)(CRYDriver *cryp);
-
-/**
- * @brief CRY error callback type.
- *
- * @param[in] cryp pointer to the @p CRYDriver object triggering the
- * callback
- * @param[in] err CRY error code
- */
-typedef void (*cryerrorcallback_t)(CRYDriver *cryp, cryerror_t err);
-
-/**
* @brief Driver configuration structure.
* @note It could be empty on some architectures.
*/
@@ -122,6 +105,12 @@ struct CRYDriver {
* @brief Size of transient key.
*/
size_t key0_size;
+#if (HAL_CRY_USE_FALLBACK == TRUE) || defined(__DOXYGEN__)
+ /**
+ * @brief Key buffer for the fall-back implementation.
+ */
+ uint8_t key0_buffer[HAL_CRY_MAX_KEY_SIZE];
+#endif
#if defined(CRY_DRIVER_EXT_FIELDS)
CRY_DRIVER_EXT_FIELDS
#endif