Repository navigation
shake128/256 support - #4611
Merged
Merged
shake128/256 support#4611
Conversation
alex
reviewed
Nov 29, 2018
Member
|
Also: changelog |
Member
|
Do we need a new hash context, or do we need a new hash interface?
…On Thu, Nov 29, 2018 at 12:01 AM Paul Kehrer ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/cryptography/hazmat/backends/openssl/hashes.py
<#4611 (comment)>:
> @@ -51,10 +51,24 @@ def update(self, data):
self._backend.openssl_assert(res != 0)
def finalize(self):
- buf = self._backend._ffi.new("unsigned char[]",
- self._backend._lib.EVP_MAX_MD_SIZE)
- outlen = self._backend._ffi.new("unsigned int *")
- res = self._backend._lib.EVP_DigestFinal_ex(self._ctx, buf, outlen)
- self._backend.openssl_assert(res != 0)
- self._backend.openssl_assert(outlen[0] == self.algorithm.digest_size)
- return self._backend._ffi.buffer(buf)[:outlen[0]]
+ if isinstance(self.algorithm, (hashes.SHAKE128, hashes.SHAKE256)):
Suggestions welcome. We could hoist this check up to the hash context
creation, but then we need to make an XOFHashContext (not a public
interface).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4611 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAADBKZvBZm2guFP33x8KAAYGU3XSCL7ks5uz2ongaJpZM4Yxr5b>
.
--
All that is necessary for evil to succeed is for good people to do nothing.
|
8 tasks done
reaperhulk
force-pushed
the
shake
branch
2 times, most recently
from
December 12, 2018 04:08
7c6b1e1 to
0194466
Compare
alex
requested changes
Jan 18, 2019
alex
approved these changes
Jan 19, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
refs #4197
We should discuss if this is the API we actually want. It is consistent with our current APIs (you must pick the length you want rather than just repeatedly calling a function to get more output), but it's not clear to me if that's a reasonable way to expect people to consume it.