aboutsummaryrefslogtreecommitdiff
path: root/frozen_deps/Cryptodome/Cipher/ChaCha20.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/Cipher/ChaCha20.py
parentbe4dc086591c9bced04a507d127c83811c5700c4 (diff)
v0.1.7
Diffstat (limited to 'frozen_deps/Cryptodome/Cipher/ChaCha20.py')
-rw-r--r--frozen_deps/Cryptodome/Cipher/ChaCha20.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/frozen_deps/Cryptodome/Cipher/ChaCha20.py b/frozen_deps/Cryptodome/Cipher/ChaCha20.py
index 0cd9102..b4f8b5f 100644
--- a/frozen_deps/Cryptodome/Cipher/ChaCha20.py
+++ b/frozen_deps/Cryptodome/Cipher/ChaCha20.py
@@ -94,6 +94,8 @@ class ChaCha20Cipher(object):
See also `new()` at the module level."""
+ self.nonce = _copy_bytes(None, None, nonce)
+
# XChaCha20 requires a key derivation with HChaCha20
# See 2.3 in https://tools.ietf.org/html/draft-arciszewski-xchacha-03
if len(nonce) == 24:
@@ -102,8 +104,7 @@ class ChaCha20Cipher(object):
self._name = "XChaCha20"
else:
self._name = "ChaCha20"
-
- self.nonce = _copy_bytes(None, None, nonce)
+ nonce = self.nonce
self._next = ( self.encrypt, self.decrypt )
@@ -112,7 +113,7 @@ class ChaCha20Cipher(object):
self._state.address_of(),
c_uint8_ptr(key),
c_size_t(len(key)),
- self.nonce,
+ nonce,
c_size_t(len(nonce)))
if result:
raise ValueError("Error %d instantiating a %s cipher" % (result,