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

Limit SharedSecret to 32 byte buffer #402

Merged
merged 3 commits into from Feb 24, 2022

Commits on Feb 18, 2022

  1. Separate new_with_hash into public function

    In preparation for simplifying the `SharedSecret` internals pull the
    `new_with_hash` function logic out into a standalone public function
    that provides similar functionality without use of the `SharedSecret`
    struct. Function now returns the 64 bytes of data representing a shared
    point on the curve, callers are expected to the hash these bytes to get
    a shared secret.
    tcharding committed Feb 18, 2022
    Copy the full SHA
    834f63c View commit details
    Browse the repository at this point in the history

Commits on Feb 21, 2022

  1. Use more intuitive local var numbering

    In test code we use multiple pub/sec keys. It is more intuitive if the
    'secret 1' is generated by the owner of secret key 1.
    
    Refactor only, no logic changes.
    tcharding committed Feb 21, 2022
    Copy the full SHA
    d5eeb09 View commit details
    Browse the repository at this point in the history
  2. Limit SharedSecret to 32 byte buffer

    The `SharedSecret` uses sha256 to hash the secret, this implies the
    secret is 32 bytes of data.
    
    Currently we use a buffer of 256 bytes, this is unnecessary.
    
    Change the implementation of `SharedSecret` to use a 32 byte buffer.
    tcharding committed Feb 21, 2022
    Copy the full SHA
    5603d71 View commit details
    Browse the repository at this point in the history