Sha.h
上传用户:lds876
上传日期:2013-05-25
资源大小:567k
文件大小:1k
- // Sha.h: interface for the CSha class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_SHA_H__146DC207_2B92_4B1E_8DEE_42E570884678__INCLUDED_)
- #define AFX_SHA_H__146DC207_2B92_4B1E_8DEE_42E570884678__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #define uint8 unsigned char
- #define uint32 unsigned long int
- struct sha1_context
- {
- uint32 total[2];
- uint32 state[5];
- uint8 buffer[64];
- };
- void sha1_starts( struct sha1_context *ctx );
- void sha1_update( struct sha1_context *ctx, uint8 *input, uint32 length );
- void sha1_finish( struct sha1_context *ctx, uint8 digest[20] );
- class CSHA
- {
- public:
- void start();
- void update(uint8 *input, uint32 length );
- void finish(uint8 digest[20] );
- private:
- sha1_context m_ctx;
- };
- #endif // !defined(AFX_SHA_H__146DC207_2B92_4B1E_8DEE_42E570884678__INCLUDED_)