lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | /**---------------------------------------------------------------@n
|
| 2 | * °æÈ¨ËùÓÐ(C)2011, ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾
|
| 3 | *
|
| 4 | * ÎļþÃû³Æ: drv_hash.h
|
| 5 | * ÄÚÈÝÕªÒª: HASHÉ豸linuxÇý¶¯³ÌÐòÍ·Îļþ
|
| 6 | * ÆäËû˵Ã÷:
|
| 7 | *
|
| 8 | * --------------------------------------------------------------
|
| 9 | * Ð޸ļǼ1: // ÐÞ¸ÄÀúÊ·¼Ç¼£¬°üÀ¨ÐÞ¸ÄÈÕÆÚ¡¢ÐÞ¸ÄÕß¼°ÐÞ¸ÄÄÚÈÝ
|
| 10 | * ÐÞ¸ÄÈÕÆÚ:
|
| 11 | * °æ ±¾ ºÅ:
|
| 12 | * ÐÞ ¸Ä ÈË:
|
| 13 | * ÐÞ¸ÄÄÚÈÝ:
|
| 14 | *
|
| 15 | * ---------------------------------------------------------*/
|
| 16 |
|
| 17 | #ifndef DRV_HASH_H
|
| 18 | #define DRV_HASH_H
|
| 19 |
|
| 20 | #include <common.h>
|
| 21 |
|
| 22 | #define SYS_HASH_BASE 0x0121d000
|
| 23 |
|
| 24 |
|
| 25 | #define HASH_CONTROL (SYS_HASH_BASE+0x04)
|
| 26 | #define HASH_START (SYS_HASH_BASE+0x08)
|
| 27 | #define HASH_DATA (SYS_HASH_BASE+0x10)
|
| 28 | #define HASH_INTSTATUS (SYS_HASH_BASE+0x1c)
|
| 29 | #define HASH_LENGTH0 (SYS_HASH_BASE+0x2c)
|
| 30 | #define HASH_LENGTH1 (SYS_HASH_BASE+0x28)
|
| 31 | #define HASH_LENGTH2 (SYS_HASH_BASE+0x24)
|
| 32 | #define HASH_LENGTH3 (SYS_HASH_BASE+0x20)
|
| 33 | #define HASH_RESULT (SYS_HASH_BASE+0x30)
|
| 34 | #define HASH_HMACKEY (SYS_HASH_BASE+0x70)
|
| 35 |
|
| 36 | //Çý¶¯ÊÇ·ñÖ§³ÖËùÓеÄģʽ£¬ÓÃÓÚ¼ò»¯´úÂëÁ¿
|
| 37 | //#define HASH_CODE_SUPPORT_ALL
|
| 38 |
|
| 39 | #define HASH_MODE_MD5 0x0
|
| 40 | #ifdef HASH_CODE_SUPPORT_ALL
|
| 41 | #define HASH_MODE_SHA1 0x1
|
| 42 | #define HASH_MODE_SHA224 0x2
|
| 43 | #define HASH_MODE_SHA256 0x3
|
| 44 | #define HASH_MODE_SHA384 0x4
|
| 45 | #define HASH_MODE_SHA512 0x5
|
| 46 | #define HASH_MODE_HMAC_MD5 (HASH_MODE_MD5|0x10)
|
| 47 | #define HASH_MODE_HMAC_SHA1 (HASH_MODE_SHA1|0x10)
|
| 48 | #define HASH_MODE_HMAC_SHA224 (HASH_MODE_SHA224|0x10)
|
| 49 | #define HASH_MODE_HMAC_SHA256 (HASH_MODE_SHA256|0x10)
|
| 50 | #define HASH_MODE_HMAC_SHA384 (HASH_MODE_SHA384|0x10)
|
| 51 | #define HASH_MODE_HMAC_SHA512 (HASH_MODE_SHA512|0x10)
|
| 52 | #endif
|
| 53 |
|
| 54 | #define HASH_SMALL_ENDIAN 0
|
| 55 | #define HASH_BIG_ENDIAN 1
|
| 56 |
|
| 57 | u32 Hash_Calculate(u32 udMode, u32 udBigEndian, u32* ploadAddr, u32 loadLen, u32* pHmacKey, u32* HmacKey_len, u32* HashResult, u32* ResultLen);
|
| 58 |
|
| 59 | #endif
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|