]> git.ipfire.org Git - thirdparty/openssl.git/blob - crypto/evp/m_wp.c
Run util/openssl-format-source -v -c .
[thirdparty/openssl.git] / crypto / evp / m_wp.c
1 /* crypto/evp/m_wp.c */
2
3 #include <stdio.h>
4 #include "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
13 static int init(EVP_MD_CTX *ctx)
14 {
15 return WHIRLPOOL_Init(ctx->md_data);
16 }
17
18 static int update(EVP_MD_CTX *ctx, const void *data, size_t count)
19 {
20 return WHIRLPOOL_Update(ctx->md_data, data, count);
21 }
22
23 static int final(EVP_MD_CTX *ctx, unsigned char *md)
24 {
25 return WHIRLPOOL_Final(md, ctx->md_data);
26 }
27
28 static const EVP_MD whirlpool_md = {
29 NID_whirlpool,
30 0,
31 WHIRLPOOL_DIGEST_LENGTH,
32 0,
33 init,
34 update,
35 final,
36 NULL,
37 NULL,
38 EVP_PKEY_NULL_method,
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