ok tb@ after some puking in his mouth.
_libre_DSA_meth_set_sign
_libre_DSA_meth_set_finish
_libre_ERR_load_DSA_strings
+_libre_Gost2814789_set_sbox
+_libre_Gost2814789_set_key
+_libre_Gost2814789_ecb_encrypt
+_libre_Gost2814789_cfb64_encrypt
+_libre_Gost2814789_cnt_encrypt
+_libre_GOST_CIPHER_PARAMS_new
+_libre_GOST_CIPHER_PARAMS_free
+_libre_d2i_GOST_CIPHER_PARAMS
+_libre_i2d_GOST_CIPHER_PARAMS
+_libre_GOST2814789IMIT_Init
+_libre_GOST2814789IMIT_Update
+_libre_GOST2814789IMIT_Final
+_libre_GOST2814789IMIT_Transform
+_libre_GOST2814789IMIT
+_libre_GOSTR341194_Init
+_libre_GOSTR341194_Update
+_libre_GOSTR341194_Final
+_libre_GOSTR341194_Transform
+_libre_GOSTR341194
+_libre_STREEBOG256_Init
+_libre_STREEBOG256_Update
+_libre_STREEBOG256_Final
+_libre_STREEBOG256
+_libre_STREEBOG512_Init
+_libre_STREEBOG512_Update
+_libre_STREEBOG512_Final
+_libre_STREEBOG512_Transform
+_libre_STREEBOG512
+_libre_GOST_KEY_new
+_libre_GOST_KEY_free
+_libre_GOST_KEY_check_key
+_libre_GOST_KEY_set_public_key_affine_coordinates
+_libre_GOST_KEY_get0_group
+_libre_GOST_KEY_set_group
+_libre_GOST_KEY_get_digest
+_libre_GOST_KEY_set_digest
+_libre_GOST_KEY_get0_private_key
+_libre_GOST_KEY_set_private_key
+_libre_GOST_KEY_get0_public_key
+_libre_GOST_KEY_set_public_key
+_libre_GOST_KEY_get_size
+_libre_ERR_load_GOST_strings
-/* $OpenBSD: gost2814789.c,v 1.8 2022/11/26 16:08:53 tb Exp $ */
+/* $OpenBSD: gost2814789.c,v 1.9 2023/07/08 14:30:44 beck Exp $ */
/*
* Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* Copyright (c) 2005-2006 Cryptocom LTD
else
Gost2814789_decrypt(in, out, key);
}
+LCRYPTO_ALIAS(Gost2814789_ecb_encrypt);
static inline void
Gost2814789_encrypt_mesh(unsigned char *iv, GOST2814789_KEY *key)
*num = n;
}
}
+LCRYPTO_ALIAS(Gost2814789_cfb64_encrypt);
static inline void
Gost2814789_cnt_next(unsigned char *ivec, unsigned char *out,
*num=n;
}
+LCRYPTO_ALIAS(Gost2814789_cnt_encrypt);
int
GOST2814789IMIT_Init(GOST2814789IMIT_CTX *c, int nid)
memset(c->mac, 0, 8);
return Gost2814789_set_sbox(&c->cipher, nid);
}
+LCRYPTO_ALIAS(GOST2814789IMIT_Init);
static void
GOST2814789IMIT_block_data_order(GOST2814789IMIT_CTX *ctx,
#define HASH_BLOCK_DATA_ORDER GOST2814789IMIT_block_data_order
#include "md32_common.h"
+LCRYPTO_ALIAS(GOST2814789IMIT_Update);
+LCRYPTO_ALIAS(GOST2814789IMIT_Transform);
int
GOST2814789IMIT_Final(unsigned char *md, GOST2814789IMIT_CTX *c)
memcpy(md, c->mac, 4);
return 1;
}
+LCRYPTO_ALIAS(GOST2814789IMIT_Final);
unsigned char *
GOST2814789IMIT(const unsigned char *d, size_t n, unsigned char *md, int nid,
explicit_bzero(&c, sizeof(c));
return (md);
}
+LCRYPTO_ALIAS(GOST2814789IMIT);
#endif
-/* $OpenBSD: gost89_params.c,v 1.3 2022/11/26 16:08:53 tb Exp $ */
+/* $OpenBSD: gost89_params.c,v 1.4 2023/07/08 14:30:44 beck Exp $ */
/*
* Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* Copyright (c) 2005-2006 Cryptocom LTD
return 1;
}
+LCRYPTO_ALIAS(Gost2814789_set_sbox);
int
Gost2814789_set_key(GOST2814789_KEY *key, const unsigned char *userKey,
return 1;
}
+LCRYPTO_ALIAS(Gost2814789_set_key);
void
Gost2814789_cryptopro_key_mesh(GOST2814789_KEY *key)
return (GOST_CIPHER_PARAMS *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&GOST_CIPHER_PARAMS_it);
}
+LCRYPTO_ALIAS(d2i_GOST_CIPHER_PARAMS);
int
i2d_GOST_CIPHER_PARAMS(GOST_CIPHER_PARAMS *a, unsigned char **out)
{
return ASN1_item_i2d((ASN1_VALUE *)a, out, &GOST_CIPHER_PARAMS_it);
}
+LCRYPTO_ALIAS(i2d_GOST_CIPHER_PARAMS);
GOST_CIPHER_PARAMS *
GOST_CIPHER_PARAMS_new(void)
{
return (GOST_CIPHER_PARAMS *)ASN1_item_new(&GOST_CIPHER_PARAMS_it);
}
+LCRYPTO_ALIAS(GOST_CIPHER_PARAMS_new);
void
GOST_CIPHER_PARAMS_free(GOST_CIPHER_PARAMS *a)
{
ASN1_item_free((ASN1_VALUE *)a, &GOST_CIPHER_PARAMS_it);
}
+LCRYPTO_ALIAS(GOST_CIPHER_PARAMS_free);
#endif
}
#endif
}
+LCRYPTO_ALIAS(ERR_load_GOST_strings);
-/* $OpenBSD: gostr341001_key.c,v 1.12 2023/03/07 09:27:10 jsing Exp $ */
+/* $OpenBSD: gostr341001_key.c,v 1.13 2023/07/08 14:30:44 beck Exp $ */
/*
* Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* Copyright (c) 2005-2006 Cryptocom LTD
ret->digest_nid = NID_undef;
return (ret);
}
+LCRYPTO_ALIAS(GOST_KEY_new);
void
GOST_KEY_free(GOST_KEY *r)
freezero(r, sizeof(GOST_KEY));
}
+LCRYPTO_ALIAS(GOST_KEY_free);
int
GOST_KEY_check_key(const GOST_KEY *key)
EC_POINT_free(point);
return (ok);
}
+LCRYPTO_ALIAS(GOST_KEY_check_key);
int
GOST_KEY_set_public_key_affine_coordinates(GOST_KEY *key, BIGNUM *x, BIGNUM *y)
return ok;
}
+LCRYPTO_ALIAS(GOST_KEY_set_public_key_affine_coordinates);
const EC_GROUP *
GOST_KEY_get0_group(const GOST_KEY *key)
{
return key->group;
}
+LCRYPTO_ALIAS(GOST_KEY_get0_group);
int
GOST_KEY_set_group(GOST_KEY *key, const EC_GROUP *group)
key->group = EC_GROUP_dup(group);
return (key->group == NULL) ? 0 : 1;
}
+LCRYPTO_ALIAS(GOST_KEY_set_group);
const BIGNUM *
GOST_KEY_get0_private_key(const GOST_KEY *key)
{
return key->priv_key;
}
+LCRYPTO_ALIAS(GOST_KEY_get0_private_key);
int
GOST_KEY_set_private_key(GOST_KEY *key, const BIGNUM *priv_key)
key->priv_key = BN_dup(priv_key);
return (key->priv_key == NULL) ? 0 : 1;
}
+LCRYPTO_ALIAS(GOST_KEY_set_private_key);
const EC_POINT *
GOST_KEY_get0_public_key(const GOST_KEY *key)
{
return key->pub_key;
}
+LCRYPTO_ALIAS(GOST_KEY_get0_public_key);
int
GOST_KEY_set_public_key(GOST_KEY *key, const EC_POINT *pub_key)
key->pub_key = EC_POINT_dup(pub_key, key->group);
return (key->pub_key == NULL) ? 0 : 1;
}
+LCRYPTO_ALIAS(GOST_KEY_set_public_key);
int
GOST_KEY_get_digest(const GOST_KEY *key)
{
return key->digest_nid;
}
+LCRYPTO_ALIAS(GOST_KEY_get_digest);
int
GOST_KEY_set_digest(GOST_KEY *key, int digest_nid)
{
return 0;
}
+LCRYPTO_ALIAS(GOST_KEY_set_digest);
size_t
GOST_KEY_get_size(const GOST_KEY *r)
BN_free(order);
return (i);
}
+LCRYPTO_ALIAS(GOST_KEY_get_size);
#endif
-/* $OpenBSD: gostr341194.c,v 1.6 2022/11/26 16:08:53 tb Exp $ */
+/* $OpenBSD: gostr341194.c,v 1.7 2023/07/08 14:30:44 beck Exp $ */
/*
* Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* Copyright (c) 2005-2006 Cryptocom LTD
memset(c, 0, sizeof(*c));
return Gost2814789_set_sbox(&c->cipher, nid);
}
+LCRYPTO_ALIAS(GOSTR341194_Init);
static void
GOSTR341194_block_data_order(GOSTR341194_CTX *ctx, const unsigned char *p,
#define HASH_BLOCK_DATA_ORDER GOSTR341194_block_data_order
#include "md32_common.h"
+LCRYPTO_ALIAS(GOSTR341194_Update);
+LCRYPTO_ALIAS(GOSTR341194_Transform);
int
GOSTR341194_Final(unsigned char *md, GOSTR341194_CTX * c)
return 1;
}
+LCRYPTO_ALIAS(GOSTR341194_Final);
unsigned char *
GOSTR341194(const unsigned char *d, size_t n, unsigned char *md, int nid)
explicit_bzero(&c, sizeof(c));
return (md);
}
+LCRYPTO_ALIAS(GOSTR341194);
#endif
-/* $OpenBSD: streebog.c,v 1.8 2022/11/26 16:08:53 tb Exp $ */
+/* $OpenBSD: streebog.c,v 1.9 2023/07/08 14:30:44 beck Exp $ */
/*
* Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* Copyright (c) 2005-2006 Cryptocom LTD
return 1;
}
+LCRYPTO_ALIAS(STREEBOG512_Final);
int
STREEBOG256_Final(unsigned char *md, STREEBOG_CTX * c)
{
return STREEBOG512_Final(md, c);
}
+LCRYPTO_ALIAS(STREEBOG256_Final);
int
STREEBOG512_Update(STREEBOG_CTX *c, const void *_data, size_t len)
return 1;
}
+LCRYPTO_ALIAS(STREEBOG512_Update);
int
STREEBOG256_Update(STREEBOG_CTX *c, const void *data, size_t len)
{
return STREEBOG512_Update(c, data, len);
}
+LCRYPTO_ALIAS(STREEBOG256_Update);
void
STREEBOG512_Transform(STREEBOG_CTX *c, const unsigned char *data)
{
streebog_block_data_order(c, data, 1);
}
+LCRYPTO_ALIAS(STREEBOG512_Transform);
int
STREEBOG256_Init(STREEBOG_CTX *c)
c->md_len = STREEBOG256_LENGTH;
return 1;
}
+LCRYPTO_ALIAS(STREEBOG256_Init);
int
STREEBOG512_Init(STREEBOG_CTX *c)
c->md_len = STREEBOG512_LENGTH;
return 1;
}
+LCRYPTO_ALIAS(STREEBOG512_Init);
unsigned char *
STREEBOG256(const unsigned char *d, size_t n, unsigned char *md)
explicit_bzero(&c, sizeof(c));
return (md);
}
+LCRYPTO_ALIAS(STREEBOG256);
unsigned char *
STREEBOG512(const unsigned char *d, size_t n, unsigned char *md)
explicit_bzero(&c, sizeof(c));
return (md);
}
+LCRYPTO_ALIAS(STREEBOG512);
#endif
--- /dev/null
+/* $OpenBSD: gost.h,v 1.1 2023/07/08 14:30:44 beck Exp $ */
+/*
+ * Copyright (c) 2023 Bob Beck <beck@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _LIBCRYPTO_GOST_H
+#define _LIBCRYPTO_GOST_H
+
+#ifndef _MSC_VER
+#include_next <openssl/gost.h>
+#else
+#include "../include/openssl/gost.h"
+#endif
+#include "crypto_namespace.h"
+
+LCRYPTO_USED(Gost2814789_set_sbox);
+LCRYPTO_USED(Gost2814789_set_key);
+LCRYPTO_USED(Gost2814789_ecb_encrypt);
+LCRYPTO_USED(Gost2814789_cfb64_encrypt);
+LCRYPTO_USED(Gost2814789_cnt_encrypt);
+LCRYPTO_USED(GOST_CIPHER_PARAMS_new);
+LCRYPTO_USED(GOST_CIPHER_PARAMS_free);
+LCRYPTO_USED(d2i_GOST_CIPHER_PARAMS);
+LCRYPTO_USED(i2d_GOST_CIPHER_PARAMS);
+LCRYPTO_USED(GOST2814789IMIT_Init);
+LCRYPTO_USED(GOST2814789IMIT_Update);
+LCRYPTO_USED(GOST2814789IMIT_Final);
+LCRYPTO_USED(GOST2814789IMIT_Transform);
+LCRYPTO_USED(GOST2814789IMIT);
+LCRYPTO_USED(GOSTR341194_Init);
+LCRYPTO_USED(GOSTR341194_Update);
+LCRYPTO_USED(GOSTR341194_Final);
+LCRYPTO_USED(GOSTR341194_Transform);
+LCRYPTO_USED(GOSTR341194);
+LCRYPTO_USED(STREEBOG256_Init);
+LCRYPTO_USED(STREEBOG256_Update);
+LCRYPTO_USED(STREEBOG256_Final);
+LCRYPTO_USED(STREEBOG256);
+LCRYPTO_USED(STREEBOG512_Init);
+LCRYPTO_USED(STREEBOG512_Update);
+LCRYPTO_USED(STREEBOG512_Final);
+LCRYPTO_USED(STREEBOG512_Transform);
+LCRYPTO_USED(STREEBOG512);
+LCRYPTO_USED(GOST_KEY_new);
+LCRYPTO_USED(GOST_KEY_free);
+LCRYPTO_USED(GOST_KEY_check_key);
+LCRYPTO_USED(GOST_KEY_set_public_key_affine_coordinates);
+LCRYPTO_USED(GOST_KEY_get0_group);
+LCRYPTO_USED(GOST_KEY_set_group);
+LCRYPTO_USED(GOST_KEY_get_digest);
+LCRYPTO_USED(GOST_KEY_set_digest);
+LCRYPTO_USED(GOST_KEY_get0_private_key);
+LCRYPTO_USED(GOST_KEY_set_private_key);
+LCRYPTO_USED(GOST_KEY_get0_public_key);
+LCRYPTO_USED(GOST_KEY_set_public_key);
+LCRYPTO_USED(GOST_KEY_get_size);
+LCRYPTO_USED(ERR_load_GOST_strings);
+
+#endif /* _LIBCRYPTO_GOST_H */