aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/bn/asm
Commit message (Collapse)AuthorAgeFilesLines
* Remove filename argument to x86 asm_init.David Benjamin2017-05-116-6/+6
| | | | | | | | | | | | | | | The assembler already knows the actual path to the generated file and, in other perlasm architectures, is left to manage debug symbols itself. Notably, in OpenSSL 1.1.x's new build system, which allows a separate build directory, converting .pl to .s as the scripts currently do result in the wrong paths. This also avoids inconsistencies from some of the files using $0 and some passing in the filename. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3431)
* More typo fixesFdaSilvaYY2017-03-291-1/+1
| | | | | | | | Fix some comments too [skip ci] Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3069)
* bn/asm/sparcv9-mont.pl: fix squaring code path.Andy Polyakov2017-03-241-13/+16
| | | | | | | | This module is used only with odd input lengths, i.e. not used in normal PKI cases, on contemporary processors. The problem was "illuminated" by fuzzing tests. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Reset executable bits on files where not needed.Bernd Edlinger2017-03-031-0/+0
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2835)
* bn/asm: clean up unused PA-RISC modules.Andy Polyakov2017-03-022-3236/+0
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Clean up references to FIPSEmilia Kasper2017-02-281-4/+0
| | | | | | | | | | | This removes the fips configure option. This option is broken as the required FIPS code is not available. FIPS_mode() and FIPS_mode_set() are retained for compatibility, but FIPS_mode() always returns 0, and FIPS_mode_set() can only be used to turn FIPS mode off. Reviewed-by: Stephen Henson <steve@openssl.org>
* Fix typo in x86_64-mont5.pl CFI directivesDavid Benjamin2017-02-171-1/+1
| | | | | | Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2655)
* Fix copy-pasteism in CFI directives.Adam Langley2017-02-102-10/+10
| | | | | | | | | | | | 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)
* bn/asm/x86_64*: add DWARF CFI directives.Andy Polyakov2017-02-095-2/+324
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* bn/asm/rsaz-avx2.pl: refine Win64 SE handler.Andy Polyakov2017-02-091-5/+12
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* x86_64 assembly pack: Win64 SEH face-lift.Andy Polyakov2017-02-064-13/+22
| | | | | | | | - 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>
* bn/asm/x86_64-mont5.pl: fix carry bug in bn_sqr8x_internal.Andy Polyakov2017-01-261-9/+7
| | | | | | CVE-2017-3732 Reviewed-by: Rich Salz <rsalz@openssl.org>
* bn/asm/ppc-mont.pl: signal no-op in 32-bit bit build.Andy Polyakov2016-11-251-0/+1
| | | | | | | | | | The bug was introduced in 80d27cdb84985c697f8fabb7649abf1f54714d13, one too many instructions was removed. It went unnoticed, because new subroutine introduced in previous commit is called in real-life RSA/DSA/DH cases, while original code is called only in rare tests. The bug was caught in test_fuzz. Reviewed-by: Rich Salz <rsalz@openssl.org>
* bn/asm/x86_64-mont.pl: fix for CVE-2016-7055 (Low severity).Andy Polyakov2016-11-101-3/+2
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* ppccap.c: engage new multipplication and squaring subroutines.Andy Polyakov2016-10-241-3/+0
| | | | | | [And remove FPU mutiplication subroutine.] Reviewed-by: Rich Salz <rsalz@openssl.org>
* bn/asm/ppc-mont.pl: add optimized multiplication and squaring subroutines.Andy Polyakov2016-10-241-1/+1645
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* bn/asm/ppc-mont.pl: prepare for extension.Andy Polyakov2016-10-241-19/+24
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove trailing whitespace from some files.David Benjamin2016-10-1015-192/+192
| | | | | | | | | | | | | | | | | | 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>
* MIPS assembly pack: adapt it for MIPS[32|64]R6.Andy Polyakov2016-09-022-413/+431
| | | | | | | | | MIPS[32|64]R6 is binary and source incompatible with previous MIPS ISA specifications. Fortunately it's still possible to resolve differences in source code with standard pre-processor and switching to trap-free version of addition and subtraction instructions. Reviewed-by: Richard Levitte <levitte@openssl.org>
* crypto/bn/*: x86[_64] division instruction doesn't handle constants, change ↵Andy Polyakov2016-08-311-1/+1
| | | | | | | constraint from 'g' to 'r'. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
* bn/asm/ppc.pl: harmonize .size directive in bn_mul_words.Andy Polyakov2016-08-291-1/+1
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* bn/asm/x86[_64]-mont*.pl: implement slightly alternative page-walking.Andy Polyakov2016-08-223-179/+274
| | | | | | | | | | | | | | | | 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>
* spelling fixes, just comments and readme.klemens2016-08-057-10/+10
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1413)
* Add final(?) set of copyrights.Rich Salz2016-06-017-15/+42
| | | | | | | | | Add copyright to missing assembler files. Add copyrights to missing test/* files. Add copyrights Various source and misc files. Reviewed-by: Richard Levitte <levitte@openssl.org>
* x86_64 assembly pack: tolerate spaces in source directory name.Andy Polyakov2016-05-295-5/+5
| | | | | | [as it is now quoting $output is not required, but done just in case] Reviewed-by: Richard Levitte <levitte@openssl.org>
* VMS: remove last VAX vestigesRichard Levitte2016-05-231-6440/+0
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Add OpenSSL copyright to .pl filesRich Salz2016-05-2126-26/+208
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Copyright consolidation 06/10Rich Salz2016-05-171-0/+9
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Copyright consolidation: perl filesRich Salz2016-04-204-4/+29
| | | | | | | | | Add copyright to most .pl files This does NOT cover any .pl file that has other copyright in it. Most of those are Andy's but some are public domain. Fix typo's in some existing files. Reviewed-by: Richard Levitte <levitte@openssl.org>
* PPC assembly pack: remove branch hints.Andy Polyakov2016-04-073-16/+16
| | | | | | | | | | As it turns out branch hints grew as kind of a misconception. In addition their interpretation by GNU assembler is affected by assembler flags and can end up with opposite meaning on different processors. As we have to loose quite a lot on misinterprerations, especially on newer processors, we just omit them altogether. Reviewed-by: Tim Hudson <tjh@openssl.org>
* On Windows, page walking is known as __chkstk.Emilia Kasper2016-03-153-0/+6
| | | | Reviewed-by: Andy Polyakov <appro@openssl.org>
* Explain *cough*-dowsEmilia Kasper2016-03-153-3/+3
| | | | Reviewed-by: Andy Polyakov <appro@openssl.org>
* Fix some assembler generating scripts for better unificationRichard Levitte2016-03-116-8/+8
| | | | | | | | | | | Some of these scripts would recognise an output parameter if it looks like a file path. That works both in both the classic and new build schemes. Some fo these scripts would only recognise it if it's a basename (i.e. no directory component). Those need to be corrected, as the output parameter in the new build scheme is more likely to contain a directory component than not. Reviewed-by: Andy Polyakov <appro@openssl.org>
* SPARCv9 assembly pack: unify build rules and argument handling.Andy Polyakov2016-03-083-22/+18
| | | | | | | | | | Make all scripts produce .S, make interpretation of $(CFLAGS) pre-processor's responsibility, start accepting $(PERLASM_SCHEME). [$(PERLASM_SCHEME) is redundant in this case, because there are no deviataions between Solaris and Linux assemblers. This is purely to unify .pl->.S handling across all targets.] Reviewed-by: Richard Levitte <levitte@openssl.org>
* Unified - adapt the generation of bignum assembler to use GENERATERichard Levitte2016-03-0713-2/+50
| | | | | | | | | This gets rid of the BEGINRAW..ENDRAW sections in crypto/bn/build.info. This also moves the assembler generating perl scripts to take the output file name as last command line argument, where necessary. Reviewed-by: Rich Salz <rsalz@openssl.org>
* bn/asm/x86[_64]-mont*.pl: complement alloca with page-walking.Andy Polyakov2016-03-073-2/+116
| | | | | | | | | | | 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>
* Consistently use arm_arch.h constants in armcap assembly code.David Benjamin2016-03-021-1/+1
| | | | | | | | Most of the assembly uses constants from arm_arch.h, but a few references to ARMV7_NEON don't. Consistently use the macros everywhere. Signed-off-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* bn/asm/x86_64-mont5.pl: unify gather procedure in hardly used pathAndy Polyakov2016-03-012-199/+278
| | | | | | | | | 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>
* crypto/bn/x86_64-mont5.pl: constant-time gather procedure.Andy Polyakov2016-03-012-544/+664
| | | | | | | | | | | | 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>
* bn/asm/rsaz-avx2.pl: constant-time gather procedure.Andy Polyakov2016-03-012-89/+152
| | | | | | | | | Performance penalty is 2%. CVE-2016-0702 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* bn/asm/rsax-x86_64.pl: constant-time gather procedure.Andy Polyakov2016-03-011-84/+291
| | | | | | | | | Performance penalty is 2% on Linux and 5% on Windows. CVE-2016-0702 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* GH601: Various spelling fixes.FdaSilvaYY2016-02-053-4/+4
| | | | | Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* bn/asm/bn-c64xplus.asm: update commentary.Andy Polyakov2015-12-221-2/+3
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* x86_64 assembly pack: tune clang version detection even further.Andy Polyakov2015-12-133-3/+3
| | | | | | RT#4171 Reviewed-by: Kurt Roeckx <kurt@openssl.org>
* ARMv4 assembly pack: allow Thumb2 even in iOS build,Andy Polyakov2015-12-072-2/+2
| | | | | | and engage it in most modules. Reviewed-by: Tim Hudson <tjh@openssl.org>
* bn/asm/x86_64-mont5.pl: fix carry propagating bug (CVE-2015-3193).Andy Polyakov2015-12-031-3/+19
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* x86_64 assembly pack: tune clang version detection.Andy Polyakov2015-11-233-3/+3
| | | | | | RT#4142 Reviewed-by: Richard Levitte <levitte@openssl.org>
* bn/asm/ppc64-mont.pl: adapt for little-endian.Andy Polyakov2015-11-161-86/+88
| | | | | | | The problem remained unnoticed so far, because it's never called by default. You have to craft OPENSSL_ppccap environment variable to trigger the problem. Reviewed-by: Richard Levitte <levitte@openssl.org>
* bn/asm/s390x.S: improve performance on z196 and z13 by up to 26%. [even z10 ↵Andy Polyakov2015-11-161-37/+72
| | | | | | is couple percent faster]. Triggered by RT#4128, but solves the problem by real modulo-scheduling. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix typosAlessandro Ghedini2015-10-231-1/+1
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>