]> www.wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - gost_md2012.c
MSVC: Avoid use `htonl' since it requires linking with Winsock
[openssl-gost/engine.git] / gost_md2012.c
index 8d1bde8d8e0912e48e942acb943ffe6195015b9a..3ea1e3642855cb7644001d6e221d886ae198ec84 100644 (file)
@@ -1,6 +1,7 @@
 /**********************************************************************
  *                          gost_md2012.c                             *
  *             Copyright (c) 2013 Cryptocom LTD.                      *
+ *             Copyright (c) 2020 Vitaly Chikunov <vt@altlinux.org>   *
  *         This file is distributed under the same license as OpenSSL *
  *                                                                    *
  *          GOST R 34.11-2012 interface to OpenSSL engine.            *
@@ -39,40 +40,22 @@ GOST_digest GostR3411_2012_template_digest = {
 
 GOST_digest GostR3411_2012_256_digest = {
     .nid = NID_id_GostR3411_2012_256,
+    .alias = "streebog256",
     .template = &GostR3411_2012_template_digest,
     .result_size = 32,
     .init = gost_digest_init256,
     .ctrl = gost_digest_ctrl_256,
 };
 
-EVP_MD *digest_gost2012_256(void)
-{
-    return GOST_init_digest(&GostR3411_2012_256_digest);
-}
-
-void digest_gost2012_256_destroy(void)
-{
-    GOST_deinit_digest(&GostR3411_2012_256_digest);
-}
-
 GOST_digest GostR3411_2012_512_digest = {
     .nid = NID_id_GostR3411_2012_512,
+    .alias = "streebog512",
     .template = &GostR3411_2012_template_digest,
     .result_size = 64,
     .init = gost_digest_init512,
     .ctrl = gost_digest_ctrl_512,
 };
 
-EVP_MD *digest_gost2012_512(void)
-{
-    return GOST_init_digest(&GostR3411_2012_512_digest);
-}
-
-void digest_gost2012_512_destroy(void)
-{
-    GOST_deinit_digest(&GostR3411_2012_512_digest);
-}
-
 static int gost_digest_init512(EVP_MD_CTX *ctx)
 {
     init_gost2012_hash_ctx((gost2012_hash_ctx *) EVP_MD_CTX_md_data(ctx),