diff options
Diffstat (limited to 'src/lib/libcrypto/gost/gostr341001_key.c')
-rw-r--r-- | src/lib/libcrypto/gost/gostr341001_key.c | 15 |
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 | } |
91 | LCRYPTO_ALIAS(GOST_KEY_new); | ||
91 | 92 | ||
92 | void | 93 | void |
93 | GOST_KEY_free(GOST_KEY *r) | 94 | GOST_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 | } |
111 | LCRYPTO_ALIAS(GOST_KEY_free); | ||
110 | 112 | ||
111 | int | 113 | int |
112 | GOST_KEY_check_key(const GOST_KEY *key) | 114 | GOST_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 | } |
181 | LCRYPTO_ALIAS(GOST_KEY_check_key); | ||
179 | 182 | ||
180 | int | 183 | int |
181 | GOST_KEY_set_public_key_affine_coordinates(GOST_KEY *key, BIGNUM *x, BIGNUM *y) | 184 | GOST_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 | } |
238 | LCRYPTO_ALIAS(GOST_KEY_set_public_key_affine_coordinates); | ||
235 | 239 | ||
236 | const EC_GROUP * | 240 | const EC_GROUP * |
237 | GOST_KEY_get0_group(const GOST_KEY *key) | 241 | GOST_KEY_get0_group(const GOST_KEY *key) |
238 | { | 242 | { |
239 | return key->group; | 243 | return key->group; |
240 | } | 244 | } |
245 | LCRYPTO_ALIAS(GOST_KEY_get0_group); | ||
241 | 246 | ||
242 | int | 247 | int |
243 | GOST_KEY_set_group(GOST_KEY *key, const EC_GROUP *group) | 248 | GOST_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 | } |
254 | LCRYPTO_ALIAS(GOST_KEY_set_group); | ||
249 | 255 | ||
250 | const BIGNUM * | 256 | const BIGNUM * |
251 | GOST_KEY_get0_private_key(const GOST_KEY *key) | 257 | GOST_KEY_get0_private_key(const GOST_KEY *key) |
252 | { | 258 | { |
253 | return key->priv_key; | 259 | return key->priv_key; |
254 | } | 260 | } |
261 | LCRYPTO_ALIAS(GOST_KEY_get0_private_key); | ||
255 | 262 | ||
256 | int | 263 | int |
257 | GOST_KEY_set_private_key(GOST_KEY *key, const BIGNUM *priv_key) | 264 | GOST_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 | } |
270 | LCRYPTO_ALIAS(GOST_KEY_set_private_key); | ||
263 | 271 | ||
264 | const EC_POINT * | 272 | const EC_POINT * |
265 | GOST_KEY_get0_public_key(const GOST_KEY *key) | 273 | GOST_KEY_get0_public_key(const GOST_KEY *key) |
266 | { | 274 | { |
267 | return key->pub_key; | 275 | return key->pub_key; |
268 | } | 276 | } |
277 | LCRYPTO_ALIAS(GOST_KEY_get0_public_key); | ||
269 | 278 | ||
270 | int | 279 | int |
271 | GOST_KEY_set_public_key(GOST_KEY *key, const EC_POINT *pub_key) | 280 | GOST_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 | } |
286 | LCRYPTO_ALIAS(GOST_KEY_set_public_key); | ||
277 | 287 | ||
278 | int | 288 | int |
279 | GOST_KEY_get_digest(const GOST_KEY *key) | 289 | GOST_KEY_get_digest(const GOST_KEY *key) |
280 | { | 290 | { |
281 | return key->digest_nid; | 291 | return key->digest_nid; |
282 | } | 292 | } |
293 | LCRYPTO_ALIAS(GOST_KEY_get_digest); | ||
283 | int | 294 | int |
284 | GOST_KEY_set_digest(GOST_KEY *key, int digest_nid) | 295 | GOST_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 | } |
306 | LCRYPTO_ALIAS(GOST_KEY_set_digest); | ||
295 | 307 | ||
296 | size_t | 308 | size_t |
297 | GOST_KEY_get_size(const GOST_KEY *r) | 309 | GOST_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 | } |
333 | LCRYPTO_ALIAS(GOST_KEY_get_size); | ||
321 | #endif | 334 | #endif |