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

Switch Kythe Kzip creator from absl::Hash to SHA256 #1997

Merged
merged 8 commits into from
Aug 23, 2023

Conversation

ivan444
Copy link
Collaborator

@ivan444 ivan444 commented Aug 11, 2023

Switch Kythe Kzip creator from absl::Hash to new SHA256 implementation as some Kythe tools assume SHA256 in the Kzips. The SHA256 implementation is based on https://www.rfc-editor.org/rfc/rfc6234.txt -- extracted only the SHA256 part, cleaned up the code and made it closer to C++ than C.

@ivan444 ivan444 requested a review from hzeller August 11, 2023 12:06
@codecov-commenter
Copy link

Codecov Report

Patch coverage: 92.12% and project coverage change: -0.01% ⚠️

Comparison is base (0b8cb4e) 92.85% compared to head (f32b76a) 92.85%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1997      +/-   ##
==========================================
- Coverage   92.85%   92.85%   -0.01%     
==========================================
  Files         355      357       +2     
  Lines       26272    26399     +127     
==========================================
+ Hits        24395    24512     +117     
- Misses       1877     1887      +10     
Files Changed Coverage Δ
common/util/sha256.cc 92.00% <92.00%> (ø)
common/util/sha256.h 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@hzeller hzeller left a comment

Choose a reason for hiding this comment

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

Very nice, a c++-ified sha256 is very useful.
Some minor comments to address and a license attribution question that we can probably defer.

hdrs = ["sha256.h"],
deps = [
"@com_google_absl//absl/strings",
],
Copy link
Collaborator

Choose a reason for hiding this comment

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

The code looks like some sort of MIT license. Do we need to annotate this library with some different applicable license here in the cc_library ? (the default_applicable_license on the package-level points to apache)

(but I am also fine with deferring this decision a little bit until we talked to the licensing experts and fix it then)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I wasn't sure what to do here. Forwarding the original license seemed like a reasonable thing to do.
I can check with the licensing experts.

common/util/sha256.h Outdated Show resolved Hide resolved
common/util/sha256.h Outdated Show resolved Hide resolved
common/util/sha256_test.cc Outdated Show resolved Hide resolved
Copy link
Collaborator

@hzeller hzeller left a comment

Choose a reason for hiding this comment

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

LGTM

@hzeller hzeller merged commit 398a850 into chipsalliance:master Aug 23, 2023
34 checks passed
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.

3 participants