From 7d380ba4ad7be8f47e3610ce7c3586a408d8eac7 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Wed, 4 Sep 2019 11:45:42 +0800 Subject: [PATCH] Make VKO_compute_key public. --- gost_ec_keyx.c | 8 ++++---- gost_lcl.h | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gost_ec_keyx.c b/gost_ec_keyx.c index cc94d67..b82c6f1 100644 --- a/gost_ec_keyx.c +++ b/gost_ec_keyx.c @@ -18,10 +18,10 @@ #include "gost_lcl.h" /* Implementation of CryptoPro VKO 34.10-2001/2012 algorithm */ -static int VKO_compute_key(unsigned char *shared_key, - const EC_POINT *pub_key, const EC_KEY *priv_key, - const unsigned char *ukm, const size_t ukm_size, - const int vko_dgst_nid) +int VKO_compute_key(unsigned char *shared_key, + const EC_POINT *pub_key, const EC_KEY *priv_key, + const unsigned char *ukm, const size_t ukm_size, + const int vko_dgst_nid) { unsigned char *databuf = NULL; BIGNUM *UKM = NULL, *p = NULL, *order = NULL, *X = NULL, *Y = NULL, *cofactor = NULL; diff --git a/gost_lcl.h b/gost_lcl.h index 15ff31e..bb25ce3 100644 --- a/gost_lcl.h +++ b/gost_lcl.h @@ -265,6 +265,12 @@ int gost_ec_verify(const unsigned char *dgst, int dgst_len, ECDSA_SIG *sig, EC_KEY *ec); int gost_ec_compute_public(EC_KEY *ec); +/* VKO */ +int VKO_compute_key(unsigned char *shared_key, + const EC_POINT *pub_key, const EC_KEY *priv_key, + const unsigned char *ukm, const size_t ukm_size, + const int vko_dgst_nid); + /* KDF TREE */ int gost_kdftree2012_256(unsigned char *keyout, size_t keyout_len, const unsigned char *key, size_t keylen, -- 2.39.2