summaryrefslogtreecommitdiffstats
path: root/crypto/aes
AgeCommit message (Collapse)Author
2018-03-27Update copyright yearMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2018-02-28Always use adr with __thumb2__.David Benjamin
Thumb2 addresses are a bit a mess, depending on whether a label is interpreted as a function pointer value (for use with BX and BLX) or as a program counter value (for use with PC-relative addressing). Clang's integrated assembler mis-assembles this code. See https://crbug.com/124610#c54 for details. Instead, use the ADR pseudo-instruction which has clear semantics and should be supported by every assembler that handles the OpenSSL Thumb2 code. (In other files, the ADR vs SUB conditionals are based on __thumb2__ already. For some reason, this one is based on __APPLE__, I'm guessing to deal with an older version of clang assembler.) It's unclear to me which of clang or binutils is "correct" or if this is even a well-defined notion beyond "whatever binutils does". But I will note that https://github.com/openssl/openssl/pull/4669 suggests binutils has also changed behavior around this before. Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5431) (cherry picked from commit 8a5d8bc4bc1e835b62d988ad63454540be83d862)
2017-11-05aes/asm/{aes-armv4|bsaes-armv7}.pl: make it work with binutils-2.29.Andy Polyakov
It's not clear if it's a feature or bug, but binutils-2.29[.1] interprets 'adr' instruction with Thumb2 code reference differently, in a way that affects calculation of addresses of constants' tables. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/4669) (cherry picked from commit b82acc3c1a7f304c9df31841753a0fa76b5b3cda)
2017-10-22s390x assembly pack: define OPENSSL_s390xcap_P in s390xcap.cPatrick Steuer
Remove all .comm definitions from the asm modules. Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com> Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4563)
2017-10-17s390x assembly pack: remove capability double-checking.Patrick Steuer
An instruction's QUERY function is executed at initialization, iff the required MSA level is installed. Therefore, it is sufficient to check the bits returned by the QUERY functions. The MSA level does not have to be checked at every function call. crypto/aes/asm/aes-s390x.pl: The AES key schedule must be computed if the required KM or KMC function codes are not available. Formally, the availability of a KMC function code does not imply the availability of the corresponding KM function code. Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com> Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4501) (cherry picked from commit af1d638730bdfad85a7fa8c3f157b2828eda7c1d)
2017-10-17crypto/aes/asm/aes-s390x.pl: fix $softonly=1 code path.Patrick Steuer
Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com> Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4501) (cherry picked from commit 4c5100ce7d66ccff48d6435c1761b5e3281de61f)
2017-07-24aes/asm/aesni-sha*-x86_64.pl: add SHAEXT performance results.Andy Polyakov
Reviewed-by: Kurt Roeckx <kurt@roeckx.be> (Merged from https://github.com/openssl/openssl/pull/3898) (cherry picked from commit 1843787173da9b07029d0863e236107b1dd4fdd7)
2017-03-30More typo fixesFdaSilvaYY
Backport of 69687aa829bc8bdcaf5468eb3dd0ada13700b7aa (Merged from #3069) Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3079)
2017-03-26aes/asm/bsaes-armv7.pl: relax stack alignment requirement.Andy Polyakov
Even though Apple refers to Procedure Call Standard for ARM Architecture (AAPCS), they apparently adhere to custom version that doesn't follow stack alignment constraints in the said standard. [Why or why? If it's vendor lock-in thing, then it would be like worst spot ever.] And since bsaes-armv7 relied on standard alignment, it became problematic to execute the code on iOS. Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 0822d41b6d54132df96c02cc6f6fa9b179378351)
2017-03-22aes/asm/aesni-sha*-x86_64.pl: fix IV handling in SHAEXT paths.Andy Polyakov
Initial IV was disregarded on SHAEXT-capable processors. Amazingly enough bulk AES128-SHA* talk-to-yourself tests were passing. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2992) (cherry picked from commit 08d09628d2c9f3ef599399d8cad021a07ab98347)
2017-02-20Don't call memcpy if len is zero.Rich Salz
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) (cherry picked from commit b1498c98f3fb5b8a340acc9ce20b0fd5346294e5)
2017-02-15ARMv4 assembly pack: harmonize Thumb-ification of iOS build.Andy Polyakov
Three modules were left behind in a285992763f3961f69a8d86bf7dfff020a08cef9. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2617) (cherry picked from commit c93f06c12f10c07cea935abd78a07a037e27f155)
2016-11-11PPC assembler pack: add some PPC970/G5 performance data.Andy Polyakov
Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit cebb186989067b39fca6ebc378e4957408f6e701)
2016-11-10aes/asm/aesp8-ppc.pl: improve [backward] portability.Andy Polyakov
Some of stone-age assembler can't cope with r0 in address. It's actually sensible thing to do, because r0 is shunted to 0 in address arithmetic and by refusing r0 assembler effectively makes you understand that. Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit a54aba531327285f64cf13a909bc129e9f9d5970)
2016-10-24x86_64 assembly pack: add Goldmont performance results.Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit ace05265d2d599e350cf84ed60955b7f2b173bc9)
2016-08-16ARMv8 assembly pack: add Samsung Mongoose results.Andy Polyakov
Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-08-05spelling fixes, just comments and readme.klemens
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1413)
2016-07-20Fix a few if(, for(, while( inside code.FdaSilvaYY
Fix some indentation at the same time Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1292)
2016-07-16aes/asm/aesfx-sparcv9.pl: switch to fshiftorx to improve single-blockAndy Polyakov
and short-input performance. [Fix bug in misaligned output handling.] Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-07-16SPARC assembly pack: enforce V8+ ABI constraints.Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-07-16aes/asm/aesfx-sparcv9.pl: add "teaser" CBC and CTR subroutines.Andy Polyakov
[Also optimize aligaddr usage in single-block subroutines.] Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-29Whitespace cleanup in cryptoFdaSilvaYY
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)
2016-06-20aes/asm/bsaes-armv7.pl: omit redundant stores in XTS subroutines.Andy Polyakov
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-20aes/asm/bsaes-armv7.pl: fix XTS decrypt test failure.Andy Polyakov
RT#4578 Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-14aes/asm/aesp8-ppc.pl: implement "tweak chaining".Andy Polyakov
This is useful in Linux kernel context, in cases data happens to be fragmented and processing can take multiple calls. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-14aes/asm/aesp8-ppc.pl: add XTS subroutines.Andy Polyakov
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-01Add final(?) set of copyrights.Rich Salz
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>
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-28SPARC assembly pack: add missing .type directives.Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-21Add OpenSSL copyright to .pl filesRich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-17Copyright consolidation 05/10Rich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-04MIPS assembly pack: fix MIPS64 assembler warnings.Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-04-25s390x assembly pack: cache capability query results.Andy Polyakov
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>
2016-04-20Remove --classic build entirelyRichard Levitte
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>
2016-04-20Add AES assembly module for Fujitsu SPARC64 X/X+.Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-04-07PPC assembly pack: remove branch hints.Andy Polyakov
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>
2016-04-07Clean-up *_DEBUG options.Andy Polyakov
Since NDEBUG is defined unconditionally on command line for release builds, we can omit *_DEBUG options in favour of effective "all-on" in debug builds exercised though CI. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org>
2016-03-21Remove the remainder of util/mk1mf.pl and companion scriptsRichard Levitte
This removes all scripts that deal with MINFO as well, since that's only used by mk1mf. Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-03-20Remove #error from include files.Rich Salz
Don't have #error statements in header files, but instead wrap the contents of that file in #ifndef OPENSSL_NO_xxx This means it is now always safe to include the header file. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-13Add $(LIB_CFLAGS) for any build.info generator that uses $(CFLAGS)Richard Levitte
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>
2016-03-11crypto/*/build.info: make it work on ARM platforms.Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-11Fix some assembler generating scripts for better unificationRichard Levitte
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>
2016-03-10Add include directory options for assembler files that include from crypto/Richard Levitte
A few were missed in the previous commit. Closes RT#4412 Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-10Add include directory options for assembler files that include from crypto/Richard Levitte
Closes RT#4406 Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-09Make sure the effect of "pic" / "no-pic" is used with assembler compilationsRichard Levitte
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>
2016-03-09Unified - adapt the generation of aes assembler to use GENERATERichard Levitte
This gets rid of the BEGINRAW..ENDRAW sections in crypto/aes/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>
2016-03-08SPARCv9 assembly pack: unify build rules and argument handling.Andy Polyakov
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>
2016-02-20Always build library object files with shared library cflagsRichard Levitte
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>
2016-02-18Remove all special make depend flags, as well as OPENSSL_DOING_MAKEDEPENDRichard Levitte
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>
2016-02-13Pass $(CC) to perlasm scripts via the environmentRichard Levitte
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>