aboutsummaryrefslogtreecommitdiff
path: root/frozen_deps/Cryptodome/Hash/SHAKE256.py
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2022-11-17 18:08:59 -0800
committerDeterminant <[email protected]>2022-11-17 18:08:59 -0800
commit8154806fe2fccacdc3dafaa68181a07bcf8d6c4c (patch)
treef477e6a005599bb88c18db142c267b9297c6060b /frozen_deps/Cryptodome/Hash/SHAKE256.py
parentbe4dc086591c9bced04a507d127c83811c5700c4 (diff)
v0.1.7
Diffstat (limited to 'frozen_deps/Cryptodome/Hash/SHAKE256.py')
-rw-r--r--frozen_deps/Cryptodome/Hash/SHAKE256.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/frozen_deps/Cryptodome/Hash/SHAKE256.py b/frozen_deps/Cryptodome/Hash/SHAKE256.py
index 46040e1..8c37f6a 100644
--- a/frozen_deps/Cryptodome/Hash/SHAKE256.py
+++ b/frozen_deps/Cryptodome/Hash/SHAKE256.py
@@ -34,7 +34,7 @@ from Cryptodome.Util._raw_api import (load_pycryptodome_raw_lib,
VoidPointer, SmartPointer,
create_string_buffer,
get_raw_buffer, c_size_t,
- c_uint8_ptr)
+ c_uint8_ptr, c_ubyte)
from Cryptodome.Hash.keccak import _raw_keccak_lib
@@ -54,13 +54,15 @@ class SHAKE256_XOF(object):
state = VoidPointer()
result = _raw_keccak_lib.keccak_init(state.address_of(),
c_size_t(64),
- 0x1F)
+ c_ubyte(24))
if result:
raise ValueError("Error %d while instantiating SHAKE256"
% result)
self._state = SmartPointer(state.get(),
_raw_keccak_lib.keccak_destroy)
self._is_squeezing = False
+ self._padding = 0x1F
+
if data:
self.update(data)
@@ -101,7 +103,8 @@ class SHAKE256_XOF(object):
bfr = create_string_buffer(length)
result = _raw_keccak_lib.keccak_squeeze(self._state.get(),
bfr,
- c_size_t(length))
+ c_size_t(length),
+ c_ubyte(self._padding))
if result:
raise ValueError("Error %d while extracting from SHAKE256"
% result)