_libre_TXT_DB_free
_libre_TXT_DB_get_by_index
_libre_TXT_DB_insert
+_libre_BN_set_flags
+_libre_BN_get_flags
+_libre_BN_with_flags
+_libre_BN_GENCB_new
+_libre_BN_GENCB_free
+_libre_BN_GENCB_call
+_libre_BN_GENCB_set_old
+_libre_BN_GENCB_set
+_libre_BN_GENCB_get_arg
+_libre_BN_abs_is_word
+_libre_BN_is_zero
+_libre_BN_is_one
+_libre_BN_is_word
+_libre_BN_is_odd
+_libre_BN_zero
+_libre_BN_one
+_libre_BN_value_one
+_libre_BN_options
+_libre_BN_CTX_new
+_libre_BN_CTX_free
+_libre_BN_CTX_start
+_libre_BN_CTX_get
+_libre_BN_CTX_end
+_libre_BN_rand
+_libre_BN_pseudo_rand
+_libre_BN_rand_range
+_libre_BN_pseudo_rand_range
+_libre_BN_num_bits
+_libre_BN_num_bits_word
+_libre_BN_new
+_libre_BN_clear_free
+_libre_BN_copy
+_libre_BN_swap
+_libre_BN_bin2bn
+_libre_BN_bn2bin
+_libre_BN_bn2binpad
+_libre_BN_lebin2bn
+_libre_BN_bn2lebinpad
+_libre_BN_mpi2bn
+_libre_BN_bn2mpi
+_libre_BN_sub
+_libre_BN_usub
+_libre_BN_uadd
+_libre_BN_add
+_libre_BN_mul
+_libre_BN_sqr
+_libre_BN_set_negative
+_libre_BN_is_negative
+_libre_BN_nnmod
+_libre_BN_mod_add
+_libre_BN_mod_add_quick
+_libre_BN_mod_sub
+_libre_BN_mod_sub_quick
+_libre_BN_mod_mul
+_libre_BN_mod_sqr
+_libre_BN_mod_lshift1
+_libre_BN_mod_lshift1_quick
+_libre_BN_mod_lshift
+_libre_BN_mod_lshift_quick
+_libre_BN_mod_word
+_libre_BN_div_word
+_libre_BN_mul_word
+_libre_BN_add_word
+_libre_BN_sub_word
+_libre_BN_set_word
+_libre_BN_get_word
+_libre_BN_cmp
+_libre_BN_free
+_libre_BN_is_bit_set
+_libre_BN_lshift
+_libre_BN_lshift1
+_libre_BN_exp
+_libre_BN_mod_exp_mont_consttime
+_libre_BN_mod_exp_mont_word
+_libre_BN_mod_exp2_mont
+_libre_BN_mod_exp_simple
+_libre_BN_mask_bits
+_libre_BN_print_fp
+_libre_BN_print
+_libre_BN_rshift
+_libre_BN_rshift1
+_libre_BN_clear
+_libre_BN_dup
+_libre_BN_ucmp
+_libre_BN_set_bit
+_libre_BN_clear_bit
+_libre_BN_bn2hex
+_libre_BN_bn2dec
+_libre_BN_hex2bn
+_libre_BN_dec2bn
+_libre_BN_asc2bn
+_libre_BN_kronecker
+_libre_BN_mod_sqrt
+_libre_BN_consttime_swap
+_libre_BN_security_bits
+_libre_BN_generate_prime_ex
+_libre_BN_is_prime_ex
+_libre_BN_is_prime_fasttest_ex
+_libre_BN_MONT_CTX_new
+_libre_BN_mod_mul_montgomery
+_libre_BN_to_montgomery
+_libre_BN_from_montgomery
+_libre_BN_MONT_CTX_free
+_libre_BN_MONT_CTX_set
+_libre_BN_MONT_CTX_copy
+_libre_BN_MONT_CTX_set_locked
+_libre_BN_BLINDING_new
+_libre_BN_BLINDING_free
+_libre_BN_BLINDING_update
+_libre_BN_BLINDING_convert
+_libre_BN_BLINDING_invert
+_libre_BN_BLINDING_convert_ex
+_libre_BN_BLINDING_invert_ex
+_libre_BN_BLINDING_thread_id
+_libre_BN_BLINDING_get_flags
+_libre_BN_BLINDING_set_flags
+_libre_BN_BLINDING_create_param
+_libre_get_rfc2409_prime_768
+_libre_get_rfc2409_prime_1024
+_libre_BN_get_rfc2409_prime_768
+_libre_BN_get_rfc2409_prime_1024
+_libre_get_rfc3526_prime_1536
+_libre_get_rfc3526_prime_2048
+_libre_get_rfc3526_prime_3072
+_libre_get_rfc3526_prime_4096
+_libre_get_rfc3526_prime_6144
+_libre_get_rfc3526_prime_8192
+_libre_BN_get_rfc3526_prime_1536
+_libre_BN_get_rfc3526_prime_2048
+_libre_BN_get_rfc3526_prime_3072
+_libre_BN_get_rfc3526_prime_4096
+_libre_BN_get_rfc3526_prime_6144
+_libre_BN_get_rfc3526_prime_8192
+_libre_ERR_load_BN_strings
-/* $OpenBSD: bn_add.c,v 1.25 2023/06/12 16:17:24 jsing Exp $ */
+/* $OpenBSD: bn_add.c,v 1.26 2023/07/08 12:21:58 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
return 1;
}
+LCRYPTO_ALIAS(BN_uadd);
int
BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
return 1;
}
+LCRYPTO_ALIAS(BN_usub);
int
BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
return ret;
}
+LCRYPTO_ALIAS(BN_add);
int
BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
return ret;
}
+LCRYPTO_ALIAS(BN_sub);
-/* $OpenBSD: bn_blind.c,v 1.22 2023/04/25 19:57:59 tb Exp $ */
+/* $OpenBSD: bn_blind.c,v 1.23 2023/07/08 12:21:58 beck Exp $ */
/* ====================================================================
* Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
*
BN_BLINDING_free(ret);
return (NULL);
}
+LCRYPTO_ALIAS(BN_BLINDING_new);
void
BN_BLINDING_free(BN_BLINDING *r)
BN_free(r->mod);
free(r);
}
+LCRYPTO_ALIAS(BN_BLINDING_free);
int
BN_BLINDING_update(BN_BLINDING *b, BN_CTX *ctx)
b->counter = 0;
return (ret);
}
+LCRYPTO_ALIAS(BN_BLINDING_update);
int
BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx)
{
return BN_BLINDING_convert_ex(n, NULL, b, ctx);
}
+LCRYPTO_ALIAS(BN_BLINDING_convert);
int
BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *ctx)
return ret;
}
+LCRYPTO_ALIAS(BN_BLINDING_convert_ex);
int
BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx)
{
return BN_BLINDING_invert_ex(n, NULL, b, ctx);
}
+LCRYPTO_ALIAS(BN_BLINDING_invert);
int
BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b, BN_CTX *ctx)
return (ret);
}
+LCRYPTO_ALIAS(BN_BLINDING_invert_ex);
CRYPTO_THREADID *
BN_BLINDING_thread_id(BN_BLINDING *b)
{
return &b->tid;
}
+LCRYPTO_ALIAS(BN_BLINDING_thread_id);
unsigned long
BN_BLINDING_get_flags(const BN_BLINDING *b)
{
return b->flags;
}
+LCRYPTO_ALIAS(BN_BLINDING_get_flags);
void
BN_BLINDING_set_flags(BN_BLINDING *b, unsigned long flags)
{
b->flags = flags;
}
+LCRYPTO_ALIAS(BN_BLINDING_set_flags);
BN_BLINDING *
BN_BLINDING_create_param(BN_BLINDING *b, const BIGNUM *e, BIGNUM *m,
return ret;
}
+LCRYPTO_ALIAS(BN_BLINDING_create_param);
-/* $OpenBSD: bn_const.c,v 1.5 2018/02/20 17:02:30 jsing Exp $ */
+/* $OpenBSD: bn_const.c,v 1.6 2023/07/08 12:21:58 beck Exp $ */
/* Insert boilerplate */
#include <openssl/bn.h>
};
return BN_bin2bn(RFC2409_PRIME_768, sizeof(RFC2409_PRIME_768), bn);
}
+LCRYPTO_ALIAS(get_rfc2409_prime_768);
BIGNUM *
BN_get_rfc2409_prime_768(BIGNUM *bn)
{
return get_rfc2409_prime_768(bn);
}
+LCRYPTO_ALIAS(BN_get_rfc2409_prime_768);
/* "Second Oakley Default Group" from RFC2409, section 6.2.
*
};
return BN_bin2bn(RFC2409_PRIME_1024, sizeof(RFC2409_PRIME_1024), bn);
}
+LCRYPTO_ALIAS(get_rfc2409_prime_1024);
BIGNUM *
BN_get_rfc2409_prime_1024(BIGNUM *bn)
{
return get_rfc2409_prime_1024(bn);
}
+LCRYPTO_ALIAS(BN_get_rfc2409_prime_1024);
/* "1536-bit MODP Group" from RFC3526, Section 2.
*
};
return BN_bin2bn(RFC3526_PRIME_1536, sizeof(RFC3526_PRIME_1536), bn);
}
+LCRYPTO_ALIAS(get_rfc3526_prime_1536);
BIGNUM *
BN_get_rfc3526_prime_1536(BIGNUM *bn)
{
return get_rfc3526_prime_1536(bn);
}
+LCRYPTO_ALIAS(BN_get_rfc3526_prime_1536);
/* "2048-bit MODP Group" from RFC3526, Section 3.
*
};
return BN_bin2bn(RFC3526_PRIME_2048, sizeof(RFC3526_PRIME_2048), bn);
}
+LCRYPTO_ALIAS(get_rfc3526_prime_2048);
BIGNUM *
BN_get_rfc3526_prime_2048(BIGNUM *bn)
{
return get_rfc3526_prime_2048(bn);
}
+LCRYPTO_ALIAS(BN_get_rfc3526_prime_2048);
/* "3072-bit MODP Group" from RFC3526, Section 4.
*
};
return BN_bin2bn(RFC3526_PRIME_3072, sizeof(RFC3526_PRIME_3072), bn);
}
+LCRYPTO_ALIAS(get_rfc3526_prime_3072);
BIGNUM *
BN_get_rfc3526_prime_3072(BIGNUM *bn)
{
return get_rfc3526_prime_3072(bn);
}
+LCRYPTO_ALIAS(BN_get_rfc3526_prime_3072);
/* "4096-bit MODP Group" from RFC3526, Section 5.
*
};
return BN_bin2bn(RFC3526_PRIME_4096, sizeof(RFC3526_PRIME_4096), bn);
}
+LCRYPTO_ALIAS(get_rfc3526_prime_4096);
BIGNUM *
BN_get_rfc3526_prime_4096(BIGNUM *bn)
{
return get_rfc3526_prime_4096(bn);
}
+LCRYPTO_ALIAS(BN_get_rfc3526_prime_4096);
/* "6144-bit MODP Group" from RFC3526, Section 6.
*
};
return BN_bin2bn(RFC3526_PRIME_6144, sizeof(RFC3526_PRIME_6144), bn);
}
+LCRYPTO_ALIAS(get_rfc3526_prime_6144);
BIGNUM *
BN_get_rfc3526_prime_6144(BIGNUM *bn)
{
return get_rfc3526_prime_6144(bn);
}
+LCRYPTO_ALIAS(BN_get_rfc3526_prime_6144);
/* "8192-bit MODP Group" from RFC3526, Section 7.
*
};
return BN_bin2bn(RFC3526_PRIME_8192, sizeof(RFC3526_PRIME_8192), bn);
}
+LCRYPTO_ALIAS(get_rfc3526_prime_8192);
BIGNUM *
BN_get_rfc3526_prime_8192(BIGNUM *bn)
{
return get_rfc3526_prime_8192(bn);
}
+LCRYPTO_ALIAS(BN_get_rfc3526_prime_8192);
-/* $OpenBSD: bn_convert.c,v 1.12 2023/06/23 10:48:40 tb Exp $ */
+/* $OpenBSD: bn_convert.c,v 1.13 2023/07/08 12:21:58 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
{
return bn2binpad(a, to, -1, big);
}
+LCRYPTO_ALIAS(BN_bn2bin);
int
BN_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen)
return -1;
return bn2binpad(a, to, tolen, big);
}
+LCRYPTO_ALIAS(BN_bn2binpad);
BIGNUM *
BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret)
bn_correct_top(ret);
return (ret);
}
+LCRYPTO_ALIAS(BN_bin2bn);
int
BN_bn2lebinpad(const BIGNUM *a, unsigned char *to, int tolen)
return bn2binpad(a, to, tolen, little);
}
+LCRYPTO_ALIAS(BN_bn2lebinpad);
BIGNUM *
BN_lebin2bn(const unsigned char *s, int len, BIGNUM *ret)
return ret;
}
+LCRYPTO_ALIAS(BN_lebin2bn);
int
BN_asc2bn(BIGNUM **bnp, const char *s)
return 1;
}
+LCRYPTO_ALIAS(BN_asc2bn);
char *
BN_bn2dec(const BIGNUM *bn)
return s;
}
+LCRYPTO_ALIAS(BN_bn2dec);
static int
bn_dec2bn_cbs(BIGNUM **bnp, CBS *cbs)
return bn_dec2bn_cbs(bnp, &cbs);
}
+LCRYPTO_ALIAS(BN_dec2bn);
char *
BN_bn2hex(const BIGNUM *bn)
return s;
}
+LCRYPTO_ALIAS(BN_bn2hex);
static int
bn_hex2bn_cbs(BIGNUM **bnp, CBS *cbs)
return bn_hex2bn_cbs(bnp, &cbs);
}
+LCRYPTO_ALIAS(BN_hex2bn);
int
BN_bn2mpi(const BIGNUM *a, unsigned char *d)
d[4] |= 0x80;
return (num + 4 + ext);
}
+LCRYPTO_ALIAS(BN_bn2mpi);
BIGNUM *
BN_mpi2bn(const unsigned char *d, int n, BIGNUM *ain)
}
return (a);
}
+LCRYPTO_ALIAS(BN_mpi2bn);
#ifndef OPENSSL_NO_BIO
int
BIO_free(b);
return (ret);
}
+LCRYPTO_ALIAS(BN_print_fp);
int
BN_print(BIO *bp, const BIGNUM *a)
end:
return (ret);
}
+LCRYPTO_ALIAS(BN_print);
#endif
-/* $OpenBSD: bn_ctx.c,v 1.21 2023/04/25 16:41:29 tb Exp $ */
+/* $OpenBSD: bn_ctx.c,v 1.22 2023/07/08 12:21:58 beck Exp $ */
/*
* Copyright (c) 2023 Joel Sing <jsing@openbsd.org>
*
{
return calloc(1, sizeof(struct bignum_ctx));
}
+LCRYPTO_ALIAS(BN_CTX_new);
void
BN_CTX_free(BN_CTX *bctx)
freezero(bctx, sizeof(*bctx));
}
+LCRYPTO_ALIAS(BN_CTX_free);
void
BN_CTX_start(BN_CTX *bctx)
return;
}
}
+LCRYPTO_ALIAS(BN_CTX_start);
BIGNUM *
BN_CTX_get(BN_CTX *bctx)
return bn;
}
+LCRYPTO_ALIAS(BN_CTX_get);
void
BN_CTX_end(BN_CTX *bctx)
bctx->group--;
}
+LCRYPTO_ALIAS(BN_CTX_end);
-/* $OpenBSD: bn_err.c,v 1.16 2023/06/13 09:12:22 tb Exp $ */
+/* $OpenBSD: bn_err.c,v 1.17 2023/07/08 12:21:58 beck Exp $ */
/* ====================================================================
* Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved.
*
}
#endif
}
+LCRYPTO_ALIAS(ERR_load_BN_strings);
-/* $OpenBSD: bn_exp.c,v 1.46 2023/05/09 05:38:11 tb Exp $ */
+/* $OpenBSD: bn_exp.c,v 1.47 2023/07/08 12:21:58 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
return ret;
}
+LCRYPTO_ALIAS(BN_exp);
/* The old fallback, simple version :-) */
int
BN_CTX_end(ctx);
return (ret);
}
+LCRYPTO_ALIAS(BN_mod_exp_simple);
/* BN_mod_exp_mont_consttime() stores the precomputed powers in a specific layout
* so that accessing any of these table values shows the same access pattern as far
BN_CTX_end(ctx);
return (ret);
}
+LCRYPTO_ALIAS(BN_mod_exp_mont_consttime);
static int
BN_mod_exp_mont_internal(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
BN_CTX_end(ctx);
return (ret);
}
+LCRYPTO_ALIAS(BN_mod_exp_mont_word);
int
BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
BN_CTX_end(ctx);
return (ret);
}
+LCRYPTO_ALIAS(BN_mod_exp2_mont);
-/* $OpenBSD: bn_kron.c,v 1.14 2023/03/27 10:21:23 tb Exp $ */
+/* $OpenBSD: bn_kron.c,v 1.15 2023/07/08 12:21:58 beck Exp $ */
/* ====================================================================
* Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
*
return ret;
}
+LCRYPTO_ALIAS(BN_kronecker);
-/* $OpenBSD: bn_lib.c,v 1.88 2023/06/21 07:48:41 jsing Exp $ */
+/* $OpenBSD: bn_lib.c,v 1.89 2023/07/08 12:21:58 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
return bn;
}
+LCRYPTO_ALIAS(BN_new);
void
BN_init(BIGNUM *a)
a->top = 0;
a->neg = 0;
}
+LCRYPTO_ALIAS(BN_clear);
void
BN_free(BIGNUM *bn)
freezero(bn, sizeof(*bn));
}
+LCRYPTO_ALIAS(BN_free);
void
BN_clear_free(BIGNUM *bn)
{
BN_free(bn);
}
+LCRYPTO_ALIAS(BN_clear_free);
void
BN_set_flags(BIGNUM *b, int n)
{
b->flags |= n;
}
+LCRYPTO_ALIAS(BN_set_flags);
int
BN_get_flags(const BIGNUM *b, int n)
{
return b->flags & n;
}
+LCRYPTO_ALIAS(BN_get_flags);
void
BN_with_flags(BIGNUM *dest, const BIGNUM *b, int flags)
*dest = *b;
dest->flags = dest_flags;
}
+LCRYPTO_ALIAS(BN_with_flags);
static const BN_ULONG bn_value_one_data = 1;
static const BIGNUM bn_value_one = {
{
return &bn_value_one;
}
+LCRYPTO_ALIAS(BN_value_one);
int
BN_num_bits_word(BN_ULONG w)
{
return BN_BITS2 - bn_clzw(w);
}
+LCRYPTO_ALIAS(BN_num_bits_word);
int
BN_num_bits(const BIGNUM *bn)
{
return bn_bitsize(bn);
}
+LCRYPTO_ALIAS(BN_num_bits);
void
bn_correct_top(BIGNUM *a)
}
return t;
}
+LCRYPTO_ALIAS(BN_dup);
static inline void
bn_copy_words(BN_ULONG *ap, const BN_ULONG *bp, int n)
return (a);
}
+LCRYPTO_ALIAS(BN_copy);
int
bn_copy(BIGNUM *dst, const BIGNUM *src)
b->flags = (flags_old_b & BN_FLG_MALLOCED) |
(flags_old_a & BN_FLG_STATIC_DATA);
}
+LCRYPTO_ALIAS(BN_swap);
BN_ULONG
BN_get_word(const BIGNUM *a)
/* a->top == 0 */
return 0;
}
+LCRYPTO_ALIAS(BN_get_word);
int
BN_set_word(BIGNUM *a, BN_ULONG w)
a->top = (w ? 1 : 0);
return (1);
}
+LCRYPTO_ALIAS(BN_set_word);
int
BN_ucmp(const BIGNUM *a, const BIGNUM *b)
return 0;
}
+LCRYPTO_ALIAS(BN_ucmp);
int
BN_cmp(const BIGNUM *a, const BIGNUM *b)
return BN_ucmp(a, b);
}
+LCRYPTO_ALIAS(BN_cmp);
int
BN_set_bit(BIGNUM *a, int n)
a->d[i] |= (((BN_ULONG)1) << j);
return (1);
}
+LCRYPTO_ALIAS(BN_set_bit);
int
BN_clear_bit(BIGNUM *a, int n)
bn_correct_top(a);
return (1);
}
+LCRYPTO_ALIAS(BN_clear_bit);
int
BN_is_bit_set(const BIGNUM *a, int n)
return 0;
return (int)(((a->d[i]) >> j) & ((BN_ULONG)1));
}
+LCRYPTO_ALIAS(BN_is_bit_set);
int
BN_mask_bits(BIGNUM *a, int n)
bn_correct_top(a);
return (1);
}
+LCRYPTO_ALIAS(BN_mask_bits);
void
BN_set_negative(BIGNUM *bn, int neg)
{
bn->neg = ~BN_is_zero(bn) & bn_ct_ne_zero(neg);
}
+LCRYPTO_ALIAS(BN_set_negative);
/*
* Constant-time conditional swap of a and b.
}
#undef BN_CONSTTIME_SWAP
}
+LCRYPTO_ALIAS(BN_consttime_swap);
/*
* Constant-time conditional swap of a and b.
a->neg = 0;
a->top = 0;
}
+LCRYPTO_ALIAS(BN_zero);
int
BN_one(BIGNUM *a)
{
return BN_set_word(a, 1);
}
+LCRYPTO_ALIAS(BN_one);
int
BN_abs_is_word(const BIGNUM *a, const BN_ULONG w)
{
return (a->top == 1 && a->d[0] == w) || (w == 0 && a->top == 0);
}
+LCRYPTO_ALIAS(BN_abs_is_word);
int
BN_is_zero(const BIGNUM *bn)
return bits == 0;
}
+LCRYPTO_ALIAS(BN_is_zero);
int
BN_is_one(const BIGNUM *a)
{
return BN_abs_is_word(a, 1) && !a->neg;
}
+LCRYPTO_ALIAS(BN_is_one);
int
BN_is_word(const BIGNUM *a, const BN_ULONG w)
{
return BN_abs_is_word(a, w) && (w == 0 || !a->neg);
}
+LCRYPTO_ALIAS(BN_is_word);
int
BN_is_odd(const BIGNUM *a)
{
return a->top > 0 && (a->d[0] & 1);
}
+LCRYPTO_ALIAS(BN_is_odd);
int
BN_is_negative(const BIGNUM *a)
{
return a->neg != 0;
}
+LCRYPTO_ALIAS(BN_is_negative);
char *
BN_options(void)
}
return (data);
}
+LCRYPTO_ALIAS(BN_options);
/*
* Bits of security, see SP800-57, section 5.6.11, table 2.
return bits >= secbits ? secbits : bits;
}
+LCRYPTO_ALIAS(BN_security_bits);
BN_GENCB *
BN_GENCB_new(void)
return cb;
}
+LCRYPTO_ALIAS(BN_GENCB_new);
void
BN_GENCB_free(BN_GENCB *cb)
return;
free(cb);
}
+LCRYPTO_ALIAS(BN_GENCB_free);
/* Populate a BN_GENCB structure with an "old"-style callback */
void
gencb->cb.cb_1 = cb;
gencb->arg = cb_arg;
}
+LCRYPTO_ALIAS(BN_GENCB_set_old);
/* Populate a BN_GENCB structure with a "new"-style callback */
void
gencb->cb.cb_2 = cb;
gencb->arg = cb_arg;
}
+LCRYPTO_ALIAS(BN_GENCB_set);
void *
BN_GENCB_get_arg(BN_GENCB *cb)
{
return cb->arg;
}
+LCRYPTO_ALIAS(BN_GENCB_get_arg);
-/* $OpenBSD: bn_mod.c,v 1.21 2023/06/13 09:28:13 tb Exp $ */
+/* $OpenBSD: bn_mod.c,v 1.22 2023/07/08 12:21:58 beck Exp $ */
/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
* for the OpenSSL project. */
/* ====================================================================
return BN_usub(r, m, r);
return 1;
}
+LCRYPTO_ALIAS(BN_nnmod);
int
BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
return 0;
return BN_nnmod(r, r, m, ctx);
}
+LCRYPTO_ALIAS(BN_mod_add);
/*
* BN_mod_add() variant that may only be used if both a and b are non-negative
return BN_usub(r, r, m);
return 1;
}
+LCRYPTO_ALIAS(BN_mod_add_quick);
int
BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
return 0;
return BN_nnmod(r, r, m, ctx);
}
+LCRYPTO_ALIAS(BN_mod_sub);
/*
* BN_mod_sub() variant that may only be used if both a and b are non-negative
return 0;
return BN_usub(r, m, r);
}
+LCRYPTO_ALIAS(BN_mod_sub_quick);
int
BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
return ret;
}
+LCRYPTO_ALIAS(BN_mod_mul);
int
BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx)
{
return BN_mod_mul(r, a, a, m, ctx);
}
+LCRYPTO_ALIAS(BN_mod_sqr);
int
BN_mod_lshift1(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx)
return 0;
return BN_nnmod(r, r, m, ctx);
}
+LCRYPTO_ALIAS(BN_mod_lshift1);
/*
* BN_mod_lshift1() variant that may be used if a is non-negative
return BN_usub(r, r, m);
return 1;
}
+LCRYPTO_ALIAS(BN_mod_lshift1_quick);
int
BN_mod_lshift(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m, BN_CTX *ctx)
return ret;
}
+LCRYPTO_ALIAS(BN_mod_lshift);
/*
* BN_mod_lshift() variant that may be used if a is non-negative
return 1;
}
+LCRYPTO_ALIAS(BN_mod_lshift_quick);
-/* $OpenBSD: bn_mod_sqrt.c,v 1.1 2023/04/11 10:08:44 tb Exp $ */
+/* $OpenBSD: bn_mod_sqrt.c,v 1.2 2023/07/08 12:21:58 beck Exp $ */
/*
* Copyright (c) 2022 Theo Buehler <tb@openbsd.org>
return NULL;
}
+LCRYPTO_ALIAS(BN_mod_sqrt);
-/* $OpenBSD: bn_mont.c,v 1.60 2023/06/17 14:43:50 jsing Exp $ */
+/* $OpenBSD: bn_mont.c,v 1.61 2023/07/08 12:21:58 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
return mctx;
}
+LCRYPTO_ALIAS(BN_MONT_CTX_new);
void
BN_MONT_CTX_free(BN_MONT_CTX *mctx)
if (mctx->flags & BN_FLG_MALLOCED)
free(mctx);
}
+LCRYPTO_ALIAS(BN_MONT_CTX_free);
BN_MONT_CTX *
BN_MONT_CTX_copy(BN_MONT_CTX *dst, BN_MONT_CTX *src)
return dst;
}
+LCRYPTO_ALIAS(BN_MONT_CTX_copy);
int
BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
return ret;
}
+LCRYPTO_ALIAS(BN_MONT_CTX_set);
BN_MONT_CTX *
BN_MONT_CTX_set_locked(BN_MONT_CTX **pmctx, int lock, const BIGNUM *mod,
done:
return mctx;
}
+LCRYPTO_ALIAS(BN_MONT_CTX_set_locked);
static int bn_montgomery_reduce(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mctx);
/* Compute r = aR * bR * R^-1 mod N = abR mod N */
return bn_mod_mul_montgomery(r, a, b, mctx, ctx);
}
+LCRYPTO_ALIAS(BN_mod_mul_montgomery);
int
BN_to_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mctx, BN_CTX *ctx)
/* Compute r = a * R * R * R^-1 mod N = aR mod N */
return bn_mod_mul_montgomery(r, a, &mctx->RR, mctx, ctx);
}
+LCRYPTO_ALIAS(BN_to_montgomery);
/*
* bn_montgomery_reduce() performs Montgomery reduction, reducing the input
return ret;
}
+LCRYPTO_ALIAS(BN_from_montgomery);
-/* $OpenBSD: bn_mul.c,v 1.38 2023/06/12 16:17:24 jsing Exp $ */
+/* $OpenBSD: bn_mul.c,v 1.39 2023/07/08 12:21:58 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
return ret;
}
+LCRYPTO_ALIAS(BN_mul);
-/* $OpenBSD: bn_prime.c,v 1.32 2023/05/10 12:21:55 tb Exp $ */
+/* $OpenBSD: bn_prime.c,v 1.33 2023/07/08 12:21:58 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
/* Unrecognised callback type */
return 0;
}
+LCRYPTO_ALIAS(BN_GENCB_call);
int
BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, const BIGNUM *add,
return found;
}
+LCRYPTO_ALIAS(BN_generate_prime_ex);
int
BN_is_prime_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed, BN_GENCB *cb)
{
return BN_is_prime_fasttest_ex(a, checks, ctx_passed, 0, cb);
}
+LCRYPTO_ALIAS(BN_is_prime_ex);
int
BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,
return is_prime;
}
+LCRYPTO_ALIAS(BN_is_prime_fasttest_ex);
static int
probable_prime(BIGNUM *rnd, int bits)
-/* $OpenBSD: bn_rand.c,v 1.27 2022/11/26 16:08:51 tb Exp $ */
+/* $OpenBSD: bn_rand.c,v 1.28 2023/07/08 12:21:58 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
{
return bnrand(0, rnd, bits, top, bottom);
}
+LCRYPTO_ALIAS(BN_rand);
int
BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom)
{
return bnrand(1, rnd, bits, top, bottom);
}
+LCRYPTO_ALIAS(BN_pseudo_rand);
#if 1
int
{
return bn_rand_range(0, r, range);
}
+LCRYPTO_ALIAS(BN_rand_range);
int
bn_rand_interval(BIGNUM *rnd, const BIGNUM *lower_inc, const BIGNUM *upper_exc)
{
return bn_rand_range(1, r, range);
}
+LCRYPTO_ALIAS(BN_pseudo_rand_range);
-/* $OpenBSD: bn_shift.c,v 1.21 2023/02/13 04:25:37 jsing Exp $ */
+/* $OpenBSD: bn_shift.c,v 1.22 2023/07/08 12:21:58 beck Exp $ */
/*
* Copyright (c) 2022, 2023 Joel Sing <jsing@openbsd.org>
*
{
return bn_lshift(r, a, 1);
}
+LCRYPTO_ALIAS(BN_lshift1);
int
BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
{
return bn_lshift(r, a, n);
}
+LCRYPTO_ALIAS(BN_lshift);
int
BN_rshift1(BIGNUM *r, const BIGNUM *a)
{
return bn_rshift(r, a, 1);
}
+LCRYPTO_ALIAS(BN_rshift1);
int
BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
{
return bn_rshift(r, a, n);
}
+LCRYPTO_ALIAS(BN_rshift);
-/* $OpenBSD: bn_sqr.c,v 1.35 2023/07/02 13:11:23 jsing Exp $ */
+/* $OpenBSD: bn_sqr.c,v 1.36 2023/07/08 12:21:58 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
return ret;
}
+LCRYPTO_ALIAS(BN_sqr);
-/* $OpenBSD: bn_word.c,v 1.20 2023/03/11 14:14:54 jsing Exp $ */
+/* $OpenBSD: bn_word.c,v 1.21 2023/07/08 12:21:58 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
}
return ((BN_ULONG)ret);
}
+LCRYPTO_ALIAS(BN_mod_word);
BN_ULONG
BN_div_word(BIGNUM *a, BN_ULONG w)
return (ret);
}
+LCRYPTO_ALIAS(BN_div_word);
int
BN_add_word(BIGNUM *a, BN_ULONG w)
}
return (1);
}
+LCRYPTO_ALIAS(BN_add_word);
int
BN_sub_word(BIGNUM *a, BN_ULONG w)
a->top--;
return (1);
}
+LCRYPTO_ALIAS(BN_sub_word);
int
BN_mul_word(BIGNUM *a, BN_ULONG w)
}
return (1);
}
+LCRYPTO_ALIAS(BN_mul_word);
--- /dev/null
+/* $OpenBSD: bn.h,v 1.1 2023/07/08 12:21:58 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_BN_H
+#define _LIBCRYPTO_BN_H
+
+#ifndef _MSC_VER
+#include_next <openssl/bn.h>
+#else
+#include "../include/openssl/bn.h"
+#endif
+#include "crypto_namespace.h"
+
+LCRYPTO_USED(BN_set_flags);
+LCRYPTO_USED(BN_get_flags);
+LCRYPTO_USED(BN_with_flags);
+LCRYPTO_USED(BN_GENCB_new);
+LCRYPTO_USED(BN_GENCB_free);
+LCRYPTO_USED(BN_GENCB_call);
+LCRYPTO_USED(BN_GENCB_set_old);
+LCRYPTO_USED(BN_GENCB_set);
+LCRYPTO_USED(BN_GENCB_get_arg);
+LCRYPTO_USED(BN_abs_is_word);
+LCRYPTO_USED(BN_is_zero);
+LCRYPTO_USED(BN_is_one);
+LCRYPTO_USED(BN_is_word);
+LCRYPTO_USED(BN_is_odd);
+LCRYPTO_USED(BN_zero);
+LCRYPTO_USED(BN_one);
+LCRYPTO_USED(BN_value_one);
+LCRYPTO_USED(BN_options);
+LCRYPTO_USED(BN_CTX_new);
+LCRYPTO_USED(BN_CTX_free);
+LCRYPTO_USED(BN_CTX_start);
+LCRYPTO_USED(BN_CTX_get);
+LCRYPTO_USED(BN_CTX_end);
+LCRYPTO_USED(BN_rand);
+LCRYPTO_USED(BN_pseudo_rand);
+LCRYPTO_USED(BN_rand_range);
+LCRYPTO_USED(BN_pseudo_rand_range);
+LCRYPTO_USED(BN_num_bits);
+LCRYPTO_USED(BN_num_bits_word);
+LCRYPTO_USED(BN_new);
+LCRYPTO_USED(BN_clear_free);
+LCRYPTO_USED(BN_copy);
+LCRYPTO_USED(BN_swap);
+LCRYPTO_USED(BN_bin2bn);
+LCRYPTO_USED(BN_bn2bin);
+LCRYPTO_USED(BN_bn2binpad);
+LCRYPTO_USED(BN_lebin2bn);
+LCRYPTO_USED(BN_bn2lebinpad);
+LCRYPTO_USED(BN_mpi2bn);
+LCRYPTO_USED(BN_bn2mpi);
+LCRYPTO_USED(BN_sub);
+LCRYPTO_USED(BN_usub);
+LCRYPTO_USED(BN_uadd);
+LCRYPTO_USED(BN_add);
+LCRYPTO_USED(BN_mul);
+LCRYPTO_USED(BN_sqr);
+LCRYPTO_USED(BN_set_negative);
+LCRYPTO_USED(BN_is_negative);
+LCRYPTO_USED(BN_nnmod);
+LCRYPTO_USED(BN_mod_add);
+LCRYPTO_USED(BN_mod_add_quick);
+LCRYPTO_USED(BN_mod_sub);
+LCRYPTO_USED(BN_mod_sub_quick);
+LCRYPTO_USED(BN_mod_mul);
+LCRYPTO_USED(BN_mod_sqr);
+LCRYPTO_USED(BN_mod_lshift1);
+LCRYPTO_USED(BN_mod_lshift1_quick);
+LCRYPTO_USED(BN_mod_lshift);
+LCRYPTO_USED(BN_mod_lshift_quick);
+LCRYPTO_USED(BN_mod_word);
+LCRYPTO_USED(BN_div_word);
+LCRYPTO_USED(BN_mul_word);
+LCRYPTO_USED(BN_add_word);
+LCRYPTO_USED(BN_sub_word);
+LCRYPTO_USED(BN_set_word);
+LCRYPTO_USED(BN_get_word);
+LCRYPTO_USED(BN_cmp);
+LCRYPTO_USED(BN_free);
+LCRYPTO_USED(BN_is_bit_set);
+LCRYPTO_USED(BN_lshift);
+LCRYPTO_USED(BN_lshift1);
+LCRYPTO_USED(BN_exp);
+LCRYPTO_USED(BN_mod_exp_mont_consttime);
+LCRYPTO_USED(BN_mod_exp_mont_word);
+LCRYPTO_USED(BN_mod_exp2_mont);
+LCRYPTO_USED(BN_mod_exp_simple);
+LCRYPTO_USED(BN_mask_bits);
+LCRYPTO_USED(BN_print_fp);
+LCRYPTO_USED(BN_print);
+LCRYPTO_USED(BN_rshift);
+LCRYPTO_USED(BN_rshift1);
+LCRYPTO_USED(BN_clear);
+LCRYPTO_USED(BN_dup);
+LCRYPTO_USED(BN_ucmp);
+LCRYPTO_USED(BN_set_bit);
+LCRYPTO_USED(BN_clear_bit);
+LCRYPTO_USED(BN_bn2hex);
+LCRYPTO_USED(BN_bn2dec);
+LCRYPTO_USED(BN_hex2bn);
+LCRYPTO_USED(BN_dec2bn);
+LCRYPTO_USED(BN_asc2bn);
+LCRYPTO_USED(BN_kronecker);
+LCRYPTO_USED(BN_mod_sqrt);
+LCRYPTO_USED(BN_consttime_swap);
+LCRYPTO_USED(BN_security_bits);
+LCRYPTO_USED(BN_generate_prime_ex);
+LCRYPTO_USED(BN_is_prime_ex);
+LCRYPTO_USED(BN_is_prime_fasttest_ex);
+LCRYPTO_USED(BN_MONT_CTX_new);
+LCRYPTO_USED(BN_mod_mul_montgomery);
+LCRYPTO_USED(BN_to_montgomery);
+LCRYPTO_USED(BN_from_montgomery);
+LCRYPTO_USED(BN_MONT_CTX_free);
+LCRYPTO_USED(BN_MONT_CTX_set);
+LCRYPTO_USED(BN_MONT_CTX_copy);
+LCRYPTO_USED(BN_MONT_CTX_set_locked);
+LCRYPTO_USED(BN_BLINDING_new);
+LCRYPTO_USED(BN_BLINDING_free);
+LCRYPTO_USED(BN_BLINDING_update);
+LCRYPTO_USED(BN_BLINDING_convert);
+LCRYPTO_USED(BN_BLINDING_invert);
+LCRYPTO_USED(BN_BLINDING_convert_ex);
+LCRYPTO_USED(BN_BLINDING_invert_ex);
+LCRYPTO_USED(BN_BLINDING_thread_id);
+LCRYPTO_USED(BN_BLINDING_get_flags);
+LCRYPTO_USED(BN_BLINDING_set_flags);
+LCRYPTO_USED(BN_BLINDING_create_param);
+LCRYPTO_USED(get_rfc2409_prime_768);
+LCRYPTO_USED(get_rfc2409_prime_1024);
+LCRYPTO_USED(BN_get_rfc2409_prime_768);
+LCRYPTO_USED(BN_get_rfc2409_prime_1024);
+LCRYPTO_USED(get_rfc3526_prime_1536);
+LCRYPTO_USED(get_rfc3526_prime_2048);
+LCRYPTO_USED(get_rfc3526_prime_3072);
+LCRYPTO_USED(get_rfc3526_prime_4096);
+LCRYPTO_USED(get_rfc3526_prime_6144);
+LCRYPTO_USED(get_rfc3526_prime_8192);
+LCRYPTO_USED(BN_get_rfc3526_prime_1536);
+LCRYPTO_USED(BN_get_rfc3526_prime_2048);
+LCRYPTO_USED(BN_get_rfc3526_prime_3072);
+LCRYPTO_USED(BN_get_rfc3526_prime_4096);
+LCRYPTO_USED(BN_get_rfc3526_prime_6144);
+LCRYPTO_USED(BN_get_rfc3526_prime_8192);
+LCRYPTO_USED(ERR_load_BN_strings);
+
+#endif /* _LIBCRYPTO_BN_H */