Add inclusion of internal/evp_int.h to all crypto/ files that need it
[openssl.git] / crypto / evp / m_wp.c
1 /* crypto/evp/m_wp.c */
2
3 #include <stdio.h>
4 #include "internal/cryptlib.h"
5
6 #ifndef OPENSSL_NO_WHIRLPOOL
7
8 # include <openssl/evp.h>
9 # include <openssl/objects.h>
10 # include <openssl/x509.h>
11 # include <openssl/whrlpool.h>
12 # include "internal/evp_int.h"
13
14 static int init(EVP_MD_CTX *ctx)
15 {
16     return WHIRLPOOL_Init(EVP_MD_CTX_md_data(ctx));
17 }
18
19 static int update(EVP_MD_CTX *ctx, const void *data, size_t count)
20 {
21     return WHIRLPOOL_Update(EVP_MD_CTX_md_data(ctx), data, count);
22 }
23
24 static int final(EVP_MD_CTX *ctx, unsigned char *md)
25 {
26     return WHIRLPOOL_Final(md, EVP_MD_CTX_md_data(ctx));
27 }
28
29 static const EVP_MD whirlpool_md = {
30     NID_whirlpool,
31     0,
32     WHIRLPOOL_DIGEST_LENGTH,
33     0,
34     init,
35     update,
36     final,
37     NULL,
38     NULL,
39     WHIRLPOOL_BBLOCK / 8,
40     sizeof(EVP_MD *) + sizeof(WHIRLPOOL_CTX),
41 };
42
43 const EVP_MD *EVP_whirlpool(void)
44 {
45     return (&whirlpool_md);
46 }
47 #endif