/**---------------------------------------------------------------@n | |
* °æÈ¨ËùÓÐ(C)2011, ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾ | |
* | |
* ÎļþÃû³Æ: drv_hash.h | |
* ÄÚÈÝÕªÒª: HASHÉ豸linuxÇý¶¯³ÌÐòÍ·Îļþ | |
* ÆäËû˵Ã÷: | |
* | |
* -------------------------------------------------------------- | |
* Ð޸ļǼ1: // ÐÞ¸ÄÀúÊ·¼Ç¼£¬°üÀ¨ÐÞ¸ÄÈÕÆÚ¡¢ÐÞ¸ÄÕß¼°ÐÞ¸ÄÄÚÈÝ | |
* ÐÞ¸ÄÈÕÆÚ: | |
* °æ ±¾ ºÅ: | |
* ÐÞ ¸Ä ÈË: | |
* ÐÞ¸ÄÄÚÈÝ: | |
* | |
* ---------------------------------------------------------*/ | |
#ifndef DRV_HASH_H | |
#define DRV_HASH_H | |
#include <common.h> | |
#define SYS_HASH_BASE 0x0121d000 | |
#define HASH_CONTROL (SYS_HASH_BASE+0x04) | |
#define HASH_START (SYS_HASH_BASE+0x08) | |
#define HASH_DATA (SYS_HASH_BASE+0x10) | |
#define HASH_INTSTATUS (SYS_HASH_BASE+0x1c) | |
#define HASH_LENGTH0 (SYS_HASH_BASE+0x2c) | |
#define HASH_LENGTH1 (SYS_HASH_BASE+0x28) | |
#define HASH_LENGTH2 (SYS_HASH_BASE+0x24) | |
#define HASH_LENGTH3 (SYS_HASH_BASE+0x20) | |
#define HASH_RESULT (SYS_HASH_BASE+0x30) | |
#define HASH_HMACKEY (SYS_HASH_BASE+0x70) | |
//Çý¶¯ÊÇ·ñÖ§³ÖËùÓеÄģʽ£¬ÓÃÓÚ¼ò»¯´úÂëÁ¿ | |
//#define HASH_CODE_SUPPORT_ALL | |
#define HASH_MODE_MD5 0x0 | |
#ifdef HASH_CODE_SUPPORT_ALL | |
#define HASH_MODE_SHA1 0x1 | |
#define HASH_MODE_SHA224 0x2 | |
#define HASH_MODE_SHA256 0x3 | |
#define HASH_MODE_SHA384 0x4 | |
#define HASH_MODE_SHA512 0x5 | |
#define HASH_MODE_HMAC_MD5 (HASH_MODE_MD5|0x10) | |
#define HASH_MODE_HMAC_SHA1 (HASH_MODE_SHA1|0x10) | |
#define HASH_MODE_HMAC_SHA224 (HASH_MODE_SHA224|0x10) | |
#define HASH_MODE_HMAC_SHA256 (HASH_MODE_SHA256|0x10) | |
#define HASH_MODE_HMAC_SHA384 (HASH_MODE_SHA384|0x10) | |
#define HASH_MODE_HMAC_SHA512 (HASH_MODE_SHA512|0x10) | |
#endif | |
#define HASH_SMALL_ENDIAN 0 | |
#define HASH_BIG_ENDIAN 1 | |
u32 Hash_Calculate(u32 udMode, u32 udBigEndian, u32* ploadAddr, u32 loadLen, u32* pHmacKey, u32* HmacKey_len, u32* HashResult, u32* ResultLen); | |
#endif | |