diff options
Diffstat (limited to 'src/lib/libcrypto/evp/m_gost2814789.c')
-rw-r--r-- | src/lib/libcrypto/evp/m_gost2814789.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/lib/libcrypto/evp/m_gost2814789.c b/src/lib/libcrypto/evp/m_gost2814789.c index ff3f489e46..279af872e0 100644 --- a/src/lib/libcrypto/evp/m_gost2814789.c +++ b/src/lib/libcrypto/evp/m_gost2814789.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: m_gost2814789.c,v 1.1 2014/11/09 19:17:13 miod Exp $ */ | 1 | /* $OpenBSD: m_gost2814789.c,v 1.2 2014/11/09 23:06:50 miod Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 3 | * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> |
4 | * Copyright (c) 2005-2006 Cryptocom LTD | 4 | * Copyright (c) 2005-2006 Cryptocom LTD |
@@ -56,22 +56,27 @@ | |||
56 | #include <openssl/gost.h> | 56 | #include <openssl/gost.h> |
57 | #include <openssl/objects.h> | 57 | #include <openssl/objects.h> |
58 | 58 | ||
59 | static int init(EVP_MD_CTX *ctx) | 59 | static int |
60 | gost2814789_init(EVP_MD_CTX *ctx) | ||
60 | { | 61 | { |
61 | return GOST2814789IMIT_Init(ctx->md_data, NID_id_Gost28147_89_CryptoPro_A_ParamSet); | 62 | return GOST2814789IMIT_Init(ctx->md_data, |
63 | NID_id_Gost28147_89_CryptoPro_A_ParamSet); | ||
62 | } | 64 | } |
63 | 65 | ||
64 | static int update(EVP_MD_CTX *ctx, const void *data, size_t count) | 66 | static int |
67 | gost2814789_update(EVP_MD_CTX *ctx, const void *data, size_t count) | ||
65 | { | 68 | { |
66 | return GOST2814789IMIT_Update(ctx->md_data, data, count); | 69 | return GOST2814789IMIT_Update(ctx->md_data, data, count); |
67 | } | 70 | } |
68 | 71 | ||
69 | static int final(EVP_MD_CTX *ctx, unsigned char *md) | 72 | static int |
73 | gost2814789_final(EVP_MD_CTX *ctx, unsigned char *md) | ||
70 | { | 74 | { |
71 | return GOST2814789IMIT_Final(md, ctx->md_data); | 75 | return GOST2814789IMIT_Final(md, ctx->md_data); |
72 | } | 76 | } |
73 | 77 | ||
74 | static int md_ctrl(EVP_MD_CTX *ctx, int cmd, int p1, void *p2) | 78 | static int |
79 | gost2814789_md_ctrl(EVP_MD_CTX *ctx, int cmd, int p1, void *p2) | ||
75 | { | 80 | { |
76 | GOST2814789IMIT_CTX *gctx = ctx->md_data; | 81 | GOST2814789IMIT_CTX *gctx = ctx->md_data; |
77 | 82 | ||
@@ -89,12 +94,12 @@ static const EVP_MD gost2814789imit_md = { | |||
89 | .pkey_type = NID_undef, | 94 | .pkey_type = NID_undef, |
90 | .md_size = GOST2814789IMIT_LENGTH, | 95 | .md_size = GOST2814789IMIT_LENGTH, |
91 | .flags = 0, | 96 | .flags = 0, |
92 | .init = init, | 97 | .init = gost2814789_init, |
93 | .update = update, | 98 | .update = gost2814789_update, |
94 | .final = final, | 99 | .final = gost2814789_final, |
95 | .block_size = GOST2814789IMIT_CBLOCK, | 100 | .block_size = GOST2814789IMIT_CBLOCK, |
96 | .ctx_size = sizeof(EVP_MD *) + sizeof(GOST2814789IMIT_CTX), | 101 | .ctx_size = sizeof(EVP_MD *) + sizeof(GOST2814789IMIT_CTX), |
97 | .md_ctrl = md_ctrl, | 102 | .md_ctrl = gost2814789_md_ctrl, |
98 | }; | 103 | }; |
99 | 104 | ||
100 | const EVP_MD * | 105 | const EVP_MD * |