aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/ec/curve448
Commit message (Collapse)AuthorAgeFilesLines
* Copyright year updatesRichard Levitte2024-04-091-1/+1
| | | | | | | | | | Reviewed-by: Neil Horman <nhorman@openssl.org> Release: yes (cherry picked from commit 0ce7d1f355c1240653e320a3f6f8109c1f05f8c0) Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/24034)
* Rearrange terms in gf_mul to prevent segfaultAngel Baez2024-02-091-3/+3
| | | | | | | | CLA: trivial Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/23512)
* Correct comment in crypto/ec/curve448/ed448.hChristian Schmidt2023-11-011-1/+1
| | | | | | | | | | | Obvious Copy&Paste&not edit error. CLA: trivial Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22573)
* Copyright year updatesMatt Caswell2023-09-281-1/+1
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Release: yes
* "foo * bar" should be "foo *bar"Dimitri Papadopoulos2023-09-112-4/+4
| | | | | | | | Found by running the checkpatch.pl Linux script to enforce coding style. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21468)
* Copyright year updatesMatt Caswell2023-09-077-7/+7
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Release: yes
* Changes to resolve symbol conflict due to gf_mulPankul942023-07-145-107/+107
| | | | | | | | | | | CLA: trivial Changed names of internal functions to resolve symbol conflict when Openssl is used with intel/ISA-L. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21421)
* Support all five EdDSA instances from RFC 8032James Muir2023-01-132-47/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #6277 Description: Make each of the five EdDSA instances defined in RFC 8032 -- Ed25519, Ed25519ctx, Ed25519ph, Ed448, Ed448ph -- available via the EVP APIs. The desired EdDSA instance is specified via an OSSL_PARAM. All instances, except for Ed25519, allow context strings as input. Context strings are passed via an OSSL_PARAM. For Ed25519ctx, the context string must be nonempty. Ed25519, Ed25519ctx, Ed448 are PureEdDSA instances, which means that the full message (not a digest) must be passed to sign and verify operations. Ed25519ph, Ed448ph are HashEdDSA instances, which means that the input message is hashed before sign and verify. Testing: All 21 test vectors from RFC 8032 have been added to evppkey_ecx.txt (thanks to Shane Lontis for showing how to do that). Those 21 test vectors are exercised by evp_test.c and cover all five instances. Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/19705)
* Update copyright yearMatt Caswell2022-05-032-2/+2
| | | | | Reviewed-by: Tomas Mraz <tomas@openssl.org> Release: yes
* Fix Coverity 1498612 & 1503221: integer overflowPauli2022-04-031-1/+7
| | | | | | | | | Both are the same issue and both as false positives. Annotate the line so that this is ignored. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/18012)
* Fix Coverity 1498612: integer overflowPauli2022-03-251-0/+1
| | | | | | | | | The assert added cannot ever fail because (current & 0xFFFF) != 0 from the while loop and the trailing zero bit count therefore cannot be as large as 32. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/17892)
* Move e_os.h to include/internalRichard Levitte2022-02-052-2/+2
| | | | | | | | | | | | Including e_os.h with a path from a header file doesn't work well on certain exotic platform. It simply fails to build. Since we don't seem to be able to stop ourselves, the better move is to move e_os.h to an include directory that's part of the inclusion path given to the compiler. Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17641)
* Fix copyrightsTodd Short2022-02-033-6/+6
| | | | | | | | | Add copyright to files that were missing it. Update license from OpenSSL to Apache as needed. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17606)
* Fix the parameter type of gf_serializeBernd Edlinger2021-09-172-2/+2
| | | | | | | | | | | | | It is better to use array bounds for improved gcc warning checks. While "uint8_t*" allows arbitrary pointer arithmetic using "uint8_t[SER_BYTES]" limits the pointer arithmetic to the range 0..SER_BYTES. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16376)
* Update copyright yearMatt Caswell2021-06-171-1/+1
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15801)
* Use <> for #include openssl/xxxRich Salz2021-05-272-2/+2
| | | | | | Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15468)
* Fix warning in gf_serializeJuergen Christ2021-05-241-1/+1
| | | | | | | | | | | | | | | | | | | Compiling under -Werror fails in gf_serialize: crypto/ec/curve448/f_generic.c:21:27: error: argument 1 of type 'uint8_t[56]' {aka 'unsigned char[56]'} with mismatched bound [-Werror=array-parameter=] 21 | void gf_serialize(uint8_t serial[SER_BYTES], const gf x, int with_hibit) | ~~~~~~~~^~~~~~~~~~~~~~~~~ In file included from crypto/ec/curve448/f_generic.c:12: crypto/ec/curve448/field.h:65:28: note: previously declared as 'uint8_t *' {aka 'unsigned char *'} void gf_serialize(uint8_t *serial, const gf x, int with_highbit); ~~~~~~~~~^~~~~~ Changed parameter to pointer to fix this warning. Signed-off-by: Juergen Christ <jchrist@linux.ibm.com> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15376)
* Fix build failure with MSVCTomas Mraz2021-04-222-0/+2
| | | | | | Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14983)
* Avoid the need for Configure time 128-bit int detectionMatt Caswell2021-04-222-2/+20
| | | | | | | | | | | | | | We just detect this at compile time instead. This avoids cross-compilation problems where the host platform supports 128-bit ints, but the target platform does not (or vice versa). This was causing a problem on some platforms where, dependent on the CFLAGS, 128 bit ints were either supported or not. Fixes #14804 Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14941)
* Update copyright yearMatt Caswell2021-04-0814-14/+14
| | | | | Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14801)
* curve448: Integrate 64-bit reference implementationAmitay Isaacs2021-04-083-4/+14
| | | | | | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14784)
* curve448: Use constant time zero check functionAmitay Isaacs2021-04-081-5/+3
| | | | | | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14784)
* curve448: Remove the unrolled loop versionAmitay Isaacs2021-04-081-124/+16
| | | | | | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14784)
* curve448: Use NLIMBS where appropriate to simplify the codeAmitay Isaacs2021-04-081-6/+6
| | | | | | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14784)
* curve448: Modernise reference 64-bit codeAmitay Isaacs2021-04-083-30/+37
| | | | | | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14784)
* curve448: Rename arch_ref64 to arch_64Amitay Isaacs2021-04-083-0/+0
| | | | | | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14784)
* Partially Revert "Remove curve448 architecture specific files"Amitay Isaacs2021-04-083-0/+388
| | | | | | | | | | This reverts commit 7e492f3372ed83af074a63d5920f13de7e3455b6. This brings back the 64-bit reference implementation for curve448. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14784)
* curve448: Use relative includes to avoid explicit dependenciesAmitay Isaacs2021-04-083-3/+3
| | | | | | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14784)
* Use numbers definition of int128_t and uint128_tAmitay Isaacs2021-04-082-4/+6
| | | | | | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14784)
* Add ossl_ ecx symbolsShane Lontis2021-03-187-225/+277
| | | | | | | Partial fix for #12964 Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14473)
* Update copyright yearMatt Caswell2020-10-151-1/+1
| | | | | Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/13144)
* Rename OPENSSL_CTX prefix to OSSL_LIB_CTXDr. Matthias St. Pierre2020-10-153-21/+21
| | | | | | | | | | | | Many of the new types introduced by OpenSSL 3.0 have an OSSL_ prefix, e.g., OSSL_CALLBACK, OSSL_PARAM, OSSL_ALGORITHM, OSSL_SERIALIZER. The OPENSSL_CTX type stands out a little by using a different prefix. For consistency reasons, this type is renamed to OSSL_LIB_CTX. Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12621)
* Fix ecx so that is uses a settable propertyqueryShane Lontis2020-09-233-36/+49
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12944)
* unify spelling of serializePauli2020-07-301-1/+1
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12104)
* Update copyright yearMatt Caswell2020-04-233-3/+3
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11616)
* ecx: add key generation support.Pauli2020-04-171-3/+0
| | | | | | | Specifically for x25519, x448, ed25519 and ed448. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11371)
* Implement provider support for Ed25519 annd Ed448Matt Caswell2020-03-092-9/+1
| | | | | | | | | At the moment we only provider support for these algorithms in the default provider. These algorithms only support "one shot" EVP_DigestSign() and EVP_DigestVerify() as per the existing libcrypto versions. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11261)
* crypto/ec/curve448/eddsa.c: fix EBCDIC platformsPatrick Steuer2020-03-051-1/+6
| | | | | | | Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11229)
* Implement a stricter ECX_KEY typeMatt Caswell2020-02-112-6/+1
| | | | | | | | | | Add ref counting and control how we allocate storage for the private key. We will need this type in following commits where we move the ecx code to be provider aware. Reviewed-by: Patrick Steuer <patrick.steuer@de.ibm.com> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/10964)
* Fix header file include guard namesDr. Matthias St. Pierre2019-09-288-23/+23
| | | | | | | | | | | | | Make the include guards consistent by renaming them systematically according to the naming conventions below For the public header files (in the 'include/openssl' directory), the guard names try to match the path specified in the include directives, with all letters converted to upper case and '/' and '.' replaced by '_'. For the private header files files, an extra 'OSSL_' is added as prefix. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9333)
* Reorganize local header filesDr. Matthias St. Pierre2019-09-285-4/+4
| | | | | | | | | | | | | Apart from public and internal header files, there is a third type called local header files, which are located next to source files in the source directory. Currently, they have different suffixes like '*_lcl.h', '*_local.h', or '*_int.h' This commit changes the different suffixes to '*_local.h' uniformly. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9333)
* New function EVP_MD_free()Richard Levitte2019-09-041-3/+3
| | | | | | | | | | | | | | | This function re-implements EVP_MD_meth_free(), but has a name that isn't encumbered by legacy EVP_MD construction functionality. We also refactor most of EVP_MD_meth_new() into an internal evp_md_new() that's used when creating fetched methods. EVP_MD_meth_new() and EVP_MD_meth_free() are rewritten in terms of evp_md_new() and EVP_MD_free(). This means that at any time, we can deprecate all the EVP_MD_meth_ functions with no harmful consequence. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/9758)
* Make the EC code available from inside the FIPS providerMatt Caswell2019-08-063-50/+82
| | | | | Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/9380)
* Remove tab characters from C source files.Pauli2019-07-161-2/+2
| | | | | | | Some have been creeping into the source code. Reviewed-by: Paul Yang <yang.yang@baishancloud.com> (Merged from https://github.com/openssl/openssl/pull/9397)
* Fixed linux_x86_icc compiler errors in EC code related to __uint128_t/__int128_tShane Lontis2019-04-111-2/+4
| | | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8697)
* fix truncation of integers on 32bit AIXShane Lontis2019-03-114-429/+1437
| | | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8417)
* Remove unnecessary trailing whitespaceSam Roberts2019-02-051-7/+7
| | | | | | | | | | | | Trim trailing whitespace. It doesn't match OpenSSL coding standards, AFAICT, and it can cause problems with git tooling. Trailing whitespace remains in test data and external source. Reviewed-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8092)
* Disallow Ed448 signature malleabilityMatt Caswell2018-12-111-2/+28
| | | | | | | | | | Check that s is less than the order before attempting to verify the signature as per RFC8032 5.2.7 Fixes #7706 Reviewed-by: Kurt Roeckx <kurt@roeckx.be> (Merged from https://github.com/openssl/openssl/pull/7748)
* Following the license change, modify the boilerplates in crypto/ec/Richard Levitte2018-12-0614-14/+14
| | | | | | | [skip ci] Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7791)
* Fix some undefined behaviour in the Curve448 code (2nd attempt)Dr. Matthias St. Pierre2018-08-031-6/+3
| | | | | | | | | | | | | Fixes #6800 Replaces #5418 This commit reverts commit 7876dbffcee9 and moves the check for a zero-length input down the callstack into sha3_update(). Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/6838)