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

Add constant-time point multplication for ECDH #252

Merged
merged 7 commits into from
Aug 2, 2015

Commits on Jul 29, 2015

  1. tests: add a couple tests

      - Add zero/one sanity check tests for ecmult
    
      - Add unit test for secp256k1_scalar_split_lambda_var
    
      - Typo fix in `ge_equals_ge`; was comparing b->y to itself, should
        have been comparing a->y to b->y
    
      - Normalize y-coordinate in `random_group_element_test`; this is
        needed to pass random group elements as the first argument to
        `ge_equals_ge`, which I will do in a future commit.
    apoelstra committed Jul 29, 2015
    Configuration menu
    Copy the full SHA
    baa75da View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2015

  1. Add constant-time multiply secp256k1_ecmult_const for ECDH

    Designed with clear separation of the wNAF conversion, precomputation
    and exponentiation (since the precomp at least we will probably want
    to separate in the API for users who reuse points a lot.
    
    Future work:
      - actually separate precomp in the API
      - do multiexp rather than single exponentiation
    apoelstra committed Jul 31, 2015
    Configuration menu
    Copy the full SHA
    4401500 View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2015

  1. Configuration menu
    Copy the full SHA
    0739bbb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    91c0ce9 View commit details
    Browse the repository at this point in the history
  3. Make secp256k1_scalar_add_bit conditional; make `secp256k1_scalar_s…

    …plit_lambda_var` constant time
    
    This has the effect of making `secp256k1_scalar_mul_shift_var` constant
    time in both input scalars. Keep the _var name because it is NOT constant
    time in the shift amount.
    
    As used in `secp256k1_scalar_split_lambda_var`, the shift is always
    the constant 272, so this function becomes constant time, and it
    loses the `_var` suffix.
    apoelstra committed Aug 1, 2015
    Configuration menu
    Copy the full SHA
    ed35d43 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    92e53fc View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    72ae443 View commit details
    Browse the repository at this point in the history