⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 radius_message_digest.h

📁 vxworks下radius协议栈 的源代码
💻 H
字号:
/* radius_message_digest.h *//* Performs HMAC_MD5 algorithm *//* Copyright 1984 - 2000 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history____________________01a,14mar02,md  create for EAP support*/#ifndef __INCradius_message_digesth#define __INCradius_message_digesthtypedef	_struct	MD_CONTEXT{  ULONG state[4];                                   /* state (ABCD) */  ULONG count[2];        /* number of bits, modulo 2^64 (lsb first) */  BYTE buffer[64];                         /* input buffer */} _pack MD_CONTEXT;/* POINTER defines a generic pointer type */typedef BYTE *POINTER; /* ROTATE_LEFT rotates x left n bits. */#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))/* MD4 transform definitions appear here ...*//* Constants for MD4Transform routine.*/#define MD4_S11 3#define MD4_S12 7#define MD4_S13 11#define MD4_S14 19#define MD4_S21 3#define MD4_S22 5#define MD4_S23 9#define MD4_S24 13#define MD4_S31 3#define MD4_S32 9#define MD4_S33 11#define MD4_S34 15/* F, G, and H are basic MD4 functions. */#define MD4_F(x, y, z) (((x) & (y)) | ((~x) & (z)))#define MD4_G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z)))#define MD4_H(x, y, z) ((x) ^ (y) ^ (z))/* FF, GG, and HH transformations for rounds 1, 2, and 3. Rotation is separate from addition to prevent recomputation. */#define MD4_FF(a, b, c, d, x, s) { \    (a) += MD4_F ((b), (c), (d)) + (x); \    (a) = ROTATE_LEFT ((a), (s)); \  }#define MD4_GG(a, b, c, d, x, s) { \    (a) += MD4_G ((b), (c), (d)) + (x) + (ULONG)0x5a827999; \    (a) = ROTATE_LEFT ((a), (s)); \  }#define MD4_HH(a, b, c, d, x, s) { \    (a) += MD4_H ((b), (c), (d)) + (x) + (ULONG)0x6ed9eba1; \    (a) = ROTATE_LEFT ((a), (s)); \  }/* MD5 transform definitions appear here ...*/ /* Constants for MD5Transform routine.*/#define MD5_S11 7#define MD5_S12 12#define MD5_S13 17#define MD5_S14 22#define MD5_S21 5#define MD5_S22 9#define MD5_S23 14#define MD5_S24 20#define MD5_S31 4#define MD5_S32 11#define MD5_S33 16#define MD5_S34 23#define MD5_S41 6#define MD5_S42 10#define MD5_S43 15#define MD5_S44 21/* F, G, H and I are basic MD5 functions. */#define MD5_F(x, y, z) (((x) & (y)) | ((~x) & (z)))#define MD5_G(x, y, z) (((x) & (z)) | ((y) & (~z)))#define MD5_H(x, y, z) ((x) ^ (y) ^ (z))#define MD5_I(x, y, z) ((y) ^ ((x) | (~z)))/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. Rotation is separate from addition to prevent recomputation. */#define MD5_FF(a, b, c, d, x, s, ac) { \	(a) += MD5_F ((b), (c), (d)) + (x) + (ULONG)(ac); \	(a) = ROTATE_LEFT ((a), (s)); \	(a) += (b); \ 	}#define MD5_GG(a, b, c, d, x, s, ac) { \	(a) += MD5_G ((b), (c), (d)) + (x) + (ULONG)(ac); \	(a) = ROTATE_LEFT ((a), (s)); \	(a) += (b); \ 	}#define MD5_HH(a, b, c, d, x, s, ac) { \	(a) += MD5_H ((b), (c), (d)) + (x) + (ULONG)(ac); \	(a) = ROTATE_LEFT ((a), (s)); \	(a) += (b); \ 	}#define MD5_II(a, b, c, d, x, s, ac) { \	(a) += MD5_I ((b), (c), (d)) + (x) + (ULONG)(ac); \	(a) = ROTATE_LEFT ((a), (s)); \	(a) += (b); \ 	}void radius_hmac_md5 (unsigned char*, int, unsigned char*, int, caddr_t);#endif	/* __INCradius_message_digesth */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -