Visitar URL original
Extend the max input length bound for SHA3 by msprotz · Pull Request #817 · hacl-star/hacl-star · GitHub
Skip to content

Extend the max input length bound for SHA3 - #817

Merged
msprotz merged 1 commit into
mainfrom
protz_sha3_fix
May 11, 2023
Merged

msprotz merged 1 commit into
mainfrom
protz_sha3_fix

Conversation

@msprotz

@msprotz msprotz commented May 11, 2023

Copy link
Copy Markdown
Contributor

Owing to a typo, the length of data that could be hashed by the SHA3 streaming API was artificially low. This did not affect soundness, but just meant that the update function would return a non-zero return value to indicate that the maximum input length was exceeded.

The new max input length is 2^64-1, which no client can exceed in reasonable time.

@msprotz
msprotz requested a review from a team as a code owner May 11, 2023 17:27
@github-actions

Copy link
Copy Markdown

[CI] Important!
The code in dist/gcc-compatible, dist/msvc-compatible, and dist/wasm
is tested on cryspen/hacl-packages.
dist is not automatically re-generated, be sure to do it manually.
(A fresh snapshot can also be downloaded from CI.)
Then check the following tests before merging this PR.
Always check the latest run, it corresponds to the most recent version of this branch.
All jobs are expected to be successful.
In some cases manual intervention is needed. Please ping the hacl-packages maintainers.

  • Build, Test, Benchmark: Build on Linux (x86, x64), Windows (x86, x64), MacOS (x64, arm64), s390x, Android (arm64) and test on Linux (x86, x64), Windows (x86, x64), MacOS (x64).
  • Performance Regression Tests: Navigate to the terminal output in “Run benchmarks”. The comparison with the main branch will be at the bottom. The run fails if the performance regresses too much.
  • OCaml bindings: Build & Tests
  • JS bindings: Build & Tests
  • Rust bindings: Build & Tests

@R1kM R1kM left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix!

@msprotz

msprotz commented May 11, 2023

Copy link
Copy Markdown
Contributor Author

Python PR: python/cpython#104401

@msprotz
msprotz enabled auto-merge May 11, 2023 20:59

@karthikbhargavan karthikbhargavan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Can we (in this or subsequent PR) document the error code results of the high-level hash APIs?

@msprotz
msprotz merged commit 3e283ef into main May 11, 2023
@msprotz
msprotz deleted the protz_sha3_fix branch May 11, 2023 21:02
@msprotz

msprotz commented May 11, 2023

Copy link
Copy Markdown
Contributor Author

Thanks, the other streaming APIs are properly documented (https://github.com/hacl-star/hacl-star/blob/main/dist/gcc-compatible/Hacl_Streaming_SHA2.h#L139-L151) but because SHA3 was just recently added (for the Python3 work), we haven't had the time to add suitable comments. Is this something you can help with? It's merely a matter of copy-pasting the existing documentation in the files sitting in the same directory and adapting it to sha3.

@karthikbhargavan

Copy link
Copy Markdown
Contributor

Yes, I will add these comments in the next PR.

Comment thread code/streaming/Hacl.Streaming.Keccak.fst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants