File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6262
6363#include <stddef.h> /* for size_t */
6464
65+ #ifdef EXT_ENCRYPTED
66+ static int encrypt_key_is_erased (const uint8_t * key , uint32_t len )
67+ {
68+ uint8_t diff = 0 ;
69+ uint32_t i ;
70+
71+ for (i = 0 ; i < len ; i ++ )
72+ diff |= key [i ] ^ FLASH_BYTE_ERASED ;
73+
74+ return diff == 0 ;
75+ }
76+ #endif
77+
6578#if defined(EXT_ENCRYPTED ) && (defined(__WOLFBOOT ) || defined(UNIT_TEST ) || defined(MMU ))
6679#include "encrypt.h"
6780static int encrypt_initialized = 0 ;
@@ -84,17 +97,6 @@ static int encrypt_key_is_valid(const uint8_t *key, uint32_t len)
8497 return (has_one != 0 ) && (has_zero != 0 );
8598}
8699
87- static int encrypt_key_is_erased (const uint8_t * key , uint32_t len )
88- {
89- uint8_t diff = 0 ;
90- uint32_t i ;
91-
92- for (i = 0 ; i < len ; i ++ )
93- diff |= key [i ] ^ FLASH_BYTE_ERASED ;
94-
95- return diff == 0 ;
96- }
97-
98100#define FALLBACK_IV_OFFSET 0x00100000U
99101 #if !defined(XMEMSET )
100102 #include <string.h>
You can’t perform that action at this time.
0 commit comments