summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/gost/gostr341001_key.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/gost/gostr341001_key.c')
-rw-r--r--src/lib/libcrypto/gost/gostr341001_key.c15
1 files changed, 14 insertions, 1 deletions
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