1
0

crypto: add some notes re considerations

This commit is contained in:
SomberNight
2024-05-22 13:39:27 +00:00
parent 0b456e99ca
commit 235e28ce20
3 changed files with 11 additions and 1 deletions

View File

@@ -410,6 +410,9 @@ def chacha20_poly1305_decrypt(
def chacha20_encrypt(*, key: bytes, nonce: bytes, data: bytes) -> bytes:
"""note: for any new protocol you design, please consider using chacha20_poly1305_encrypt instead
(for its Authenticated Encryption property).
"""
assert isinstance(key, (bytes, bytearray))
assert isinstance(nonce, (bytes, bytearray))
assert isinstance(data, (bytes, bytearray))