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

descriptor: Register sha512 #589

Closed
wants to merge 1 commit into from

Conversation

wking
Copy link
Contributor

@wking wking commented Mar 2, 2017

Besides the mailing list thread referenced in the diff, this algorithm identifier is supported in go-digest.

@stevvooe
Copy link
Contributor

stevvooe commented Mar 6, 2017

I don't see any reason to call this out as a supportable digest. This will only create divergence in implementations that will try to differentiate themselves through hash selection. For the most part, sha256 is fast enough and unique enough to be sufficient for this use case.

Making this decision based on performance isn't even sound. Not all of the tests take into all variations. For example, even though sha512 should be more performant on 64-bit, here are the results on my laptop:

BenchmarkHash8Bytes-4   	 5000000	       302 ns/op	  26.46 MB/s
BenchmarkHash1K-4       	  500000	      3514 ns/op	 291.37 MB/s
BenchmarkHash8K-4       	   50000	     25935 ns/op	 315.86 MB/s
PASS
ok  	crypto/sha256	5.200s
BenchmarkHash8Bytes-4   	 3000000	       582 ns/op	  13.72 MB/s
BenchmarkHash1K-4       	  300000	      4297 ns/op	 238.29 MB/s
BenchmarkHash8K-4       	   50000	     29743 ns/op	 275.42 MB/s
PASS
ok  	crypto/sha512	5.460s

Giving a choice here really will only generate arguments and not compatible images.

Migrating a digest algorithm should be a once in a decade event. Let's do this when sha256 is broken and not waste a second of time before that happens.

@wking
Copy link
Contributor Author

wking commented Mar 7, 2017 via email

@stevvooe
Copy link
Contributor

stevvooe commented Mar 7, 2017

@wking Since you refused to address my actual premise and points, I'm going to close this PR.

Thank you for your submission!

@stevvooe stevvooe closed this Mar 7, 2017
@wking
Copy link
Contributor Author

wking commented Mar 7, 2017 via email

Copy link
Contributor

@jonboulle jonboulle left a comment

Choose a reason for hiding this comment

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

+1 overall, I don't understand the contention.

This will only create divergence in implementations that will try to differentiate themselves through hash selection.

if implementations try to differentiate themselves through hash selection, that's entirely their prerogative

For the most part, sha256 is fast enough and unique enough to be sufficient for this use case.

That's fine; we already (and still) stipulate that all implementations should support this. I would even be happier to turn this into a MUST if that would make you more comfortable (or just one of wking's slightly stronger SHOULD variations).

Migrating a digest algorithm should be a once in a decade event. Let's do this when sha256 is broken and not waste a second of time before that happens.

as already said this should not be a flag-day operation.

Frankly I don't see the fuss, since SHA256 and SHA512 are so similar I imagine most libraries people are using in practice support both.

descriptor.md Outdated
@@ -116,6 +116,7 @@ The following algorithm identifiers are defined by this specification:
| identifier | algorithm |
|------------|---------------------|
| `sha256` | [SHA-256](#sha-256) |
| `sha512` | [SHA-256](#sha-512) |
Copy link
Contributor

Choose a reason for hiding this comment

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

SHA-512?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, thanks :). Fixed with 09b5988781425f.

descriptor.md Outdated
@@ -124,6 +125,11 @@ If a useful algorithm is not included in the above table, it SHOULD be submitted
[SHA-256](https://tools.ietf.org/html/rfc4634#page-7) is a collision-resistant hash function, chosen for ubiquity, reasonable size and secure characteristics.
Implementations MUST implement SHA-256 digest verification for use in descriptors.

#### SHA-512

[SHA-512][rfc4634-s4.2] is a collision-resitant hash function which [may be more perfomant][sha256-vs-sha512] than [SHA-256](#sha-256) on some CPUs.
Copy link
Contributor

Choose a reason for hiding this comment

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

resistant

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. Fixed with 09b5988781425f.

@jonboulle jonboulle reopened this Mar 7, 2017
Besides the mailing list thread referenced in the diff, this algorithm
identifier is supported in go-digest [1].

[1]: https://github.com/opencontainers/go-digest/blob/v1.0.0-rc0/algorithm.go#L33

Signed-off-by: W. Trevor King <wking@tremily.us>
@wking
Copy link
Contributor Author

wking commented Mar 7, 2017 via email

@jonboulle
Copy link
Contributor

no, I meant sha256, to mitigate the apparent concern about divergence.

@wking
Copy link
Contributor Author

wking commented Mar 7, 2017

no, I meant sha256...

If you don't read the already-in-master wording as doing that now, you should probably file a separate PR to fix that. The current wording there may have too much space between "SHA-256" and "sha256", but it seems orthogonal to this PR.

@jonboulle
Copy link
Contributor

@wking ahh, I see the source of my confusion - we have a SHOULD here. I guess the current master wording is okay.

@wking
Copy link
Contributor Author

wking commented Mar 7, 2017 via email

@stevvooe
Copy link
Contributor

stevvooe commented Mar 7, 2017

@jonboulle He has been asked a number of times to limit the length and scope of his responses to be on point and constructive. At this time, he has made no concerted effort to do this. His continued verbosity has ended up wasting a lot of time in a number of cases, including my own submissions. On my PR for chain ID clarifications, he made something like 46 comments in 24 hours, on a proposal that has been available for at least a month. Not only that, but after his points were clarified, he continued to argue his position, continuing to ignore premises and arguments of others. As an active maintainer and contributor to this project, his incessant badgering borders on harassment.

Even worse, his continued verbosity led to having @philips step down from pushing releases and the delay of a 1.0 release of this specification. Had so much time not been wasted on arguing minutia, we would probably have released a 1.0 now.

In this case, the immediate closure of this issue was due to the fact that he did not respond to the feedback provided in my review comment. My original concern was this:

This will only create divergence in implementations that will try to differentiate themselves through hash selection.

Instead, he chose to argue about breaking hashes, which was a minor point.

On its own, this PR is probably okay, but in context of the thousands of comments issued by this individual, on a specification which companies are actually betting on, this behavior is unacceptable.

@jonboulle If you think this is a reasonable addition, please submit a PR, where we can discuss the merits and stipulations to make this work in practice without diverging implementations. Until then, this PR will remain closed.

@stevvooe stevvooe closed this Mar 7, 2017
@wking
Copy link
Contributor Author

wking commented Mar 7, 2017

Instead, he chose to argue about breaking hashes, which was a minor point.

I think pushing back against “Let's do this when sha256 is broken and not waste a second of time before that happens.” is a major point, but shrug. Skipping your other points in my initial response was part of an attempt to decrease verbosity, and then you asked me to address those too, so I did. And you don't seem to have found the very brief initial post particularly convincing either.

… the immediate closure of this issue was due to the fact that he did not respond to the feedback provided in my review comment…

I think the deduplication and portability issues (which I did address in my initial response) are the main issues with “divergence”. I'm fine mentioning those issues in the spec (as I said earlier), but I'm pretty sure not registering sha512 is the wrong way to go about addressing them.

@stevvooe
Copy link
Contributor

stevvooe commented Mar 7, 2017

@wking I acknowledge those points. If another contributor would like to take on this task, then they are welcome to address these issues.

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