《OSPF协议完全实现》源代码


《OSPF协议完全实现》原书附带源代码,原书光盘内代码
资源截图
代码片段和文件信息
/* MD5C.C - RSA Data Security Inc. MD5 message-digest algorithm
 */

/* Copyright (C) 1991-2 RSA Data Security Inc. Created 1991. All
rights reserved.

License to copy and use this software is granted provided that it
is identified as the “RSA Data Security Inc. MD5 Message-Digest
Algorithm“ in all material mentioning or referencing this software
or this function.

License is also granted to make and use derivative works provided
that such works are identified as “derived from the RSA Data
Security Inc. MD5 Message-Digest Algorithm“ in all material
mentioning or referencing the derived work.

RSA Data Security Inc. makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided “as is“
without express or implied warranty of any kind.

These notices must be retained in any copies of any part of this
documentation and/or software.
 */

#include “global.h“
#include “md5.h“

/* Constants for MD5Transform routine.
 */


#define S11 7
#define S12 12
#define S13 17
#define S14 22
#define S21 5
#define S22 9
#define S23 14
#define S24 20
#define S31 4
#define S32 11
#define S33 16
#define S34 23
#define S41 6
#define S42 10
#define S43 15
#define S44 21

static void MD5Transform PROTO_LIST ((UINT4 [4] unsigned char [64]));
static void Encode PROTO_LIST
  ((unsigned char * UINT4 * unsigned int));
static void Decode PROTO_LIST
  ((UINT4 * unsigned char * unsigned int));
static void MD5_memcpy PROTO_LIST ((POINTER POINTER unsigned int));
static void MD5_memset PROTO_LIST ((POINTER int unsigned int));

static unsigned char PADDING[64] = {
  0x80 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
};

/* F G H and I are basic MD5 functions.
 */
#define F(x y z) (((x) & (y)) | ((~x) & (z)))
#define G(x y z) (((x) & (z)) | ((y) & (~z)))
#define H(x y z) ((x) ^ (y) ^ (z))
#define I(x y z) ((y) ^ ((x) | (~z)))

/* ROTATE_LEFT rotates x left n bits.
 */
#define ROTATE_LEFT(x n) (((x) << (n)) | ((x) >> (32-(n))))

/* FF GG HH and II transformations for rounds 1 2 3 and 4.
Rotation is separate from addition to prevent recomputation.
 */
#define FF(a b c d x s ac) { 
 (a) += F ((b) (c) (d)) + (x) + (UINT4)(ac); 
 (a) = ROTATE_LEFT ((a) (s)); 
 (a) += (b); 
  }
#define GG(a b c d x s ac) { 
 (a) += G ((b) (c) (d)) + (x) + (UINT4)(ac); 
 (a) = ROTATE_LEFT ((a) (s)); 
 (a) += (b); 
  }
#define HH(a b c d x s ac) { 
 (a) += H ((b) (c) (d)) + (x) + (UINT4)(ac); 
 (a) = ROTATE_LEFT ((a) (s)); 
 (a) += (b); 
  }
#define II(a b c d x s ac) { 
 (a) += I ((b) (c) (d)) + (x) + (UINT4)(ac); 
 (a) = ROTATE_LEFT ((a) (s)); 
 (a) += (b); 
  }

/* MD5 initialization. Begi

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2008-05-07 10:07  0201309661_CDROM
     目录           0  2008-05-07 10:07  0201309661_CDROMospfd
     文件        6148  2005-04-20 12:28  0201309661_CDROMospfd.DS_Store
     目录           0  2008-05-12 10:17  __MACOSX
     目录           0  2008-05-12 10:17  __MACOSX201309661_CDROM
     目录           0  2008-05-12 10:17  __MACOSX201309661_CDROMospfd
     文件          82  2005-04-20 12:28  __MACOSX201309661_CDROMospfd._.DS_Store
     目录           0  2008-05-07 10:07  0201309661_CDROMospfdlinux
     文件        6194  1999-07-26 08:36  0201309661_CDROMospfdlinuxlinux.C
     目录           0  2008-05-12 10:17  __MACOSX201309661_CDROMospfdlinux
     文件          82  1999-07-26 08:36  __MACOSX201309661_CDROMospfdlinux._linux.C
     文件        1873  1999-07-14 11:06  0201309661_CDROMospfdlinuxlinux.h
     文件          82  1999-07-14 11:06  __MACOSX201309661_CDROMospfdlinux._linux.h
     文件        7367  1999-08-09 10:09  0201309661_CDROMospfdlinuxlsa_prn.C
     文件          82  1999-08-09 10:09  __MACOSX201309661_CDROMospfdlinux._lsa_prn.C
     文件        2619  1999-07-08 16:19  0201309661_CDROMospfdlinuxmachdep.h
     文件          82  1999-07-08 16:19  __MACOSX201309661_CDROMospfdlinux._machdep.h
     文件        1640  1999-07-19 10:06  0201309661_CDROMospfdlinuxMakefile
     文件          82  1999-07-19 10:06  __MACOSX201309661_CDROMospfdlinux._Makefile
     文件       14508  1999-08-05 08:57  0201309661_CDROMospfdlinuxospfd.tcl
     文件          82  1999-08-05 08:57  __MACOSX201309661_CDROMospfdlinux._ospfd.tcl
     文件       37338  1999-08-04 09:42  0201309661_CDROMospfdlinuxospfd_browser.C
     文件          82  1999-08-04 09:42  __MACOSX201309661_CDROMospfdlinux._ospfd_browser.C
     文件       19710  1999-08-05 08:58  0201309661_CDROMospfdlinuxospfd_linux.C
     文件          82  1999-08-05 08:58  __MACOSX201309661_CDROMospfdlinux._ospfd_linux.C
     文件        3631  1999-07-08 15:51  0201309661_CDROMospfdlinuxospfd_linux.h
     文件          82  1999-07-08 15:51  __MACOSX201309661_CDROMospfdlinux._ospfd_linux.h
     文件       20073  1999-08-02 11:30  0201309661_CDROMospfdlinuxospfd_mon.C
     文件          82  1999-08-02 11:30  __MACOSX201309661_CDROMospfdlinux._ospfd_mon.C
     文件        8220  1999-04-25 11:36  0201309661_CDROMospfdlinuxsystem.C
     文件          82  1999-04-25 11:36  __MACOSX201309661_CDROMospfdlinux._system.C
............此处省略455个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)