diff --git a/include/tinycrypt/ecc.h b/include/tinycrypt/ecc.h index 2da74b3c0a..9a705c495b 100644 --- a/include/tinycrypt/ecc.h +++ b/include/tinycrypt/ecc.h @@ -83,6 +83,13 @@ extern "C" { #endif +/* Return values for functions, chosen with large Hamming distances between + * them (especially to SUCESS) to mitigate the impact of fault injection + * attacks flipping a low number of bits. */ +#define UECC_SUCCESS 0 +#define UECC_FAILURE 0x75555555 +#define UECC_ATTACK_DETECTED 0x7aaaaaaa + /* Word size (4 bytes considering 32-bits architectures) */ #define uECC_WORD_SIZE 4