Go to the documentation of this file.
112 #ifndef HEADER_RAND_LCL_H
113 #define HEADER_RAND_LCL_H
115 #define ENTROPY_NEEDED 32
118 #if !defined(USE_MD5_RAND) && !defined(USE_SHA1_RAND) && !defined(USE_MDC2_RAND) && !defined(USE_MD2_RAND)
119 #if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1)
120 #define USE_SHA1_RAND
121 #elif !defined(OPENSSL_NO_MD5)
123 #elif !defined(OPENSSL_NO_MDC2) && !defined(OPENSSL_NO_DES)
124 #define USE_MDC2_RAND
125 #elif !defined(OPENSSL_NO_MD2)
128 #error No message digest algorithm available
133 #define MD_Update(a,b,c) EVP_DigestUpdate(a,b,c)
134 #define MD_Final(a,b) EVP_DigestFinal_ex(a,b,NULL)
135 #if defined(USE_MD5_RAND)
137 #define MD_DIGEST_LENGTH MD5_DIGEST_LENGTH
138 #define MD_Init(a) EVP_DigestInit_ex(a,EVP_md5(), NULL)
139 #define MD(a,b,c) EVP_Digest(a,b,c,NULL,EVP_md5(), NULL)
140 #elif defined(USE_SHA1_RAND)
142 #define MD_DIGEST_LENGTH SHA_DIGEST_LENGTH
143 #define MD_Init(a) EVP_DigestInit_ex(a,EVP_sha1(), NULL)
144 #define MD(a,b,c) EVP_Digest(a,b,c,NULL,EVP_sha1(), NULL)
145 #elif defined(USE_MDC2_RAND)
147 #define MD_DIGEST_LENGTH MDC2_DIGEST_LENGTH
148 #define MD_Init(a) EVP_DigestInit_ex(a,EVP_mdc2(), NULL)
149 #define MD(a,b,c) EVP_Digest(a,b,c,NULL,EVP_mdc2(), NULL)
150 #elif defined(USE_MD2_RAND)
151 #include <openssl/md2.h>
152 #define MD_DIGEST_LENGTH MD2_DIGEST_LENGTH
153 #define MD_Init(a) EVP_DigestInit_ex(a,EVP_md2(), NULL)
154 #define MD(a,b,c) EVP_Digest(a,b,c,NULL,EVP_md2(), NULL)