summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/m_streebog.c
diff options
context:
space:
mode:
authormiod <>2014-11-09 23:06:52 +0000
committermiod <>2014-11-09 23:06:52 +0000
commit5e0d7292a5c4ca2fd250914d9a0878c0cd5823c4 (patch)
treeb5ab6541799b27d966cb82da9df9e0fb55b9236b /src/lib/libcrypto/evp/m_streebog.c
parent9cb69d828dde1cb87a2f0c992067f541e6629179 (diff)
downloadopenbsd-5e0d7292a5c4ca2fd250914d9a0878c0cd5823c4.tar.gz
openbsd-5e0d7292a5c4ca2fd250914d9a0878c0cd5823c4.tar.bz2
openbsd-5e0d7292a5c4ca2fd250914d9a0878c0cd5823c4.zip
KNF (when not conflicting with other cleanup changes in progress)
Diffstat (limited to 'src/lib/libcrypto/evp/m_streebog.c')
-rw-r--r--src/lib/libcrypto/evp/m_streebog.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/src/lib/libcrypto/evp/m_streebog.c b/src/lib/libcrypto/evp/m_streebog.c
index cf4b159f43..882c7852bb 100644
--- a/src/lib/libcrypto/evp/m_streebog.c
+++ b/src/lib/libcrypto/evp/m_streebog.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_streebog.c,v 1.1 2014/11/09 19:17:13 miod Exp $ */ 1/* $OpenBSD: m_streebog.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
@@ -57,32 +57,38 @@
57#include <openssl/gost.h> 57#include <openssl/gost.h>
58#include <openssl/objects.h> 58#include <openssl/objects.h>
59 59
60static int init256(EVP_MD_CTX *ctx) 60static int
61streebog_init256(EVP_MD_CTX *ctx)
61{ 62{
62 return STREEBOG256_Init(ctx->md_data); 63 return STREEBOG256_Init(ctx->md_data);
63} 64}
64 65
65static int update256(EVP_MD_CTX *ctx, const void *data, size_t count) 66static int
67streebog_update256(EVP_MD_CTX *ctx, const void *data, size_t count)
66{ 68{
67 return STREEBOG256_Update(ctx->md_data, data, count); 69 return STREEBOG256_Update(ctx->md_data, data, count);
68} 70}
69 71
70static int final256(EVP_MD_CTX *ctx, unsigned char *md) 72static int
73streebog_final256(EVP_MD_CTX *ctx, unsigned char *md)
71{ 74{
72 return STREEBOG256_Final(md, ctx->md_data); 75 return STREEBOG256_Final(md, ctx->md_data);
73} 76}
74 77
75static int init512(EVP_MD_CTX *ctx) 78static int
79streebog_init512(EVP_MD_CTX *ctx)
76{ 80{
77 return STREEBOG512_Init(ctx->md_data); 81 return STREEBOG512_Init(ctx->md_data);
78} 82}
79 83
80static int update512(EVP_MD_CTX *ctx, const void *data, size_t count) 84static int
85streebog_update512(EVP_MD_CTX *ctx, const void *data, size_t count)
81{ 86{
82 return STREEBOG512_Update(ctx->md_data, data, count); 87 return STREEBOG512_Update(ctx->md_data, data, count);
83} 88}
84 89
85static int final512(EVP_MD_CTX *ctx, unsigned char *md) 90static int
91streebog_final512(EVP_MD_CTX *ctx, unsigned char *md)
86{ 92{
87 return STREEBOG512_Final(md, ctx->md_data); 93 return STREEBOG512_Final(md, ctx->md_data);
88} 94}
@@ -92,9 +98,9 @@ static const EVP_MD streebog256_md = {
92 .pkey_type = NID_undef, 98 .pkey_type = NID_undef,
93 .md_size = STREEBOG256_LENGTH, 99 .md_size = STREEBOG256_LENGTH,
94 .flags = EVP_MD_FLAG_PKEY_METHOD_SIGNATURE, 100 .flags = EVP_MD_FLAG_PKEY_METHOD_SIGNATURE,
95 .init = init256, 101 .init = streebog_init256,
96 .update = update256, 102 .update = streebog_update256,
97 .final = final256, 103 .final = streebog_final256,
98 .block_size = STREEBOG_CBLOCK, 104 .block_size = STREEBOG_CBLOCK,
99 .ctx_size = sizeof(EVP_MD *) + sizeof(STREEBOG_CTX), 105 .ctx_size = sizeof(EVP_MD *) + sizeof(STREEBOG_CTX),
100}; 106};
@@ -104,9 +110,9 @@ static const EVP_MD streebog512_md = {
104 .pkey_type = NID_undef, 110 .pkey_type = NID_undef,
105 .md_size = STREEBOG512_LENGTH, 111 .md_size = STREEBOG512_LENGTH,
106 .flags = EVP_MD_FLAG_PKEY_METHOD_SIGNATURE, 112 .flags = EVP_MD_FLAG_PKEY_METHOD_SIGNATURE,
107 .init = init512, 113 .init = streebog_init512,
108 .update = update512, 114 .update = streebog_update512,
109 .final = final512, 115 .final = streebog_final512,
110 .block_size = STREEBOG_CBLOCK, 116 .block_size = STREEBOG_CBLOCK,
111 .ctx_size = sizeof(EVP_MD *) + sizeof(STREEBOG_CTX), 117 .ctx_size = sizeof(EVP_MD *) + sizeof(STREEBOG_CTX),
112}; 118};