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

Change SHA256 byte counter from size_t to uint64_t #731

Merged
merged 4 commits into from
Mar 24, 2022

Commits on Mar 2, 2022

  1. Change SHA256 byte counter from size_t to uint64_t

    This avoids that the SHA256 implementation would produce wrong paddings
    and thus wrong digests for messages of length >= 2^32 bytes on 32-bit
    platforms.
    
    This is not exploitable in any way since the SHA256 API is an internal
    API and we never call it with that long messages.
    real-or-random committed Mar 2, 2022
    Configuration menu
    Copy the full SHA
    eb28464 View commit details
    Browse the repository at this point in the history
  2. Simplify struct initializer for SHA256 padding

    Since missing elements are initialized with zeros, this change is
    purely syntactical.
    real-or-random committed Mar 2, 2022
    Configuration menu
    Copy the full SHA
    8e3dde1 View commit details
    Browse the repository at this point in the history

Commits on Mar 7, 2022

  1. Add test vector for very long SHA256 messages

    The vector has been taken from https://www.di-mgt.com.au/sha_testvectors.html.
    It can be independently verified using the following Python code.
    
    ```
    h = hashlib.sha256()
    for i in range(1_000_000):
        h.update(b'a')
    print(h.hexdigest())
    ```
    real-or-random committed Mar 7, 2022
    Configuration menu
    Copy the full SHA
    9b514ce View commit details
    Browse the repository at this point in the history

Commits on Mar 23, 2022

  1. Configuration menu
    Copy the full SHA
    f8d9174 View commit details
    Browse the repository at this point in the history