summaryrefslogtreecommitdiffstats
path: root/crypto/bn/asm/x86_64-mont5.pl
AgeCommit message (Collapse)Author
2020-08-27Ignore vendor name in Clang version number.Jung-uk Kim
For example, FreeBSD prepends "FreeBSD" to version string, e.g., FreeBSD clang version 11.0.0 (git@github.com:llvm/llvm-project.git llvmorg-11.0.0-rc2-0-g414f32a9e86) Target: x86_64-unknown-freebsd13.0 Thread model: posix InstalledDir: /usr/bin This prevented us from properly detecting AVX support, etc. CLA: trivial Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Ben Kaduk <kaduk@mit.edu> (Merged from https://github.com/openssl/openssl/pull/12725) (cherry picked from commit cd84d8832d274357a5ba5433640d7ef76691b1ac)
2020-03-17Update copyright yearMatt Caswell
Reviewed-by: Paul Yang <kaishen.yy@antfin.com> (Merged from https://github.com/openssl/openssl/pull/11344)
2020-02-17Do not silently truncate files on perlasm errorsDavid Benjamin
If one of the perlasm xlate drivers crashes, OpenSSL's build will currently swallow the error and silently truncate the output to however far the driver got. This will hopefully fail to build, but better to check such things. Handle this by checking for errors when closing STDOUT (which is a pipe to the xlate driver). This is the OpenSSL 1.1.1 version of https://github.com/openssl/openssl/pull/10883 and https://github.com/openssl/openssl/pull/10930. Reviewed-by: Mark J. Cox <mark@awe.com> Reviewed-by: Paul Dale David Benjamin <davidben@google.com> (Merged from https://github.com/openssl/openssl/pull/10931)
2020-01-17For all assembler scripts where it matters, recognise clang > 9.xRichard Levitte
Fixes #10853 Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/10857)
2019-12-20Add some missing cfi frame info in x86_64-mont5.plBernd Edlinger
Reviewed-by: Kurt Roeckx <kurt@roeckx.be> (Merged from https://github.com/openssl/openssl/pull/10651) (cherry picked from commit 0190c52ab8b4cdf5fe577b3d924576167c892a15)
2019-02-26Update copyright yearMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8347)
2019-02-17Fix some CFI issues in x86_64 assemblyDavid Benjamin
The add/double shortcut in ecp_nistz256-x86_64.pl left one instruction point that did not unwind, and the "slow" path in AES_cbc_encrypt was not annotated correctly. For the latter, add .cfi_{remember,restore}_state support to perlasm. Next, fill in a bunch of functions that are missing no-op .cfi_startproc and .cfi_endproc blocks. libunwind cannot unwind those stack frames otherwise. Finally, work around a bug in libunwind by not encoding rflags. (rflags isn't a callee-saved register, so there's not much need to annotate it anyway.) These were found as part of ABI testing work in BoringSSL. Reviewed-by: Richard Levitte <levitte@openssl.org> GH: #8109 (cherry picked from commit c0e8e5007ba5234d4d448e82a1567e0c4467e629)
2018-05-29Update copyright yearMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6371)
2018-05-02bn/asm/*-mont.pl: harmonize with BN_from_montgomery_word.Andy Polyakov
Montgomery multiplication post-conditions in some of code paths were formally non-constant time. Cache access pattern was result-neutral, but a little bit asymmetric, which might have produced a signal [if processor reordered load and stores at run-time]. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6141)
2017-11-11Many spelling fixes/typo's corrected.Josh Soref
Around 138 distinct errors found and fixed; thanks! Reviewed-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3459)
2017-11-02bn/asm/x86_64-mont5.pl: fix carry bug in bn_sqrx8x_internal.Andy Polyakov
Credit to OSS-Fuzz for finding this. CVE-2017-3736 Reviewed-by: Rich Salz <rsalz@openssl.org>
2017-02-17Fix typo in x86_64-mont5.pl CFI directivesDavid Benjamin
Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2655)
2017-02-10Fix copy-pasteism in CFI directives.Adam Langley
I don't think this actually affects anything since the cfi_restore directives aren't strictly needed anyway. (The old values are still in memory so either will do.) CLA: trivial Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2582)
2017-02-09bn/asm/x86_64*: add DWARF CFI directives.Andy Polyakov
Reviewed-by: Rich Salz <rsalz@openssl.org>
2017-02-06x86_64 assembly pack: Win64 SEH face-lift.Andy Polyakov
- harmonize handlers with guidelines and themselves; - fix some bugs in handlers; - add missing handlers in chacha and ecp_nistz256 modules; Reviewed-by: Rich Salz <rsalz@openssl.org>
2017-01-26bn/asm/x86_64-mont5.pl: fix carry bug in bn_sqr8x_internal.Andy Polyakov
CVE-2017-3732 Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-10-10Remove trailing whitespace from some files.David Benjamin
The prevailing style seems to not have trailing whitespace, but a few lines do. This is mostly in the perlasm files, but a few C files got them after the reformat. This is the result of: find . -name '*.pl' | xargs sed -E -i '' -e 's/( |'$'\t'')*$//' find . -name '*.c' | xargs sed -E -i '' -e 's/( |'$'\t'')*$//' find . -name '*.h' | xargs sed -E -i '' -e 's/( |'$'\t'')*$//' Then bn_prime.h was excluded since this is a generated file. Note mkerr.pl has some changes in a heredoc for some help output, but other lines there lack trailing whitespace too. Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-08-22bn/asm/x86[_64]-mont*.pl: implement slightly alternative page-walking.Andy Polyakov
Original strategy for page-walking was adjust stack pointer and then touch pages in order. This kind of asks for double-fault, because if touch fails, then signal will be delivered to frame above adjusted stack pointer. But touching pages prior adjusting stack pointer would upset valgrind. As compromise let's adjust stack pointer in pages, touching top of the stack. This still asks for double-fault, but at least prevents corruption of neighbour stack if allocation is to overstep the guard page. Also omit predict-non-taken hints as they reportedly trigger illegal instructions in some VM setups. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-29x86_64 assembly pack: tolerate spaces in source directory name.Andy Polyakov
[as it is now quoting $output is not required, but done just in case] Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-21Add OpenSSL copyright to .pl filesRich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-15On Windows, page walking is known as __chkstk.Emilia Kasper
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-03-15Explain *cough*-dowsEmilia Kasper
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-03-07bn/asm/x86[_64]-mont*.pl: complement alloca with page-walking.Andy Polyakov
Some OSes, *cough*-dows, insist on stack being "wired" to physical memory in strictly sequential manner, i.e. if stack allocation spans two pages, then reference to farmost one can be punishable by SEGV. But page walking can do good even on other OSes, because it guarantees that villain thread hits the guard page before it can make damage to innocent one... Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-01bn/asm/x86_64-mont5.pl: unify gather procedure in hardly used pathAndy Polyakov
and reorganize/harmonize post-conditions. Additional hardening following on from CVE-2016-0702 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-01crypto/bn/x86_64-mont5.pl: constant-time gather procedure.Andy Polyakov
At the same time remove miniscule bias in final subtraction. Performance penalty varies from platform to platform, and even with key length. For rsa2048 sign it was observed to be 4% for Sandy Bridge and 7% on Broadwell. CVE-2016-0702 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-12-13x86_64 assembly pack: tune clang version detection even further.Andy Polyakov
RT#4171 Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-12-03bn/asm/x86_64-mont5.pl: fix carry propagating bug (CVE-2015-3193).Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-11-23x86_64 assembly pack: tune clang version detection.Andy Polyakov
RT#4142 Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-24bn/asm/x86_64-mont5.pl: fix valgrind error.Andy Polyakov
bn_get_bits5 was overstepping array boundary by 1 byte. It was exclusively read overstep and data could not have been used. The only potential problem would be if array happens to end on the very edge of last accesible page. Reviewed-by: Richard Levitte <levitte@openssl.org>
2014-09-12crypto/bn/asm/x86_64-mont*.pl: add missing clang detection.Andy Polyakov
Reviewed-by: Rich Salz <rsalz@openssl.org>
2014-07-09x86_64 assembly pack: improve masm support.Andy Polyakov
2014-01-09bn/asm/x86_64-mont5.pl: fix compilation error on Solaris.Andy Polyakov
2013-12-09bn/asm/x86_64-mont5.pl: add MULX/AD*X code path.Andy Polyakov
This also eliminates code duplication between x86_64-mont and x86_64-mont and optimizes even original non-MULX code.
2013-12-03bn/asm/x86_64-mont5.pl: comply with Win64 ABI.Andy Polyakov
PR: 3189 Submitted by: Oscar Ciurana
2013-10-14bn/asm/*x86_64*.pl: correct assembler requirement for ad*x.Andy Polyakov
2013-10-03bn/asm/x86_64-mont*.pl: add MULX/ADCX/ADOX code path.Andy Polyakov
2013-02-02x86_64 assembly pack: keep making Windows build more robust.Andy Polyakov
PR: 2963 and a number of others
2012-06-27x86_64 assembly pack: make it possible to compile with Perl located onAndy Polyakov
path with spaces. PR: 2835
2011-10-17bn_exp.c: further optimizations using more ideas fromAndy Polyakov
http://eprint.iacr.org/2011/239.
2011-10-13Fix OPENSSL_BN_ASM_MONT5 for corner cases; add a test.Bodo Möller
Submitted by: Emilia Kasper
2011-08-14x86_64-mont5.pl: add missing Win64 support.Andy Polyakov
2011-08-12This commit completes recent modular exponentiation optimizations onAndy Polyakov
x86_64 platform. It targets specifically RSA1024 sign (using ideas from http://eprint.iacr.org/2011/239) and adds more than 10% on most platforms. Overall performance improvement relative to 1.0.0 is ~40% in average, with best result of 54% on Westmere. Incidentally ~40% is average improvement even for longer key lengths.