ASR_BASE
Change-Id: Icf3719cc0afe3eeb3edc7fa80a2eb5199ca9dda1
diff --git a/marvell/uboot/drivers/crypto/bcm/asr_hash.h b/marvell/uboot/drivers/crypto/bcm/asr_hash.h
new file mode 100644
index 0000000..1902112
--- /dev/null
+++ b/marvell/uboot/drivers/crypto/bcm/asr_hash.h
@@ -0,0 +1,65 @@
+#ifndef _ASR_HASH_H_
+#define _ASR_HASH_H_
+
+#define ROUND_UP_TO_WORD_CNT(x) ((x + 0x3) >> 2)
+#define HASH_ALIGN_BUF_SIZE 4096
+#define BLOCK_ALGIN_SIZE 64
+
+typedef enum {
+ HASH_INIT = 0x1,
+ HASH_UPDATE = 0x2,
+ HASH_FINAL = 0x3,
+} HASH_OP_MODE_T;
+
+typedef enum {
+ HASH_LEN_SHA1 = 20,
+ HASH_LEN_SHA256 = 32,
+ HASH_LEN_SHA224 = 28,
+ HASH_LEN_MD5 = 16,
+ HASH_LEN_SHA512 = 64,
+ HASH_LEN_SHA384 = 48,
+} HASH_LEN_T;
+
+typedef enum {
+ HASH_SIMPLE = 0,
+ HASH_HMAC,
+} HASH_MODE_T;
+
+typedef enum {
+ HASH_SHA1 = 0x0,
+ HASH_SHA256 = 0x1,
+ HASH_SHA224 = 0X2,
+ HASH_MD5 = 0x3,
+ HASH_SHA512 = 0x4,
+ HASH_SHA384 = 0X5,
+} HASH_ALGO_T;
+
+struct sha512_state {
+ unsigned int state[16];
+};
+
+struct sha256_state {
+ unsigned int state[8];
+};
+
+struct sha1_state {
+ unsigned int state[5];
+};
+
+struct md5_state {
+ unsigned int state[4];
+};
+
+typedef struct {
+ uint64_t length;
+ unsigned int curlen;
+ unsigned char buf[BLOCK_ALGIN_SIZE] __attribute__((aligned(4)));
+ uint32_t block_size;
+
+ struct sha512_state sha512;
+ struct sha256_state sha256;
+ struct sha1_state sha1;
+ struct md5_state md5;
+} hash_state;
+
+#endif
\ No newline at end of file