cypress: Add fault injection mitigation
Add software countermeasures against fault injection attacks.
Change-Id: I35ae95a3387a0231f81782e22728bf8a3f9b6005
Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
Signed-off-by: Roman Okhrimenko <roman.okhrimenko@cypress.com>
diff --git a/boot/cypress/MCUBootApp/cy_security_cnt.c b/boot/cypress/MCUBootApp/cy_security_cnt.c
index 9ccb3be..81aa54e 100644
--- a/boot/cypress/MCUBootApp/cy_security_cnt.c
+++ b/boot/cypress/MCUBootApp/cy_security_cnt.c
@@ -17,15 +17,15 @@
#include "bootutil/security_cnt.h"
#include <stdint.h>
-int32_t
+fih_int
boot_nv_security_counter_init(void)
{
/* Do nothing. */
return 0;
}
-int32_t
-boot_nv_security_counter_get(uint32_t image_id, uint32_t *security_cnt)
+fih_int
+boot_nv_security_counter_get(uint32_t image_id, fih_int *security_cnt)
{
(void)image_id;
*security_cnt = 30;