summaryrefslogtreecommitdiff
path: root/board/cr50/dcrypto/internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'board/cr50/dcrypto/internal.h')
-rw-r--r--board/cr50/dcrypto/internal.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/board/cr50/dcrypto/internal.h b/board/cr50/dcrypto/internal.h
index ef092f6fb5..ea9056cefb 100644
--- a/board/cr50/dcrypto/internal.h
+++ b/board/cr50/dcrypto/internal.h
@@ -10,6 +10,7 @@
#include "common.h"
#include "crypto_common.h"
+
#include "util.h"
#include "hmacsha2.h"
@@ -39,11 +40,6 @@ extern "C" {
#define CHAR_BIT 8
#endif
-enum sha_mode {
- SHA1_MODE = 0,
- SHA256_MODE = 1
-};
-
/*
* Use this structure to avoid alignment problems with input and output
* pointers.
@@ -57,6 +53,9 @@ int dcrypto_grab_sha_hw(void);
void dcrypto_release_sha_hw(void);
#endif
+/* Load data into KEYMGR SHA FIFO. */
+void dcrypto_sha_fifo_load(const void *data, size_t n);
+
/*
* BIGNUM.
*/
@@ -352,6 +351,12 @@ static inline uint64_t rol64(uint64_t value, int bits)
/* Define machine word alignment mask. */
#define WORD_MASK (sizeof(uintptr_t) - 1)
+/* return true if pointer is not word aligned. */
+static inline bool is_not_aligned(const void *ptr)
+{
+ return (uintptr_t)ptr & WORD_MASK;
+}
+
/**
* @brief Launders the machine register sized value `val`.
*