Salsa20.pyi 751 B

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