summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn.h
AgeCommit message (Collapse)Author
2011-06-06Backport from HEAD:Dr. Stephen Henson
New option to disable characteristic two fields in EC code. Make no-ec2m work on Win32 build.
2011-03-19Apply all the changes submitted by Steven M. Schweda <sms@antinode.info>Richard Levitte
2011-01-09add X9.31 prime generation routines from 0.9.8 branchDr. Stephen Henson
2008-11-12Revert the size_t modifications from HEAD that had led to moreGeoff Thorpe
knock-on work than expected - they've been extracted into a patch series that can be completed elsewhere, or in a different branch, before merging back to HEAD.
2008-11-11symbol deobnoxificationBodo Möller
2008-11-01size_tification.Ben Laurie
2008-10-22Apparently '__top' is also risky, obfuscate further. (All this toGeoff Thorpe
avoid inlines...)
2008-10-22Use of a 'top' var creates "shadow variable" warnings.Geoff Thorpe
2008-10-19Constification.Ben Laurie
2008-10-15Optimize bn_correct_top.Andy Polyakov
2008-08-06Remove the dual-callback scheme for numeric and pointer thread IDs,Geoff Thorpe
deprecate the original (numeric-only) scheme, and replace with the CRYPTO_THREADID object. This hides the platform-specifics and should reduce the possibility for programming errors (where failing to explicitly check both thread ID forms could create subtle, platform-specific bugs). Thanks to Bodo, for invaluable review and feedback.
2008-07-03Revert my earlier CRYPTO_THREADID commit, I will commit a reworkedGeoff Thorpe
version some time soon.
2008-05-01Montgomery-related minor cleanups/documentationBodo Möller
2008-03-28There was a need to support thread ID types that couldn't be reliably castGeoff Thorpe
to 'unsigned long' (ie. odd platforms/compilers), so a pointer-typed version was added but it required portable code to check *both* modes to determine equality. This commit maintains the availability of both thread ID types, but deprecates the type-specific accessor APIs that invoke the callbacks - instead a single type-independent API is used. This simplifies software that calls into this interface, and should also make it less error-prone - as forgetting to call and compare *both* thread ID accessors could have led to hard-to-debug/infrequent bugs (that might only affect certain platforms or thread implementations). As the CHANGES note says, there were corresponding deprecations and replacements in the thread-related functions for BN_BLINDING and ERR too.
2007-06-11Privatize BN_*_no_branch.Andy Polyakov
2007-04-19fix error codesBodo Möller
2007-03-28Change to mitigate branch prediction attacksBodo Möller
Submitted by: Matthew D Wood Reviewed by: Bodo Moeller
2006-06-23New functions CRYPTO_set_idptr_callback(),Bodo Möller
CRYPTO_get_idptr_callback(), CRYPTO_thread_idptr() for a 'void *' type thread ID, since the 'unsigned long' type of the existing thread ID does not always work well.
2006-06-18Change array representation of binary polynomials to make GF2m part ofBodo Möller
the BN library more generally useful. Submitted by: Douglas Stebila
2006-04-11Add support for setting keybits and public exponent value for pkey RSA keygen.Dr. Stephen Henson
2006-01-13fix commentNils Larsch
PR: 1270
2005-12-16We all make typos:-) Fix just introduced ones in bn.hAndy Polyakov
2005-12-16Eliminate warning induced by http://cvs.openssl.org/chngview?cn=14690 andAndy Polyakov
keep disclaiming narrower than 32-bit support.
2005-12-15Allow for bn(64,32) on LP64 platforms.Andy Polyakov
2005-11-06Move declaration for optional bn_mul_mont to bn_lcl.h in order to hideAndy Polyakov
it from mkdef.pl.
2005-10-22Change bn_mul_mont declaration and BN_MONT_CTX. Update CHANGES.Andy Polyakov
2005-10-06Leave the decision to call/implement bn_sqr_mont to assembler developer.Andy Polyakov
2005-10-05Initialize bignum constants using BN_bin2bn() instead of BN_hex2bn(). ThisDr. Stephen Henson
saves a bit of space and avoids a compiler warning about string length.
2005-10-04Reserve for SMALL_FOOTPRINT bn_asm.c. Currently OPENSSL_SMALL_FOOTPRINTAndy Polyakov
is defined on Windows CE targets.
2005-10-04Add reference implementation for bn_[mul|sqr]_mont, new candidates forAndy Polyakov
assembler implementation.
2005-08-28fix warnings when building openssl with the following compiler options:Nils Larsch
-Wmissing-prototypes -Wcomment -Wformat -Wimplicit -Wmain -Wmultichar -Wswitch -Wshadow -Wtrigraphs -Werror -Wchar-subscripts -Wstrict-prototypes -Wreturn-type -Wpointer-arith -W -Wunused -Wno-unused-parameter -Wuninitialized
2005-08-21Make D-H safer, include well-known primes.Ben Laurie
2005-06-28Replace _int64 with __int64, which is more widely accepted among Win32Andy Polyakov
compiler vendors.
2005-05-27Use BN_with_flags() in a cleaner way.Bodo Möller
2005-05-16Implement fixed-window exponentiation to mitigate hyper-threadingBodo Möller
timing attacks. BN_FLG_EXP_CONSTTIME requests this algorithm, and this done by default for RSA/DSA/DH private key computations unless RSA_FLAG_NO_EXP_CONSTTIME/DSA_FLAG_NO_EXP_CONSTTIME/ DH_FLAG_NO_EXP_CONSTTIME is set. Submitted by: Matthew D Wood Reviewed by: Bodo Moeller
2005-05-11Fix more error codes.Bodo Möller
(Also improve util/ck_errf.pl script, and occasionally fix source code formatting.)
2005-05-06Since BN_LLONG will only be defined for Alpha/VMS and not VAX/VMS,Richard Levitte
there's no need to undefine it here. Then, let's get a bit paranoid and not define BN_ULLONG on THIRTY_TWO_BIT machines when BN_LLONG isn't defined.
2005-05-03remove BN_ncopy, it was only used in bn_nist.c and wasn't particularNils Larsch
useful anyway
2005-04-26Port BN_MONT_CTX_set_locked() from stable branch.Dr. Stephen Henson
The function rsa_eay_mont_helper() has been removed because it is no longer needed after this change.
2005-04-26some updates for the blinding code; summary:Nils Larsch
- possibility of re-creation of the blinding parameters after a fixed number of uses (suggested by Bodo) - calculatition of the rsa::e in case it's absent and p and q are present (see bug report #785) - improve the performance when if one rsa structure is shared by more than a thread (see bug report #555) - fix the problem described in bug report #827 - hide the definition ot the BN_BLINDING structure in bn_blind.c
2005-04-26Fix various incorrect error function codes.Bodo Möller
("perl util/ck_errf.pl */*.c */*/*.c" still reports many more.)
2005-04-22- use BN_set_negative and BN_is_negative instead of BN_set_signNils Larsch
and BN_get_sign - implement BN_set_negative as a function - always use "#define BN_is_zero(a) ((a)->top == 0)"
2004-07-06Improve error handling if decompression of an ec point fails, and cleanupGeoff Thorpe
ec_curve.c (unify comments, etc). Submitted by: Nils Larsch Reviewed by: Bodo Moeller, Geoff Thorpe
2004-06-20Tidy up, including;Geoff Thorpe
- Remove unused and unuseful debug cruft. - Remove unnecessary 'top' fudging from BN_copy(). - Fix a potential memory leak and simplify the expansion logic in BN_bin2bn(). Submitted by: Nils Larsch Reviewed by: Geoff Thorpe
2004-06-17Deprecate unused cruft, and "make update".Geoff Thorpe
2004-05-15Make some more API types opaquely available from ossl_typ.h, meaning theGeoff Thorpe
corresponding headers are only required for API functions or structure details. This now includes the bignum types and BUF_MEM. Subsequent commits will remove various dependencies on bn.h and buffer.h and update the makefile dependencies.
2004-03-17Variety of belt-tightenings in the bignum code. (Please help test this!)Geoff Thorpe
- Remove some unnecessary "+1"-like fudges. Sizes should be handled exactly, as enlarging size parameters causes needless bloat and may just make bugs less likely rather than fixing them: bn_expand() macro, bn_expand_internal(), and BN_sqr(). - Deprecate bn_dup_expand() - it's new since 0.9.7, unused, and not that useful. - Remove unnecessary zeroing of unused bytes in bn_expand2(). - Rewrite BN_set_word() - it should be much simpler, the previous complexities probably date from old mismatched type issues. - Add missing bn_check_top() macros in bn_word.c - Improve some degenerate case handling in BN_[add|sub]_word(), add comments, and avoid a bignum expansion if an overflow isn't possible.
2004-03-13The efforts to eliminate the dual-representation of zero and to ensureGeoff Thorpe
bignums are passed in and out of functions and APIs in a consistent form has highlighted that zero-valued bignums don't need any allocated word data. The use of BN_set_word() to initialise a bignum to zero causes needless allocation and gives it a return value that must be checked. This change converts BN_zero() to a self-contained macro that has no return/expression value and does not cause any expansion of bignum data. Note, it would be tempting to rewrite the deprecated version as a success-valued comma expression, such as; #define BN_zero(a) ((a)->top = (a)->neg = 0, 1) However, this evaluates 'a' twice and would confuse initialisation loops (eg. while(..) { BN_zero(bn++) } ). As such, the deprecated version continues to use BN_set_word().
2003-12-02BN_FLG_FREE is of extremely dubious usefulness, and is only referred toGeoff Thorpe
once in the source (where it is set for the benefit of no other code whatsoever). I've deprecated the declaration in the header and likewise made the use of the flag conditional in bn_lib.c. Note, this change also NULLs the 'd' pointer in a BIGNUM when it is reset but not deallocated.
2003-11-30If BN_STRICT is defined, don't accept an ambiguous representation of zeroGeoff Thorpe
(ie. where top may be zero, or it may be one if the corresponding word is set to zero). Note, this only affects the macros in bn.h, there are probably similar corrections required in some c files. Also, clarify the audit-related macros at the top of the header. Mental note: I must not forget to clean all this out before 0.9.8 is released ...