summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbeck <>2023-07-08 14:30:44 +0000
committerbeck <>2023-07-08 14:30:44 +0000
commitcfe8c9ef5ce212d7cb6e1b00c34a8835dd08c925 (patch)
treed6dd28c1801839068b08deddc4ab13ba80a5ef44
parentb22b791de1d8ce36154a6857c1471a1cb64eb2ec (diff)
downloadopenbsd-cfe8c9ef5ce212d7cb6e1b00c34a8835dd08c925.tar.gz
openbsd-cfe8c9ef5ce212d7cb6e1b00c34a8835dd08c925.tar.bz2
openbsd-cfe8c9ef5ce212d7cb6e1b00c34a8835dd08c925.zip
Hide symbols in gost.
ok tb@ after some puking in his mouth.
-rw-r--r--src/lib/libcrypto/Symbols.namespace42
-rw-r--r--src/lib/libcrypto/gost/gost2814789.c10
-rw-r--r--src/lib/libcrypto/gost/gost89_params.c4
-rw-r--r--src/lib/libcrypto/gost/gost_asn1.c4
-rw-r--r--src/lib/libcrypto/gost/gost_err.c1
-rw-r--r--src/lib/libcrypto/gost/gostr341001_key.c15
-rw-r--r--src/lib/libcrypto/gost/gostr341194.c7
-rw-r--r--src/lib/libcrypto/gost/streebog.c11
-rw-r--r--src/lib/libcrypto/hidden/openssl/gost.h71
9 files changed, 160 insertions, 5 deletions
diff --git a/src/lib/libcrypto/Symbols.namespace b/src/lib/libcrypto/Symbols.namespace
index 7676e45f90..6e6d27bd4e 100644
--- a/src/lib/libcrypto/Symbols.namespace
+++ b/src/lib/libcrypto/Symbols.namespace
@@ -2631,3 +2631,45 @@ _libre_DSA_meth_set1_name
2631_libre_DSA_meth_set_sign 2631_libre_DSA_meth_set_sign
2632_libre_DSA_meth_set_finish 2632_libre_DSA_meth_set_finish
2633_libre_ERR_load_DSA_strings 2633_libre_ERR_load_DSA_strings
2634_libre_Gost2814789_set_sbox
2635_libre_Gost2814789_set_key
2636_libre_Gost2814789_ecb_encrypt
2637_libre_Gost2814789_cfb64_encrypt
2638_libre_Gost2814789_cnt_encrypt
2639_libre_GOST_CIPHER_PARAMS_new
2640_libre_GOST_CIPHER_PARAMS_free
2641_libre_d2i_GOST_CIPHER_PARAMS
2642_libre_i2d_GOST_CIPHER_PARAMS
2643_libre_GOST2814789IMIT_Init
2644_libre_GOST2814789IMIT_Update
2645_libre_GOST2814789IMIT_Final
2646_libre_GOST2814789IMIT_Transform
2647_libre_GOST2814789IMIT
2648_libre_GOSTR341194_Init
2649_libre_GOSTR341194_Update
2650_libre_GOSTR341194_Final
2651_libre_GOSTR341194_Transform
2652_libre_GOSTR341194
2653_libre_STREEBOG256_Init
2654_libre_STREEBOG256_Update
2655_libre_STREEBOG256_Final
2656_libre_STREEBOG256
2657_libre_STREEBOG512_Init
2658_libre_STREEBOG512_Update
2659_libre_STREEBOG512_Final
2660_libre_STREEBOG512_Transform
2661_libre_STREEBOG512
2662_libre_GOST_KEY_new
2663_libre_GOST_KEY_free
2664_libre_GOST_KEY_check_key
2665_libre_GOST_KEY_set_public_key_affine_coordinates
2666_libre_GOST_KEY_get0_group
2667_libre_GOST_KEY_set_group
2668_libre_GOST_KEY_get_digest
2669_libre_GOST_KEY_set_digest
2670_libre_GOST_KEY_get0_private_key
2671_libre_GOST_KEY_set_private_key
2672_libre_GOST_KEY_get0_public_key
2673_libre_GOST_KEY_set_public_key
2674_libre_GOST_KEY_get_size
2675_libre_ERR_load_GOST_strings
diff --git a/src/lib/libcrypto/gost/gost2814789.c b/src/lib/libcrypto/gost/gost2814789.c
index 1e0f17da43..dac3a8eab8 100644
--- a/src/lib/libcrypto/gost/gost2814789.c
+++ b/src/lib/libcrypto/gost/gost2814789.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: gost2814789.c,v 1.8 2022/11/26 16:08:53 tb Exp $ */ 1/* $OpenBSD: gost2814789.c,v 1.9 2023/07/08 14:30:44 beck 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
@@ -180,6 +180,7 @@ Gost2814789_ecb_encrypt(const unsigned char *in, unsigned char *out,
180 else 180 else
181 Gost2814789_decrypt(in, out, key); 181 Gost2814789_decrypt(in, out, key);
182} 182}
183LCRYPTO_ALIAS(Gost2814789_ecb_encrypt);
183 184
184static inline void 185static inline void
185Gost2814789_encrypt_mesh(unsigned char *iv, GOST2814789_KEY *key) 186Gost2814789_encrypt_mesh(unsigned char *iv, GOST2814789_KEY *key)
@@ -318,6 +319,7 @@ Gost2814789_cfb64_encrypt(const unsigned char *in, unsigned char *out,
318 *num = n; 319 *num = n;
319 } 320 }
320} 321}
322LCRYPTO_ALIAS(Gost2814789_cfb64_encrypt);
321 323
322static inline void 324static inline void
323Gost2814789_cnt_next(unsigned char *ivec, unsigned char *out, 325Gost2814789_cnt_next(unsigned char *ivec, unsigned char *out,
@@ -403,6 +405,7 @@ Gost2814789_cnt_encrypt(const unsigned char *in, unsigned char *out, size_t len,
403 405
404 *num=n; 406 *num=n;
405} 407}
408LCRYPTO_ALIAS(Gost2814789_cnt_encrypt);
406 409
407int 410int
408GOST2814789IMIT_Init(GOST2814789IMIT_CTX *c, int nid) 411GOST2814789IMIT_Init(GOST2814789IMIT_CTX *c, int nid)
@@ -411,6 +414,7 @@ GOST2814789IMIT_Init(GOST2814789IMIT_CTX *c, int nid)
411 memset(c->mac, 0, 8); 414 memset(c->mac, 0, 8);
412 return Gost2814789_set_sbox(&c->cipher, nid); 415 return Gost2814789_set_sbox(&c->cipher, nid);
413} 416}
417LCRYPTO_ALIAS(GOST2814789IMIT_Init);
414 418
415static void 419static void
416GOST2814789IMIT_block_data_order(GOST2814789IMIT_CTX *ctx, 420GOST2814789IMIT_block_data_order(GOST2814789IMIT_CTX *ctx,
@@ -435,6 +439,8 @@ GOST2814789IMIT_block_data_order(GOST2814789IMIT_CTX *ctx,
435#define HASH_BLOCK_DATA_ORDER GOST2814789IMIT_block_data_order 439#define HASH_BLOCK_DATA_ORDER GOST2814789IMIT_block_data_order
436 440
437#include "md32_common.h" 441#include "md32_common.h"
442LCRYPTO_ALIAS(GOST2814789IMIT_Update);
443LCRYPTO_ALIAS(GOST2814789IMIT_Transform);
438 444
439int 445int
440GOST2814789IMIT_Final(unsigned char *md, GOST2814789IMIT_CTX *c) 446GOST2814789IMIT_Final(unsigned char *md, GOST2814789IMIT_CTX *c)
@@ -450,6 +456,7 @@ GOST2814789IMIT_Final(unsigned char *md, GOST2814789IMIT_CTX *c)
450 memcpy(md, c->mac, 4); 456 memcpy(md, c->mac, 4);
451 return 1; 457 return 1;
452} 458}
459LCRYPTO_ALIAS(GOST2814789IMIT_Final);
453 460
454unsigned char * 461unsigned char *
455GOST2814789IMIT(const unsigned char *d, size_t n, unsigned char *md, int nid, 462GOST2814789IMIT(const unsigned char *d, size_t n, unsigned char *md, int nid,
@@ -468,5 +475,6 @@ GOST2814789IMIT(const unsigned char *d, size_t n, unsigned char *md, int nid,
468 explicit_bzero(&c, sizeof(c)); 475 explicit_bzero(&c, sizeof(c));
469 return (md); 476 return (md);
470} 477}
478LCRYPTO_ALIAS(GOST2814789IMIT);
471 479
472#endif 480#endif
diff --git a/src/lib/libcrypto/gost/gost89_params.c b/src/lib/libcrypto/gost/gost89_params.c
index 9c4a97ee6d..ef9c9cde6b 100644
--- a/src/lib/libcrypto/gost/gost89_params.c
+++ b/src/lib/libcrypto/gost/gost89_params.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: gost89_params.c,v 1.3 2022/11/26 16:08:53 tb Exp $ */ 1/* $OpenBSD: gost89_params.c,v 1.4 2023/07/08 14:30:44 beck 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
@@ -211,6 +211,7 @@ Gost2814789_set_sbox(GOST2814789_KEY *key, int nid)
211 211
212 return 1; 212 return 1;
213} 213}
214LCRYPTO_ALIAS(Gost2814789_set_sbox);
214 215
215int 216int
216Gost2814789_set_key(GOST2814789_KEY *key, const unsigned char *userKey, 217Gost2814789_set_key(GOST2814789_KEY *key, const unsigned char *userKey,
@@ -228,6 +229,7 @@ Gost2814789_set_key(GOST2814789_KEY *key, const unsigned char *userKey,
228 229
229 return 1; 230 return 1;
230} 231}
232LCRYPTO_ALIAS(Gost2814789_set_key);
231 233
232void 234void
233Gost2814789_cryptopro_key_mesh(GOST2814789_KEY *key) 235Gost2814789_cryptopro_key_mesh(GOST2814789_KEY *key)
diff --git a/src/lib/libcrypto/gost/gost_asn1.c b/src/lib/libcrypto/gost/gost_asn1.c
index d83ded55b1..28e3a58e53 100644
--- a/src/lib/libcrypto/gost/gost_asn1.c
+++ b/src/lib/libcrypto/gost/gost_asn1.c
@@ -273,23 +273,27 @@ d2i_GOST_CIPHER_PARAMS(GOST_CIPHER_PARAMS **a, const unsigned char **in, long le
273 return (GOST_CIPHER_PARAMS *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, 273 return (GOST_CIPHER_PARAMS *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
274 &GOST_CIPHER_PARAMS_it); 274 &GOST_CIPHER_PARAMS_it);
275} 275}
276LCRYPTO_ALIAS(d2i_GOST_CIPHER_PARAMS);
276 277
277int 278int
278i2d_GOST_CIPHER_PARAMS(GOST_CIPHER_PARAMS *a, unsigned char **out) 279i2d_GOST_CIPHER_PARAMS(GOST_CIPHER_PARAMS *a, unsigned char **out)
279{ 280{
280 return ASN1_item_i2d((ASN1_VALUE *)a, out, &GOST_CIPHER_PARAMS_it); 281 return ASN1_item_i2d((ASN1_VALUE *)a, out, &GOST_CIPHER_PARAMS_it);
281} 282}
283LCRYPTO_ALIAS(i2d_GOST_CIPHER_PARAMS);
282 284
283GOST_CIPHER_PARAMS * 285GOST_CIPHER_PARAMS *
284GOST_CIPHER_PARAMS_new(void) 286GOST_CIPHER_PARAMS_new(void)
285{ 287{
286 return (GOST_CIPHER_PARAMS *)ASN1_item_new(&GOST_CIPHER_PARAMS_it); 288 return (GOST_CIPHER_PARAMS *)ASN1_item_new(&GOST_CIPHER_PARAMS_it);
287} 289}
290LCRYPTO_ALIAS(GOST_CIPHER_PARAMS_new);
288 291
289void 292void
290GOST_CIPHER_PARAMS_free(GOST_CIPHER_PARAMS *a) 293GOST_CIPHER_PARAMS_free(GOST_CIPHER_PARAMS *a)
291{ 294{
292 ASN1_item_free((ASN1_VALUE *)a, &GOST_CIPHER_PARAMS_it); 295 ASN1_item_free((ASN1_VALUE *)a, &GOST_CIPHER_PARAMS_it);
293} 296}
297LCRYPTO_ALIAS(GOST_CIPHER_PARAMS_free);
294 298
295#endif 299#endif
diff --git a/src/lib/libcrypto/gost/gost_err.c b/src/lib/libcrypto/gost/gost_err.c
index 0c46dbc36c..380f60289e 100644
--- a/src/lib/libcrypto/gost/gost_err.c
+++ b/src/lib/libcrypto/gost/gost_err.c
@@ -103,3 +103,4 @@ ERR_load_GOST_strings(void) {
103 } 103 }
104#endif 104#endif
105} 105}
106LCRYPTO_ALIAS(ERR_load_GOST_strings);
diff --git a/src/lib/libcrypto/gost/gostr341001_key.c b/src/lib/libcrypto/gost/gostr341001_key.c
index 62694318d5..efc9e57452 100644
--- a/src/lib/libcrypto/gost/gostr341001_key.c
+++ b/src/lib/libcrypto/gost/gostr341001_key.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: gostr341001_key.c,v 1.12 2023/03/07 09:27:10 jsing Exp $ */ 1/* $OpenBSD: gostr341001_key.c,v 1.13 2023/07/08 14:30:44 beck 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
@@ -88,6 +88,7 @@ GOST_KEY_new(void)
88 ret->digest_nid = NID_undef; 88 ret->digest_nid = NID_undef;
89 return (ret); 89 return (ret);
90} 90}
91LCRYPTO_ALIAS(GOST_KEY_new);
91 92
92void 93void
93GOST_KEY_free(GOST_KEY *r) 94GOST_KEY_free(GOST_KEY *r)
@@ -107,6 +108,7 @@ GOST_KEY_free(GOST_KEY *r)
107 108
108 freezero(r, sizeof(GOST_KEY)); 109 freezero(r, sizeof(GOST_KEY));
109} 110}
111LCRYPTO_ALIAS(GOST_KEY_free);
110 112
111int 113int
112GOST_KEY_check_key(const GOST_KEY *key) 114GOST_KEY_check_key(const GOST_KEY *key)
@@ -176,6 +178,7 @@ err:
176 EC_POINT_free(point); 178 EC_POINT_free(point);
177 return (ok); 179 return (ok);
178} 180}
181LCRYPTO_ALIAS(GOST_KEY_check_key);
179 182
180int 183int
181GOST_KEY_set_public_key_affine_coordinates(GOST_KEY *key, BIGNUM *x, BIGNUM *y) 184GOST_KEY_set_public_key_affine_coordinates(GOST_KEY *key, BIGNUM *x, BIGNUM *y)
@@ -232,12 +235,14 @@ err:
232 return ok; 235 return ok;
233 236
234} 237}
238LCRYPTO_ALIAS(GOST_KEY_set_public_key_affine_coordinates);
235 239
236const EC_GROUP * 240const EC_GROUP *
237GOST_KEY_get0_group(const GOST_KEY *key) 241GOST_KEY_get0_group(const GOST_KEY *key)
238{ 242{
239 return key->group; 243 return key->group;
240} 244}
245LCRYPTO_ALIAS(GOST_KEY_get0_group);
241 246
242int 247int
243GOST_KEY_set_group(GOST_KEY *key, const EC_GROUP *group) 248GOST_KEY_set_group(GOST_KEY *key, const EC_GROUP *group)
@@ -246,12 +251,14 @@ GOST_KEY_set_group(GOST_KEY *key, const EC_GROUP *group)
246 key->group = EC_GROUP_dup(group); 251 key->group = EC_GROUP_dup(group);
247 return (key->group == NULL) ? 0 : 1; 252 return (key->group == NULL) ? 0 : 1;
248} 253}
254LCRYPTO_ALIAS(GOST_KEY_set_group);
249 255
250const BIGNUM * 256const BIGNUM *
251GOST_KEY_get0_private_key(const GOST_KEY *key) 257GOST_KEY_get0_private_key(const GOST_KEY *key)
252{ 258{
253 return key->priv_key; 259 return key->priv_key;
254} 260}
261LCRYPTO_ALIAS(GOST_KEY_get0_private_key);
255 262
256int 263int
257GOST_KEY_set_private_key(GOST_KEY *key, const BIGNUM *priv_key) 264GOST_KEY_set_private_key(GOST_KEY *key, const BIGNUM *priv_key)
@@ -260,12 +267,14 @@ GOST_KEY_set_private_key(GOST_KEY *key, const BIGNUM *priv_key)
260 key->priv_key = BN_dup(priv_key); 267 key->priv_key = BN_dup(priv_key);
261 return (key->priv_key == NULL) ? 0 : 1; 268 return (key->priv_key == NULL) ? 0 : 1;
262} 269}
270LCRYPTO_ALIAS(GOST_KEY_set_private_key);
263 271
264const EC_POINT * 272const EC_POINT *
265GOST_KEY_get0_public_key(const GOST_KEY *key) 273GOST_KEY_get0_public_key(const GOST_KEY *key)
266{ 274{
267 return key->pub_key; 275 return key->pub_key;
268} 276}
277LCRYPTO_ALIAS(GOST_KEY_get0_public_key);
269 278
270int 279int
271GOST_KEY_set_public_key(GOST_KEY *key, const EC_POINT *pub_key) 280GOST_KEY_set_public_key(GOST_KEY *key, const EC_POINT *pub_key)
@@ -274,12 +283,14 @@ GOST_KEY_set_public_key(GOST_KEY *key, const EC_POINT *pub_key)
274 key->pub_key = EC_POINT_dup(pub_key, key->group); 283 key->pub_key = EC_POINT_dup(pub_key, key->group);
275 return (key->pub_key == NULL) ? 0 : 1; 284 return (key->pub_key == NULL) ? 0 : 1;
276} 285}
286LCRYPTO_ALIAS(GOST_KEY_set_public_key);
277 287
278int 288int
279GOST_KEY_get_digest(const GOST_KEY *key) 289GOST_KEY_get_digest(const GOST_KEY *key)
280{ 290{
281 return key->digest_nid; 291 return key->digest_nid;
282} 292}
293LCRYPTO_ALIAS(GOST_KEY_get_digest);
283int 294int
284GOST_KEY_set_digest(GOST_KEY *key, int digest_nid) 295GOST_KEY_set_digest(GOST_KEY *key, int digest_nid)
285{ 296{
@@ -292,6 +303,7 @@ GOST_KEY_set_digest(GOST_KEY *key, int digest_nid)
292 303
293 return 0; 304 return 0;
294} 305}
306LCRYPTO_ALIAS(GOST_KEY_set_digest);
295 307
296size_t 308size_t
297GOST_KEY_get_size(const GOST_KEY *r) 309GOST_KEY_get_size(const GOST_KEY *r)
@@ -318,4 +330,5 @@ GOST_KEY_get_size(const GOST_KEY *r)
318 BN_free(order); 330 BN_free(order);
319 return (i); 331 return (i);
320} 332}
333LCRYPTO_ALIAS(GOST_KEY_get_size);
321#endif 334#endif
diff --git a/src/lib/libcrypto/gost/gostr341194.c b/src/lib/libcrypto/gost/gostr341194.c
index 63058300a3..311c304539 100644
--- a/src/lib/libcrypto/gost/gostr341194.c
+++ b/src/lib/libcrypto/gost/gostr341194.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: gostr341194.c,v 1.6 2022/11/26 16:08:53 tb Exp $ */ 1/* $OpenBSD: gostr341194.c,v 1.7 2023/07/08 14:30:44 beck 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
@@ -205,6 +205,7 @@ GOSTR341194_Init(GOSTR341194_CTX *c, int nid)
205 memset(c, 0, sizeof(*c)); 205 memset(c, 0, sizeof(*c));
206 return Gost2814789_set_sbox(&c->cipher, nid); 206 return Gost2814789_set_sbox(&c->cipher, nid);
207} 207}
208LCRYPTO_ALIAS(GOSTR341194_Init);
208 209
209static void 210static void
210GOSTR341194_block_data_order(GOSTR341194_CTX *ctx, const unsigned char *p, 211GOSTR341194_block_data_order(GOSTR341194_CTX *ctx, const unsigned char *p,
@@ -230,6 +231,8 @@ GOSTR341194_block_data_order(GOSTR341194_CTX *ctx, const unsigned char *p,
230#define HASH_BLOCK_DATA_ORDER GOSTR341194_block_data_order 231#define HASH_BLOCK_DATA_ORDER GOSTR341194_block_data_order
231 232
232#include "md32_common.h" 233#include "md32_common.h"
234LCRYPTO_ALIAS(GOSTR341194_Update);
235LCRYPTO_ALIAS(GOSTR341194_Transform);
233 236
234int 237int
235GOSTR341194_Final(unsigned char *md, GOSTR341194_CTX * c) 238GOSTR341194_Final(unsigned char *md, GOSTR341194_CTX * c)
@@ -254,6 +257,7 @@ GOSTR341194_Final(unsigned char *md, GOSTR341194_CTX * c)
254 257
255 return 1; 258 return 1;
256} 259}
260LCRYPTO_ALIAS(GOSTR341194_Final);
257 261
258unsigned char * 262unsigned char *
259GOSTR341194(const unsigned char *d, size_t n, unsigned char *md, int nid) 263GOSTR341194(const unsigned char *d, size_t n, unsigned char *md, int nid)
@@ -270,4 +274,5 @@ GOSTR341194(const unsigned char *d, size_t n, unsigned char *md, int nid)
270 explicit_bzero(&c, sizeof(c)); 274 explicit_bzero(&c, sizeof(c));
271 return (md); 275 return (md);
272} 276}
277LCRYPTO_ALIAS(GOSTR341194);
273#endif 278#endif
diff --git a/src/lib/libcrypto/gost/streebog.c b/src/lib/libcrypto/gost/streebog.c
index 2785fca619..60c575794c 100644
--- a/src/lib/libcrypto/gost/streebog.c
+++ b/src/lib/libcrypto/gost/streebog.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: streebog.c,v 1.8 2022/11/26 16:08:53 tb Exp $ */ 1/* $OpenBSD: streebog.c,v 1.9 2023/07/08 14:30:44 beck 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
@@ -1365,12 +1365,14 @@ STREEBOG512_Final(unsigned char *md, STREEBOG_CTX *c)
1365 1365
1366 return 1; 1366 return 1;
1367} 1367}
1368LCRYPTO_ALIAS(STREEBOG512_Final);
1368 1369
1369int 1370int
1370STREEBOG256_Final(unsigned char *md, STREEBOG_CTX * c) 1371STREEBOG256_Final(unsigned char *md, STREEBOG_CTX * c)
1371{ 1372{
1372 return STREEBOG512_Final(md, c); 1373 return STREEBOG512_Final(md, c);
1373} 1374}
1375LCRYPTO_ALIAS(STREEBOG256_Final);
1374 1376
1375int 1377int
1376STREEBOG512_Update(STREEBOG_CTX *c, const void *_data, size_t len) 1378STREEBOG512_Update(STREEBOG_CTX *c, const void *_data, size_t len)
@@ -1411,18 +1413,21 @@ STREEBOG512_Update(STREEBOG_CTX *c, const void *_data, size_t len)
1411 1413
1412 return 1; 1414 return 1;
1413} 1415}
1416LCRYPTO_ALIAS(STREEBOG512_Update);
1414 1417
1415int 1418int
1416STREEBOG256_Update(STREEBOG_CTX *c, const void *data, size_t len) 1419STREEBOG256_Update(STREEBOG_CTX *c, const void *data, size_t len)
1417{ 1420{
1418 return STREEBOG512_Update(c, data, len); 1421 return STREEBOG512_Update(c, data, len);
1419} 1422}
1423LCRYPTO_ALIAS(STREEBOG256_Update);
1420 1424
1421void 1425void
1422STREEBOG512_Transform(STREEBOG_CTX *c, const unsigned char *data) 1426STREEBOG512_Transform(STREEBOG_CTX *c, const unsigned char *data)
1423{ 1427{
1424 streebog_block_data_order(c, data, 1); 1428 streebog_block_data_order(c, data, 1);
1425} 1429}
1430LCRYPTO_ALIAS(STREEBOG512_Transform);
1426 1431
1427int 1432int
1428STREEBOG256_Init(STREEBOG_CTX *c) 1433STREEBOG256_Init(STREEBOG_CTX *c)
@@ -1433,6 +1438,7 @@ STREEBOG256_Init(STREEBOG_CTX *c)
1433 c->md_len = STREEBOG256_LENGTH; 1438 c->md_len = STREEBOG256_LENGTH;
1434 return 1; 1439 return 1;
1435} 1440}
1441LCRYPTO_ALIAS(STREEBOG256_Init);
1436 1442
1437int 1443int
1438STREEBOG512_Init(STREEBOG_CTX *c) 1444STREEBOG512_Init(STREEBOG_CTX *c)
@@ -1444,6 +1450,7 @@ STREEBOG512_Init(STREEBOG_CTX *c)
1444 c->md_len = STREEBOG512_LENGTH; 1450 c->md_len = STREEBOG512_LENGTH;
1445 return 1; 1451 return 1;
1446} 1452}
1453LCRYPTO_ALIAS(STREEBOG512_Init);
1447 1454
1448unsigned char * 1455unsigned char *
1449STREEBOG256(const unsigned char *d, size_t n, unsigned char *md) 1456STREEBOG256(const unsigned char *d, size_t n, unsigned char *md)
@@ -1459,6 +1466,7 @@ STREEBOG256(const unsigned char *d, size_t n, unsigned char *md)
1459 explicit_bzero(&c, sizeof(c)); 1466 explicit_bzero(&c, sizeof(c));
1460 return (md); 1467 return (md);
1461} 1468}
1469LCRYPTO_ALIAS(STREEBOG256);
1462 1470
1463unsigned char * 1471unsigned char *
1464STREEBOG512(const unsigned char *d, size_t n, unsigned char *md) 1472STREEBOG512(const unsigned char *d, size_t n, unsigned char *md)
@@ -1474,5 +1482,6 @@ STREEBOG512(const unsigned char *d, size_t n, unsigned char *md)
1474 explicit_bzero(&c, sizeof(c)); 1482 explicit_bzero(&c, sizeof(c));
1475 return (md); 1483 return (md);
1476} 1484}
1485LCRYPTO_ALIAS(STREEBOG512);
1477 1486
1478#endif 1487#endif
diff --git a/src/lib/libcrypto/hidden/openssl/gost.h b/src/lib/libcrypto/hidden/openssl/gost.h
new file mode 100644
index 0000000000..e30e6611af
--- /dev/null
+++ b/src/lib/libcrypto/hidden/openssl/gost.h
@@ -0,0 +1,71 @@
1/* $OpenBSD: gost.h,v 1.1 2023/07/08 14:30:44 beck Exp $ */
2/*
3 * Copyright (c) 2023 Bob Beck <beck@openbsd.org>
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18#ifndef _LIBCRYPTO_GOST_H
19#define _LIBCRYPTO_GOST_H
20
21#ifndef _MSC_VER
22#include_next <openssl/gost.h>
23#else
24#include "../include/openssl/gost.h"
25#endif
26#include "crypto_namespace.h"
27
28LCRYPTO_USED(Gost2814789_set_sbox);
29LCRYPTO_USED(Gost2814789_set_key);
30LCRYPTO_USED(Gost2814789_ecb_encrypt);
31LCRYPTO_USED(Gost2814789_cfb64_encrypt);
32LCRYPTO_USED(Gost2814789_cnt_encrypt);
33LCRYPTO_USED(GOST_CIPHER_PARAMS_new);
34LCRYPTO_USED(GOST_CIPHER_PARAMS_free);
35LCRYPTO_USED(d2i_GOST_CIPHER_PARAMS);
36LCRYPTO_USED(i2d_GOST_CIPHER_PARAMS);
37LCRYPTO_USED(GOST2814789IMIT_Init);
38LCRYPTO_USED(GOST2814789IMIT_Update);
39LCRYPTO_USED(GOST2814789IMIT_Final);
40LCRYPTO_USED(GOST2814789IMIT_Transform);
41LCRYPTO_USED(GOST2814789IMIT);
42LCRYPTO_USED(GOSTR341194_Init);
43LCRYPTO_USED(GOSTR341194_Update);
44LCRYPTO_USED(GOSTR341194_Final);
45LCRYPTO_USED(GOSTR341194_Transform);
46LCRYPTO_USED(GOSTR341194);
47LCRYPTO_USED(STREEBOG256_Init);
48LCRYPTO_USED(STREEBOG256_Update);
49LCRYPTO_USED(STREEBOG256_Final);
50LCRYPTO_USED(STREEBOG256);
51LCRYPTO_USED(STREEBOG512_Init);
52LCRYPTO_USED(STREEBOG512_Update);
53LCRYPTO_USED(STREEBOG512_Final);
54LCRYPTO_USED(STREEBOG512_Transform);
55LCRYPTO_USED(STREEBOG512);
56LCRYPTO_USED(GOST_KEY_new);
57LCRYPTO_USED(GOST_KEY_free);
58LCRYPTO_USED(GOST_KEY_check_key);
59LCRYPTO_USED(GOST_KEY_set_public_key_affine_coordinates);
60LCRYPTO_USED(GOST_KEY_get0_group);
61LCRYPTO_USED(GOST_KEY_set_group);
62LCRYPTO_USED(GOST_KEY_get_digest);
63LCRYPTO_USED(GOST_KEY_set_digest);
64LCRYPTO_USED(GOST_KEY_get0_private_key);
65LCRYPTO_USED(GOST_KEY_set_private_key);
66LCRYPTO_USED(GOST_KEY_get0_public_key);
67LCRYPTO_USED(GOST_KEY_set_public_key);
68LCRYPTO_USED(GOST_KEY_get_size);
69LCRYPTO_USED(ERR_load_GOST_strings);
70
71#endif /* _LIBCRYPTO_GOST_H */