ChaCha20.pyi 788 B

1234567891011121314151617181920212223
  1. from typing import Union, overload, ByteString, Optional
  2. def _HChaCha20(key: ByteString, nonce: ByteString) -> bytearray: ...
  3. class ChaCha20Cipher:
  4. block_size: int
  5. nonce: bytes
  6. def __init__(self, key: ByteString, nonce: ByteString) -> None: ...
  7. @overload
  8. def encrypt(self, plaintext: ByteString) -> bytes: ...
  9. @overload
  10. def encrypt(self, plaintext: ByteString, output: Union[bytearray, memoryview]) -> None: ...
  11. @overload
  12. def decrypt(self, plaintext: ByteString) -> bytes: ...
  13. @overload
  14. def decrypt(self, plaintext: ByteString, output: Union[bytearray, memoryview]) -> None: ...
  15. def seek(self, position: int) -> None: ...
  16. def new(key: ByteString, nonce: Optional[ByteString] = ...) -> ChaCha20Cipher: ...
  17. block_size: int
  18. key_size: int