aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/modes
Commit message (Collapse)AuthorAgeFilesLines
* x86_64 assembly pack: "optimize" for Knights Landing, add AVX-512 results.Andy Polyakov2017-07-212-0/+5
| | | | | | | | | | | | | | | | | | "Optimize" is in quotes because it's rather a "salvage operation" for now. Idea is to identify processor capability flags that drive Knights Landing to suboptimial code paths and mask them. Two flags were identified, XSAVE and ADCX/ADOX. Former affects choice of AES-NI code path specific for Silvermont (Knights Landing is of Silvermont "ancestry"). And 64-bit ADCX/ADOX instructions are effectively mishandled at decode time. In both cases we are looking at ~2x improvement. AVX-512 results cover even Skylake-X :-) Hardware used for benchmarking courtesy of Atos, experiments run by Romain Dolbeau <romain.dolbeau@atos.net>. Kudos! Reviewed-by: Rich Salz <rsalz@openssl.org>
* Undo commit cd359b2Rich Salz2017-07-051-41/+0
| | | | | | | | | | | | | | | | | | Original text: Clarify use of |$end0| in stitched x86-64 AES-GCM code. There was some uncertainty about what the code is doing with |$end0| and whether it was necessary for |$len| to be a multiple of 16 or 96. Hopefully these added comments make it clear that the code is correct except for the caveat regarding low memory addresses. Change-Id: Iea546a59dc7aeb400f50ac5d2d7b9cb88ace9027 Reviewed-on: https://boringssl-review.googlesource.com/7194 Reviewed-by: Adam Langley <agl@google.com> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3700)
* modes/ocb128.c: address undefined behaviour warning.Andy Polyakov2017-05-261-58/+58
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3526)
* Remove filename argument to x86 asm_init.David Benjamin2017-05-111-1/+1
| | | | | | | | | | | | | | | 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)
* modes/ocb128.c: fix misaligned access in ILP32 builds on 64-bit processors.Andy Polyakov2017-03-221-1/+1
| | | | | | | | | One could have fixed the problem by arranging 64-bit alignment of EVP_AES_OCB_CTX.aad_buf in evp/e_aes.c, but CRYPTO_ocb128_aad prototype doesn't imply alignment and we have to honour it. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2994)
* Don't call memcpy if len is zero.Rich Salz2017-02-201-0/+6
| | | | | | | | | | | Prevent undefined behavior in CRYPTO_cbc128_encrypt: calling this function with the 'len' parameter being 0 would result in a memcpy where the source and destination parameters are the same, which is undefined behavior. Do same for AES_ige_encrypt. Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2671)
* ARMv4 assembly pack: harmonize Thumb-ification of iOS build.Andy Polyakov2017-02-151-1/+5
| | | | | | | Three modules were left behind in a285992763f3961f69a8d86bf7dfff020a08cef9. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2617)
* modes/asm/*-x86_64.pl: add CFI annotations.Andy Polyakov2017-02-132-0/+61
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* x86_64 assembly pack: Win64 SEH face-lift.Andy Polyakov2017-02-061-12/+23
| | | | | | | | - 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>
* modes/ctr128.c: fix false carry in counter increment procedure.Andy Polyakov2016-11-251-1/+1
| | | | | | | GH issue #1916 affects only big-endian platforms. TLS is not affected, because TLS fragment is never big enough. Reviewed-by: Matt Caswell <matt@openssl.org>
* Convert modes selftests (cts128 and gcm128) to internal testRichard Levitte2016-11-032-829/+0
| | | | Reviewed-by: Emilia Käsper <emilia@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1789)
* x86_64 assembly pack: add Goldmont performance results.Andy Polyakov2016-10-241-0/+1
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove trailing whitespace from some files.David Benjamin2016-10-104-10/+10
| | | | | | | | | | | | | | | | | | 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>
* modes/asm/ghash-armv4.pl: improve interoperability with Android NDK.Andy Polyakov2016-09-031-1/+3
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* ARMv8 assembly pack: add Samsung Mongoose results.Andy Polyakov2016-08-161-0/+1
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* spelling fixes, just comments and readme.klemens2016-08-051-3/+3
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1413)
* SPARC assembly pack: enforce V8+ ABI constraints.Andy Polyakov2016-07-011-0/+2
| | | | | | | | | | | Even though it's hard to imagine, it turned out that upper half of arguments passed to V8+ subroutine can be non-zero. ["n" pseudo-instructions, such as srln being srl in 32-bit case and srlx in 64-bit one, were implemented in binutils 2.10. It's assumed that Solaris assembler implemented it around same time, i.e. 2000.] Reviewed-by: Richard Levitte <levitte@openssl.org>
* Whitespace cleanup in cryptoFdaSilvaYY2016-06-291-1/+1
| | | | | | Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1264)
* Clarify use of |$end0| in stitched x86-64 AES-GCM code.Brian Smith2016-06-271-0/+41
| | | | | | | | | | | | | | There was some uncertainty about what the code is doing with |$end0| and whether it was necessary for |$len| to be a multiple of 16 or 96. Hopefully these added comments make it clear that the code is correct except for the caveat regarding low memory addresses. Change-Id: Iea546a59dc7aeb400f50ac5d2d7b9cb88ace9027 Reviewed-on: https://boringssl-review.googlesource.com/7194 Reviewed-by: Adam Langley <agl@google.com> Signed-off-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* modes/asm/ghashp8-ppc.pl: improve performance by 2.7x.Andy Polyakov2016-06-141-20/+449
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* x86_64 assembly pack: tolerate spaces in source directory name.Andy Polyakov2016-05-292-2/+2
| | | | | | [as it is now quoting $output is not required, but done just in case] Reviewed-by: Richard Levitte <levitte@openssl.org>
* Add OpenSSL copyright to .pl filesRich Salz2016-05-2112-12/+96
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Copyright consolidation 06/10Rich Salz2016-05-1711-430/+65
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Don't leak memory if realloc fails.Dr. Stephen Henson2016-05-121-2/+4
| | | | | | RT#4403 Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* fix tab-space mixed indentationFdaSilvaYY2016-05-091-1/+1
| | | | | | | No code change Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Alpha assembly pack: make it work on Linux.Andy Polyakov2016-05-041-1/+1
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* s390x assembly pack: cache capability query results.Andy Polyakov2016-04-251-3/+1
| | | | | | | | | IBM argues that in certain scenarios capability query is really expensive. At the same time it's asserted that query results can be safely cached, because disabling CPACF is incompatible with reboot-free operation. Reviewed-by: Tim Hudson <tjh@openssl.org>
* Remove --classic build entirelyRichard Levitte2016-04-201-76/+0
| | | | | | | | The Unix build was the last to retain the classic build scheme. The new unified scheme has matured enough, even though some details may need polishing. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove the remainder of util/mk1mf.pl and companion scriptsRichard Levitte2016-03-211-3/+0
| | | | | | | This removes all scripts that deal with MINFO as well, since that's only used by mk1mf. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Add $(LIB_CFLAGS) for any build.info generator that uses $(CFLAGS)Richard Levitte2016-03-131-2/+2
| | | | | | | The reason to do so is that some of the generators detect PIC flags like -fPIC and -KPIC, and those are normally delivered in LD_CFLAGS. Reviewed-by: Rich Salz <rsalz@openssl.org>
* crypto/*/build.info: make it work on ARM platforms.Andy Polyakov2016-03-111-3/+4
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix some assembler generating scripts for better unificationRichard Levitte2016-03-112-3/+3
| | | | | | | | | | | 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>
* Add include directory options for assembler files that include from crypto/Richard Levitte2016-03-101-0/+3
| | | | | | Closes RT#4406 Reviewed-by: Rich Salz <rsalz@openssl.org>
* Make sure the effect of "pic" / "no-pic" is used with assembler compilationsRichard Levitte2016-03-091-1/+1
| | | | | | | | | | | | | | Before the 'Introduce the "pic" / "no-pic" config option' commit, the shared_cflag value for the chosen config would be part of the make variable CFLAG, which got replicated into CFLAGS and ASFLAGS. Since said commit, the shared_cflag value has become a make variable of its own, SHARED_CFLAG (which is left empty in a "no-pic" build). However, ASFLAGS was forgotten. That's what's corrected with this change. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Add extra include directory for includers of ppc_arch.hRichard Levitte2016-03-091-0/+2
| | | | | | | | | crypto/evp/e_aes.c and crypto/modes/gcm128.c include ppc_arch.h, which is located in crypto/, so add that as extra include directory for them. Issue reported by Jeffrey Walton <noloader@gmail.com> Reviewed-by: Andy Polyakov <appro@openssl.org>
* Unified - adapt the generation of modes assembler to use GENERATERichard Levitte2016-03-095-28/+22
| | | | | | | | | This gets rid of the BEGINRAW..ENDRAW sections in crypto/modes/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: Andy Polyakov <appro@openssl.org>
* SPARCv9 assembly pack: unify build rules and argument handling.Andy Polyakov2016-03-083-14/+15
| | | | | | | | | | 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>
* modes/asm/ghash-x86_64.pl: refine GNU assembler version detection.Andy Polyakov2016-02-272-2/+2
| | | | | | | Even though AVX support was added in GAS 2.19 vpclmulqdq was apparently added in 2.20. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Always build library object files with shared library cflagsRichard Levitte2016-02-201-1/+1
| | | | | | | | | | | | | | | | This takes us away from the idea that we know exactly how our static libraries are going to get used. Instead, we make them available to build shareable things with, be it other shared libraries or DSOs. On the other hand, we also have greater control of when the shared library cflags. They will never be used with object files meant got binaries, such as apps/openssl or test/test*. With unified, we take this a bit further and prepare for having to deal with extra cflags specifically to be used with DSOs (dynamic engines), libraries and binaries (applications). Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove all special make depend flags, as well as OPENSSL_DOING_MAKEDEPENDRichard Levitte2016-02-181-1/+1
| | | | | | | | | | All those flags existed because we had all the dependencies versioned in the repository, and wanted to have it be consistent, no matter what the local configuration was. Now that the dependencies are gone from the versioned Makefile.ins, it makes much more sense to use the exact same flags as when compiling the object files. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove outdated DEBUG flags.Rich Salz2016-02-188-92/+0
| | | | | | | | | | | | | | | | | Add -DBIO_DEBUG to --strict-warnings. Remove comments about outdated debugging ifdef guards. Remove md_rand ifdef guarding an assert; it doesn't seem used. Remove the conf guards in conf_api since we use OPENSSL_assert, not assert. For pkcs12 stuff put OPENSSL_ in front of the macro name. Merge TLS_DEBUG into SSL_DEBUG. Various things just turned on/off asserts, mainly for checking non-NULL arguments, which is now removed: camellia, bn_ctx, crypto/modes. Remove some old debug code, that basically just printed things to stderr: DEBUG_PRINT_UNKNOWN_CIPHERSUITES, DEBUG_ZLIB, OPENSSL_RI_DEBUG, RL_DEBUG, RSA_DEBUG, SCRYPT_DEBUG. Remove OPENSSL_SSL_DEBUG_BROKEN_PROTOCOL. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Pass $(CC) to perlasm scripts via the environmentRichard Levitte2016-02-131-10/+10
| | | | | | | | It seems that on some platforms, the perlasm scripts call the C compiler for certain checks. These scripts need the environment variable CC to have the C compiler command. Reviewed-by: Rich Salz <rsalz@openssl.org>
* modes/ctr128.c: pay attention to ecount_buf alignment in CRYPTO_ctr128_encrypt.Andy Polyakov2016-02-121-24/+17
| | | | | | | | | It's never problem if CRYPTO_ctr128_encrypt is called from EVP, because buffer in question is always aligned within EVP_CIPHER_CTX structure. RT#4218 Reviewed-by: Richard Levitte <levitte@openssl.org>
* unified build scheme: add a "unified" template for Unix MakefileRichard Levitte2016-02-101-0/+27
| | | | | | This also adds all the raw sections needed for some files. Reviewed-by: Rich Salz <rsalz@openssl.org>
* GH601: Various spelling fixes.FdaSilvaYY2016-02-052-3/+3
| | | | | Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Restore xmm7 from the correct address on win64Kurt Roeckx2016-02-041-1/+1
| | | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> RT: #4288, MR: #1831
* unified build scheme: add build.info filesRichard Levitte2016-02-011-0/+5
| | | | | | | | | Now that we have the foundation for the "unified" build scheme in place, we add build.info files. They have been generated from the Makefiles in the same directories. Things that are platform specific will appear in later commits. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Templatize util/domdRich Salz2016-01-291-2/+1
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove /* foo.c */ commentsRich Salz2016-01-261-1/+0
| | | | | | | | | | | | This was done by the following find . -name '*.[ch]' | /tmp/pl where /tmp/pl is the following three-line script: print unless $. == 1 && m@/\* .*\.[ch] \*/@; close ARGV if eof; # Close file to reset $. And then some hand-editing of other files. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* Remove update tagsRich Salz2016-01-201-2/+0
| | | | | Also remove depend/local_depend. Reviewed-by: Richard Levitte <levitte@openssl.org>