sha1.h
来自「BestCrypt开源加密原代码」· C头文件 代码 · 共 73 行
H
73 行
/******************************************************************* * * Copyright (c) 1994-1999 Jetico, Inc., Finland * All rights reserved. * * File: sha1.h * Revision: $Id: sha1.h,v 1.2 2002/10/29 07:11:46 crypt Rel-1.6-5 $ * Created: * Description: declaration of SHA-1 Secure Hash Algorithm * external procedures * *******************************************************************//* * SHA1 message-digest algorithm. */#ifndef __SHA1_H__#define __SHA1_H__#define SHA1_DIGEST_SIZE 20#define SHA1_ERROR_NO 0x0#define SHA1_ERROR_INTERNAL_ERROR 0x1typedef unsigned char byte;typedef unsigned int DWORD;/* The structure for storing SHA context */typedef struct SHA1Context_{ DWORD digest[5]; /* Message digest */ DWORD countLo, countHi; /* 64-bit byte count */ DWORD data[16]; /* SHA data buffer */} SHA1Context;int SHA1Init(void *context, byte *key, size_t key_size);int SHA1Process(void *context, byte *data, size_t length);int SHA1Update(void *context, byte *data);int SHA1Final(void *context, byte *digest);int SHA1Allocate(void **context);int SHA1Free(void **context);int SHA1MakeDigest( byte *message, int messageLength, byte *digest );/* * On the Intel processors Circular Shift Left operation * (Rotation Left) may be done as one command for processor *//* #define __INTEL_PLATFORM */#ifdef __INTEL_PLATFORM #define ROL(X, n) _asm rol X, n#else #define ROL( X, n ) ( ( ( X ) << n ) | ( ( X ) >> ( 32 - n ) ) )#endif#endif /* __SHA1_H__ */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?