Skip to content

Commit

Permalink
Merge branch 'protz_sha3' of pro.github.com:msprotz/cpython into prot…
Browse files Browse the repository at this point in the history
…z_sha3
  • Loading branch information
msprotz committed May 6, 2023
2 parents 4b58915 + 48cf363 commit 43f4ba7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Modules/sha3module.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,11 @@ _SHAKE_digest(SHA3object *self, unsigned long digestlen, int hex)
* - the algorith is not shake -- not the case here
* - the output length is zero -- we follow the existing behavior and return
* an empty digest, without raising an error */
if (digestlen > 0)
Hacl_Streaming_Keccak_squeeze(self->hash_state, digest, digestlen);
if (digestlen > 0) {
Hacl_Streaming_Keccak_squeeze(self->hash_state, digest, digestlen);
}
if (hex) {
result = _Py_strhex((const char *)digest, digestlen);
result = _Py_strhex((const char *)digest, digestlen);
} else {
result = PyBytes_FromStringAndSize((const char *)digest,
digestlen);
Expand Down

0 comments on commit 43f4ba7

Please sign in to comment.