Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turbocharge by using Jacobi representation, 2-ary NAF and precomputation #127

Merged
merged 34 commits into from
Dec 2, 2019

Commits on Dec 2, 2019

  1. Configuration menu
    Copy the full SHA
    0e876d4 View commit details
    Browse the repository at this point in the history
  2. microoptimise contains_point

    do one multiplication less
    tomato42 committed Dec 2, 2019
    Configuration menu
    Copy the full SHA
    a93e33d View commit details
    Browse the repository at this point in the history
  3. prepare Point for Jacobi implementation

    make operations work correctly with PointJacobi in future
    
    since scaling Jacobi implementation to affine representation is expensive
    it's less computationally intensive to perform those operations using
    jacobi representation
    tomato42 committed Dec 2, 2019
    Configuration menu
    Copy the full SHA
    0133840 View commit details
    Browse the repository at this point in the history
  4. add implementation of EC using Jacobi representation

    since Jacobi representation doesn't require calculation of modulo
    inverse for every addition or doubling, operations on it are much
    faster than with affine coordinates
    tomato42 committed Dec 2, 2019
    Configuration menu
    Copy the full SHA
    b70d735 View commit details
    Browse the repository at this point in the history
  5. precompute for generators

    tomato42 committed Dec 2, 2019
    Configuration menu
    Copy the full SHA
    d1ded44 View commit details
    Browse the repository at this point in the history
  6. curves: pep8 fixes

    tomato42 committed Dec 2, 2019
    Configuration menu
    Copy the full SHA
    5e1afee View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    0cb3b1c View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    a8317c6 View commit details
    Browse the repository at this point in the history
  9. speed up scaling

    also change one cubing into multiplication
    tomato42 committed Dec 2, 2019
    Configuration menu
    Copy the full SHA
    5d210e3 View commit details
    Browse the repository at this point in the history
  10. implement equality without inverse_mod

    since inverse_mod is very computationally expensive (around 100
    multiplications) it's cheaper to just bring the fractions to the
    same denominator
    tomato42 committed Dec 2, 2019
    Configuration menu
    Copy the full SHA
    dae2f33 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    08e3576 View commit details
    Browse the repository at this point in the history
  12. verify in one place, skip for self-created points

    when loading public keys, perform the point verification just once
    when loading private keys, do not verify the derived public point
    tomato42 committed Dec 2, 2019
    Configuration menu
    Copy the full SHA
    6c7099d View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    191898c View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    304c522 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    90b3564 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    d60ec5e View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    a96af14 View commit details
    Browse the repository at this point in the history
  18. speed up test suite

    make all test cases execute in less than 0.3s on i7 4790K
    tomato42 committed Dec 2, 2019
    Configuration menu
    Copy the full SHA
    19962f1 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    48040d7 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    58eef88 View commit details
    Browse the repository at this point in the history
  21. move numeric code out of __add__

    don't treat the universal code for point addition specially
    tomato42 committed Dec 2, 2019
    Configuration menu
    Copy the full SHA
    ab07a0c View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    d4c2387 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    b0084d9 View commit details
    Browse the repository at this point in the history
  24. use tuples for calculation of multiplication

    since this avoids creating new PointJacobi after every addition
    it makes the signing about 20% faster
    tomato42 committed Dec 2, 2019
    Configuration menu
    Copy the full SHA
    272349f View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    6469c2e View commit details
    Browse the repository at this point in the history
  26. remove duplicated test cases

    looks like few merges/rebases didn't go exactly as planned and ended up
    duplicating test code, remove it
    tomato42 committed Dec 2, 2019
    Configuration menu
    Copy the full SHA
    7d9c556 View commit details
    Browse the repository at this point in the history
  27. coverage: exclude environment branches in test cases

    since some branching in hypothesis strategies and in handling
    different python, hypothesis, openssl and unittest versions is necessary,
    ignore them for branch coverage
    
    remove benchmarking code and dead code from test_pyecdsa.py
    (we have speed.py now)
    
    and exclude a disabled test case from coverage
    tomato42 committed Dec 2, 2019
    Configuration menu
    Copy the full SHA
    53d87a4 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    8aac4a4 View commit details
    Browse the repository at this point in the history
  29. Public_key: fix check for x and y size

    the x and y needs to be on curve, so they need to be smaller than the
    curve's prime, not the base point order
    
    See Section 3.2.2.1 of SEC 1 v2
    tomato42 committed Dec 2, 2019
    Configuration menu
    Copy the full SHA
    b8fdfbe View commit details
    Browse the repository at this point in the history
  30. use curve cofactor for point verification

    since multiplying a point by the order is farily expensive, skipping
    it (when safe to do so) greatly increases performance
    
    does not increase the speed.py numbers as point verification happens
    outside the signing and verifying operations
    tomato42 committed Dec 2, 2019
    Configuration menu
    Copy the full SHA
    8ab416b View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    f7910cf View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    4403ec3 View commit details
    Browse the repository at this point in the history
  33. also allow the older gmpy

    since on older distros like CentOS 6 there is python-gmpy but not
    python-gmpy2, support gmpy too
    tomato42 committed Dec 2, 2019
    Configuration menu
    Copy the full SHA
    b1568d4 View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    a67da69 View commit details
    Browse the repository at this point in the history