diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2017-01-21 09:39:00 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2017-01-21 09:39:00 +0000 |
commit | d72a49db2abb4d0175558c0ed9cfe32bb823e995 (patch) | |
tree | d84c050de13e09525d074865e8758d44957eb961 /lib/libcrypto/bn/bn.h | |
parent | 2d1075983628703aac703b8864e75f366bf69b2b (diff) |
Make explicit _ct and _nonct versions of bn_mod_exp funcitons that
matter for constant time, and make the public interface only used
external to the library.
This moves us to a model where the important things are constant time
versions unless you ask for them not to be, rather than the opposite.
I'll continue with this method by method.
Add regress tests for same.
ok jsing@
Diffstat (limited to 'lib/libcrypto/bn/bn.h')
-rw-r--r-- | lib/libcrypto/bn/bn.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libcrypto/bn/bn.h b/lib/libcrypto/bn/bn.h index 5f8278faa8e..16ba8ae9810 100644 --- a/lib/libcrypto/bn/bn.h +++ b/lib/libcrypto/bn/bn.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bn.h,v 1.32 2016/12/21 15:49:29 jsing Exp $ */ +/* $OpenBSD: bn.h,v 1.33 2017/01/21 09:38:58 beck Exp $ */ /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -418,10 +418,12 @@ int BN_lshift(BIGNUM *r, const BIGNUM *a, int n); 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_mod_exp_mont_word(BIGNUM *r, BN_ULONG a, const BIGNUM *p, |