crypto: add some notes re considerations
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user