-/* $OpenBSD: bn.h,v 1.77 2024/03/02 09:27:31 tb Exp $ */
+/* $OpenBSD: bn.h,v 1.78 2024/04/10 14:58:06 beck Exp $ */
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
int BN_is_negative(const BIGNUM *b);
-#ifndef LIBRESSL_INTERNAL
int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
BN_CTX *ctx);
#define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
-#endif
+
int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx);
int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx);
int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m);
int BN_lshift1(BIGNUM *r, const BIGNUM *a);
int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
-#ifndef LIBRESSL_INTERNAL
int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx);
int BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
-#endif
int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont);
int BN_hex2bn(BIGNUM **a, const char *str);
int BN_dec2bn(BIGNUM **a, const char *str);
int BN_asc2bn(BIGNUM **a, const char *str);
-#ifndef LIBRESSL_INTERNAL
int BN_gcd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
-#endif
int BN_kronecker(const BIGNUM *a,const BIGNUM *b,BN_CTX *ctx); /* returns -2 for error */
-#ifndef LIBRESSL_INTERNAL
BIGNUM *BN_mod_inverse(BIGNUM *ret,
const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx);
-#endif
BIGNUM *BN_mod_sqrt(BIGNUM *ret,
const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx);
-/* $OpenBSD: bn_exp.c,v 1.52 2024/03/02 09:27:31 tb Exp $ */
+/* $OpenBSD: bn_exp.c,v 1.53 2024/04/10 14:58:06 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
return BN_mod_exp_mont_internal(rr, a, p, m, ctx, in_mont,
(BN_get_flags(p, BN_FLG_CONSTTIME) != 0));
}
+LCRYPTO_ALIAS(BN_mod_exp_mont);
int
BN_mod_exp_mont_ct(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
return BN_mod_exp_internal(r, a, p, m, ctx,
(BN_get_flags(p, BN_FLG_CONSTTIME) != 0));
}
+LCRYPTO_ALIAS(BN_mod_exp);
int
BN_mod_exp_ct(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
-/* $OpenBSD: bn_gcd.c,v 1.28 2023/06/02 17:15:30 tb Exp $ */
+/* $OpenBSD: bn_gcd.c,v 1.29 2024/04/10 14:58:06 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
BN_CTX_end(ctx);
return (ret);
}
-
-int
-BN_gcd_nonct(BIGNUM *r, const BIGNUM *in_a, const BIGNUM *in_b, BN_CTX *ctx)
-{
- return BN_gcd(r, in_a, in_b, ctx);
-}
+LCRYPTO_ALIAS(BN_gcd);
/*
* BN_gcd_no_branch is a special version of BN_mod_inverse_no_branch.
(BN_get_flags(n, BN_FLG_CONSTTIME) != 0));
return BN_mod_inverse_internal(in, a, n, ctx, ct);
}
+LCRYPTO_ALIAS(BN_mod_inverse);
BIGNUM *
BN_mod_inverse_nonct(BIGNUM *in, const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
-/* $OpenBSD: bn.h,v 1.6 2024/03/02 09:27:31 tb Exp $ */
+/* $OpenBSD: bn.h,v 1.7 2024/04/10 14:58:06 beck Exp $ */
/*
* Copyright (c) 2023 Bob Beck <beck@openbsd.org>
*
LCRYPTO_USED(BN_get_rfc3526_prime_6144);
LCRYPTO_USED(BN_get_rfc3526_prime_8192);
LCRYPTO_USED(ERR_load_BN_strings);
+LCRYPTO_UNUSED(BN_div);
+LCRYPTO_UNUSED(BN_mod_exp);
+LCRYPTO_UNUSED(BN_mod_exp_mont);
+LCRYPTO_UNUSED(BN_gcd);
+LCRYPTO_UNUSED(BN_mod_inverse);
#endif /* _LIBCRYPTO_BN_H */