1. 16 7月, 2018 1 次提交
    • N
      EC point multiplication: add `ladder` scaffold · 37124360
      Nicola Tuveri 提交于
      for specialized Montgomery ladder implementations
      
      PR #6009 and #6070 replaced the default EC point multiplication path for
      prime and binary curves with a unified Montgomery ladder implementation
      with various timing attack defenses (for the common paths when a secret
      scalar is feed to the point multiplication).
      The newly introduced default implementation directly used
      EC_POINT_add/dbl in the main loop.
      
      The scaffolding introduced by this commit allows EC_METHODs to define a
      specialized `ladder_step` function to improve performances by taking
      advantage of efficient formulas for differential addition-and-doubling
      and different coordinate systems.
      
      - `ladder_pre` is executed before the main loop of the ladder: by
        default it copies the input point P into S, and doubles it into R.
        Specialized implementations could, e.g., use this hook to transition
        to different coordinate systems before copying and doubling;
      - `ladder_step` is the core of the Montgomery ladder loop: by default it
        computes `S := R+S; R := 2R;`, but specific implementations could,
        e.g., implement a more efficient formula for differential
        addition-and-doubling;
      - `ladder_post` is executed after the Montgomery ladder loop: by default
        it's a noop, but specialized implementations could, e.g., use this
        hook to transition back from the coordinate system used for optimizing
        the differential addition-and-doubling or recover the y coordinate of
        the result point.
      
      This commit also renames `ec_mul_consttime` to `ec_scalar_mul_ladder`,
      as it better corresponds to what this function does: nothing can be
      truly said about the constant-timeness of the overall execution of this
      function, given that the underlying operations are not necessarily
      constant-time themselves.
      What this implementation ensures is that the same fixed sequence of
      operations is executed for each scalar multiplication (for a given
      EC_GROUP), with no dependency on the value of the input scalar.
      Co-authored-by: NSohaib ul Hassan <soh.19.hassan@gmail.com>
      Co-authored-by: NBilly Brumley <bbrumley@gmail.com>
      Reviewed-by: NAndy Polyakov <appro@openssl.org>
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/6690)
      37124360
  2. 20 6月, 2018 1 次提交
  3. 19 6月, 2018 1 次提交
    • S
      Implement coordinate blinding for EC_POINT · f667820c
      Sohaib ul Hassan 提交于
      This commit implements coordinate blinding, i.e., it randomizes the
      representative of an elliptic curve point in its equivalence class, for
      prime curves implemented through EC_GFp_simple_method,
      EC_GFp_mont_method, and EC_GFp_nist_method.
      
      This commit is derived from the patch
      https://marc.info/?l=openssl-dev&m=131194808413635 by Billy Brumley.
      
      Coordinate blinding is a generally useful side-channel countermeasure
      and is (mostly) free. The function itself takes a few field
      multiplicationss, but is usually only necessary at the beginning of a
      scalar multiplication (as implemented in the patch). When used this way,
      it makes the values that variables take (i.e., field elements in an
      algorithm state) unpredictable.
      
      For instance, this mitigates chosen EC point side-channel attacks for
      settings such as ECDH and EC private key decryption, for the
      aforementioned curves.
      
      For EC_METHODs using different coordinate representations this commit
      does nothing, but the corresponding coordinate blinding function can be
      easily added in the future to extend these changes to such curves.
      Co-authored-by: NNicola Tuveri <nic.tuv@gmail.com>
      Co-authored-by: NBilly Brumley <bbrumley@gmail.com>
      Reviewed-by: NAndy Polyakov <appro@openssl.org>
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/6501)
      f667820c
  4. 20 6月, 2017 1 次提交
  5. 17 7月, 2016 1 次提交
  6. 18 5月, 2016 1 次提交
  7. 02 3月, 2016 1 次提交
  8. 29 2月, 2016 1 次提交
  9. 27 1月, 2016 1 次提交
    • R
      Remove /* foo.c */ comments · 34980760
      Rich Salz 提交于
      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: NViktor Dukhovni <viktor@openssl.org>
      34980760
  10. 01 5月, 2015 1 次提交
    • R
      free NULL cleanup 7 · 23a1d5e9
      Rich Salz 提交于
      This gets BN_.*free:
          BN_BLINDING_free BN_CTX_free BN_FLG_FREE BN_GENCB_free
          BN_MONT_CTX_free BN_RECP_CTX_free BN_clear_free BN_free BUF_MEM_free
      
      Also fix a call to DSA_SIG_free to ccgost engine and remove some #ifdef'd
      dead code in engines/e_ubsec.
      Reviewed-by: NRichard Levitte <levitte@openssl.org>
      23a1d5e9
  11. 22 1月, 2015 1 次提交
  12. 08 12月, 2014 1 次提交
  13. 15 2月, 2011 1 次提交
    • D
      Reorganise ECC code for inclusion in FIPS module. · 84b08eee
      Dr. Stephen Henson 提交于
      Move compression, point2oct and oct2point functions into separate files.
      
      Add a flags field to EC_METHOD.
      
      Add a flag EC_FLAGS_DEFAULT_OCT to use the default compession and oct
      functions (all existing methods do this). This removes dependencies from
      EC_METHOD while keeping original functionality.
      84b08eee
  14. 27 4月, 2005 1 次提交
  15. 07 2月, 2003 1 次提交
  16. 18 11月, 2002 1 次提交
  17. 02 8月, 2002 2 次提交
    • B
      Rename implementations of method functions so that they match · 35b73a1f
      Bodo Möller 提交于
      the new method names where _GF... suffixes have been removed.
      
      Revert changes to ..._{get/set}_Jprojective_coordinates_...:
      The current implementation for ECC over binary fields does not use
      projective coordinates, and if it did, it would not use Jacobian
      projective coordinates; so it's OK to use the ..._GFp prefix for all
      this.
      
      Add author attributions to some files so that it doesn't look
      as if Sun wrote all of this :-)
      35b73a1f
    • B
      add support for elliptic curves over binary fields · 7793f30e
      Bodo Möller 提交于
      Submitted by: Duglas Stebila <douglas.stebila@sun.com>,
                    Sheueling Chang <sheueling.chang@sun.com>
      
      (CHANGES entries by Bodo Moeller)
      7793f30e
  18. 10 6月, 2002 1 次提交
  19. 08 5月, 2002 1 次提交
  20. 20 3月, 2002 1 次提交
  21. 18 3月, 2002 1 次提交
    • B
      Fix bugs and typos. · af28dd6c
      Bodo Möller 提交于
      Add some WTLS curves.
      New function EC_GROUP_check() (this will probably
      be implemented differently soon).
      
      Submitted by: Nils Larsch
      Reviewed by: Bodo Moeller
      af28dd6c
  22. 11 3月, 2001 1 次提交
  23. 09 3月, 2001 2 次提交
  24. 08 3月, 2001 3 次提交
  25. 07 3月, 2001 4 次提交
  26. 06 3月, 2001 3 次提交
  27. 04 6月, 1999 1 次提交
  28. 30 1月, 1999 1 次提交
  29. 24 1月, 1999 1 次提交
  30. 17 1月, 1999 1 次提交
    • D
      Time to blow up the source tree :-) This is the beginning of support for · f6aed2cd
      Dr. Stephen Henson 提交于
      GeneralizedTime. At several points PKIX specifies that GeneralizedTime can be
      used but OpenSSL doesn't currently support it. This patch adds several files
      and a bunch of functions.
      
      Of interest is the ASN1_TIME structure and its related functions. At several
      points certificates, CRLs et al specify that a time can be expressed as a
      choice of UTCTime and GeneralizedTime. Currently OpenSSL interprets this
      (wrongly) as UTCTime because GeneralizedTime isn't supported. The ASN1_TIME
      stuff provides this functionality.
      
      Still todo is to trace which cert and CRL points need an ASN1_TIME and modify
      the utilities appropriately and of course fix all the bugs.
      
      Note new OpenSSL copyright in the new file a_time.c. I didn't put it in
      a_gentm.c because it is a minimally modified form a_utctm.c .
      
      Since this adds new files and error codes you will need to do a 'make errors'
      at the top level to add the new codes.
      f6aed2cd