| OLD | NEW |
| 1 /* crypto/md4/md4.h */ | 1 /* crypto/md4/md4.h */ |
| 2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * This package is an SSL implementation written | 5 * This package is an SSL implementation written |
| 6 * by Eric Young (eay@cryptsoft.com). | 6 * by Eric Young (eay@cryptsoft.com). |
| 7 * The implementation was written so as to conform with Netscapes SSL. | 7 * The implementation was written so as to conform with Netscapes SSL. |
| 8 * | 8 * |
| 9 * This library is free for commercial and non-commercial use as long as | 9 * This library is free for commercial and non-commercial use as long as |
| 10 * the following conditions are aheared to. The following conditions | 10 * the following conditions are aheared to. The following conditions |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 #ifndef HEADER_MD4_H | 59 #ifndef HEADER_MD4_H |
| 60 #define HEADER_MD4_H | 60 #define HEADER_MD4_H |
| 61 | 61 |
| 62 #include <openssl/e_os2.h> | 62 #include <openssl/e_os2.h> |
| 63 #include <stddef.h> | 63 #include <stddef.h> |
| 64 | 64 |
| 65 #ifdef __cplusplus | 65 #ifdef __cplusplus |
| 66 extern "C" { | 66 extern "C" { |
| 67 #endif | 67 #endif |
| 68 | 68 |
| 69 #include <stddef.h> | |
| 70 | |
| 71 #ifdef OPENSSL_NO_MD4 | 69 #ifdef OPENSSL_NO_MD4 |
| 72 #error MD4 is disabled. | 70 #error MD4 is disabled. |
| 73 #endif | 71 #endif |
| 74 | 72 |
| 75 /* | 73 /* |
| 76 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 74 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 77 * ! MD4_LONG has to be at least 32 bits wide. If it's wider, then ! | 75 * ! MD4_LONG has to be at least 32 bits wide. If it's wider, then ! |
| 78 * ! MD4_LONG_LOG2 has to be defined along. ! | 76 * ! MD4_LONG_LOG2 has to be defined along. ! |
| 79 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 77 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 80 */ | 78 */ |
| 81 | 79 |
| 82 #if defined(OPENSSL_SYS_WIN16) || defined(__LP32__) | 80 #if defined(__LP32__) |
| 83 #define MD4_LONG unsigned long | 81 #define MD4_LONG unsigned long |
| 84 #elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) | 82 #elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) |
| 85 #define MD4_LONG unsigned long | 83 #define MD4_LONG unsigned long |
| 86 #define MD4_LONG_LOG2 3 | 84 #define MD4_LONG_LOG2 3 |
| 87 /* | 85 /* |
| 88 * _CRAY note. I could declare short, but I have no idea what impact | 86 * _CRAY note. I could declare short, but I have no idea what impact |
| 89 * does it have on performance on none-T3E machines. I could declare | 87 * does it have on performance on none-T3E machines. I could declare |
| 90 * int, but at least on C90 sizeof(int) can be chosen at compile time. | 88 * int, but at least on C90 sizeof(int) can be chosen at compile time. |
| 91 * So I've chosen long... | 89 * So I've chosen long... |
| 92 * <appro@fy.chalmers.se> | 90 * <appro@fy.chalmers.se> |
| 93 */ | 91 */ |
| 94 #else | 92 #else |
| 95 #define MD4_LONG unsigned int | 93 #define MD4_LONG unsigned int |
| 96 #endif | 94 #endif |
| 97 | 95 |
| 98 #define MD4_CBLOCK 64 | 96 #define MD4_CBLOCK 64 |
| 99 #define MD4_LBLOCK (MD4_CBLOCK/4) | 97 #define MD4_LBLOCK (MD4_CBLOCK/4) |
| 100 #define MD4_DIGEST_LENGTH 16 | 98 #define MD4_DIGEST_LENGTH 16 |
| 101 | 99 |
| 102 typedef struct MD4state_st | 100 typedef struct MD4state_st |
| 103 { | 101 { |
| 104 MD4_LONG A,B,C,D; | 102 MD4_LONG A,B,C,D; |
| 105 MD4_LONG Nl,Nh; | 103 MD4_LONG Nl,Nh; |
| 106 MD4_LONG data[MD4_LBLOCK]; | 104 MD4_LONG data[MD4_LBLOCK]; |
| 107 unsigned int num; | 105 unsigned int num; |
| 108 } MD4_CTX; | 106 } MD4_CTX; |
| 109 | 107 |
| 110 #ifdef OPENSSL_FIPS | |
| 111 int private_MD4_Init(MD4_CTX *c); | |
| 112 #endif | |
| 113 int MD4_Init(MD4_CTX *c); | 108 int MD4_Init(MD4_CTX *c); |
| 114 int MD4_Update(MD4_CTX *c, const void *data, size_t len); | 109 int MD4_Update(MD4_CTX *c, const void *data, size_t len); |
| 115 int MD4_Final(unsigned char *md, MD4_CTX *c); | 110 int MD4_Final(unsigned char *md, MD4_CTX *c); |
| 116 unsigned char *MD4(const unsigned char *d, size_t n, unsigned char *md); | 111 unsigned char *MD4(const unsigned char *d, size_t n, unsigned char *md); |
| 117 void MD4_Transform(MD4_CTX *c, const unsigned char *b); | 112 void MD4_Transform(MD4_CTX *c, const unsigned char *b); |
| 118 #ifdef __cplusplus | 113 #ifdef __cplusplus |
| 119 } | 114 } |
| 120 #endif | 115 #endif |
| 121 | 116 |
| 122 #endif | 117 #endif |
| OLD | NEW |