aboutsummaryrefslogtreecommitdiff
path: root/crypto/bn/asm/x86_64-mont.pl
AgeCommit message (Collapse)AuthorFilesLines
2020-08-27Ignore vendor name in Clang version number.Jung-uk Kim1-1/+1
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)
2020-04-23Update copyright yearMatt Caswell1-1/+1
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11616)
2020-02-17Also check for errors in x86_64-xlate.pl.David Benjamin1-1/+1
In https://github.com/openssl/openssl/pull/10883, I'd meant to exclude the perlasm drivers since they aren't opening pipes and do not particularly need it, but I only noticed x86_64-xlate.pl, so arm-xlate.pl and ppc-xlate.pl got the change. That seems to have been fine, so be consistent and also apply the change to x86_64-xlate.pl. Checking for errors is generally a good idea. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: David Benjamin <davidben@google.com> (Merged from https://github.com/openssl/openssl/pull/10930)
2020-01-22Do not silently truncate files on perlasm errorsDavid Benjamin1-1/+1
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). Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/10883)
2020-01-17For all assembler scripts where it matters, recognise clang > 9.xRichard Levitte1-1/+1
Fixes #10853 Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/10855)
2019-09-16Unify all assembler file generatorsRichard Levitte1-4/+6
They now generally conform to the following argument sequence: script.pl "$(PERLASM_SCHEME)" [ C preprocessor arguments ... ] \ $(PROCESSOR) <output file> However, in the spirit of being able to use these scripts manually, they also allow for no argument, or for only the flavour, or for only the output file. This is done by only using the last argument as output file if it's a file (it has an extension), and only using the first argument as flavour if it isn't a file (it doesn't have an extension). While we're at it, we make all $xlate calls the same, i.e. the $output argument is always quoted, and we always die on error when trying to start $xlate. There's a perl lesson in this, regarding operator priority... This will always succeed, even when it fails: open FOO, "something" || die "ERR: $!"; The reason is that '||' has higher priority than list operators (a function is essentially a list operator and gobbles up everything following it that isn't lower priority), and since a non-empty string is always true, so that ends up being exactly the same as: open FOO, "something"; This, however, will fail if "something" can't be opened: open FOO, "something" or die "ERR: $!"; The reason is that 'or' has lower priority that list operators, i.e. it's performed after the 'open' call. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9884)
2018-12-06Following the license change, modify the boilerplates in crypto/bn/Richard Levitte1-1/+1
[skip ci] Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7777)
2018-05-29Update copyright yearMatt Caswell1-1/+1
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 Polyakov1-39/+38
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 Soref1-2/+2
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-02-10Fix copy-pasteism in CFI directives.Adam Langley1-5/+5
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 Polyakov1-0/+72
Reviewed-by: Rich Salz <rsalz@openssl.org>
2017-02-06x86_64 assembly pack: Win64 SEH face-lift.Andy Polyakov1-6/+6
- 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>
2016-11-10bn/asm/x86_64-mont.pl: fix for CVE-2016-7055 (Low severity).Andy Polyakov1-3/+2
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-08-22bn/asm/x86[_64]-mont*.pl: implement slightly alternative page-walking.Andy Polyakov1-78/+107
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 Polyakov1-1/+1
[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 Salz1-1/+8
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-15On Windows, page walking is known as __chkstk.Emilia Kasper1-0/+2
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-03-15Explain *cough*-dowsEmilia Kasper1-1/+1
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-03-07bn/asm/x86[_64]-mont*.pl: complement alloca with page-walking.Andy Polyakov1-1/+41
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 Polyakov1-62/+126
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 Polyakov1-33/+6
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 Polyakov1-1/+1
RT#4171 Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-11-23x86_64 assembly pack: tune clang version detection.Andy Polyakov1-1/+1
RT#4142 Reviewed-by: Richard Levitte <levitte@openssl.org>
2014-09-12crypto/bn/asm/x86_64-mont*.pl: add missing clang detection.Andy Polyakov1-0/+5
Reviewed-by: Rich Salz <rsalz@openssl.org>
2014-07-09x86_64 assembly pack: improve masm support.Andy Polyakov1-2/+4
2013-12-09bn/asm/x86_64-mont5.pl: add MULX/AD*X code path.Andy Polyakov1-1720/+141
This also eliminates code duplication between x86_64-mont and x86_64-mont and optimizes even original non-MULX code.
2013-10-25bn/asm/x86_64-mont.pl: minor optimization [for Decoded ICache].Andy Polyakov1-138/+151
2013-10-14bn/asm/*x86_64*.pl: correct assembler requirement for ad*x.Andy Polyakov1-1/+1
2013-10-03bn/asm/x86_64-mont*.pl: add MULX/ADCX/ADOX code path.Andy Polyakov1-38/+1196
2013-09-09crypto/bn/asm/x86_64-mont.pl: minor optimization.Andy Polyakov1-13/+3
2013-07-05bn/asm/x86_86-mont.pl: optimize reduction for Intel Core family.Andy Polyakov1-312/+449
2013-02-02x86_64 assembly pack: keep making Windows build more robust.Andy Polyakov1-1/+2
PR: 2963 and a number of others
2012-06-27x86_64 assembly pack: make it possible to compile with Perl located onAndy Polyakov1-1/+1
path with spaces. PR: 2835
2011-10-17x86_64-mont.pl: minor optimization.Andy Polyakov1-18/+13
2011-08-12This commit completes recent modular exponentiation optimizations onAndy Polyakov1-2/+3
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.
2011-08-09x86_64-mont.pl: futher optimization resulting in up to 48% improvementAndy Polyakov1-181/+1050
(4096-bit RSA sign benchmark on Core2) in comparison to initial version from 2005.
2011-07-05x86_64-mont.pl: add squaring procedure and improve RSA sign performanceAndy Polyakov1-11/+496
by up to 38% (4096-bit benchmark on Core2).
2010-05-05Revert previous Linux-specific/centric commit#19629. If it really has toAndy Polyakov1-1/+0
be done, it's definitely not the way to do it. So far answer to the question was to ./config -Wa,--noexecstack (adopted by RedHat).
2010-05-05Non-executable stack in asm.Ben Laurie1-0/+1
2008-12-19x86_64 assembler pack: add support for Win64 SEH.Andy Polyakov1-10/+126
2008-02-27Make x86_64-mont.pl work with debug Win64 build.Andy Polyakov1-0/+1
2007-06-29Latest bn_mont.c modification broke ECDSA test. I've got math wrong, whichAndy Polyakov1-4/+1
is fixed now.
2007-06-21Typo in x86_64-mont.pl.Andy Polyakov1-1/+1
PR: 1549
2007-06-17Eliminate conditional final subtraction in Montgomery assembler modules.Andy Polyakov1-27/+28
2006-12-29Minor clean-up in crypto/bn/asm.Andy Polyakov1-1/+7
2006-12-08Minor, +10%, tune-up for x86_64-mont.pl.Andy Polyakov1-15/+16
2005-10-22Change bn_mul_mont declaration and BN_MONT_CTX. Update CHANGES.Andy Polyakov1-1/+3
2005-10-07x86_64-mont.pl readability improvement.Andy Polyakov1-15/+14
2005-10-07Throw in Montgomery multiplication assembler for x86_64.Andy Polyakov1-0/+207