Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

aroundthecode / pycryptodome   python

Repository URL to install this package:

Version: 3.7.2 

/ Cipher / ChaCha20.pyi

from typing import Union, overload

Buffer = Union[bytes, bytearray, memoryview]

class ChaCha20Cipher:
    block_size: int
    nonce: bytes

    def __init__(self, key: Buffer, nonce: Buffer) -> None: ...
    @overload
    def encrypt(self, plaintext: Buffer) -> bytes: ...
    @overload
    def encrypt(self, plaintext: Buffer, output: Union[bytearray, memoryview]) -> None: ...
    @overload
    def decrypt(self, plaintext: Buffer) -> bytes: ...
    @overload
    def decrypt(self, plaintext: Buffer, output: Union[bytearray, memoryview]) -> None: ...
    def seek(self, position: int) -> None: ...

def new(__key: Buffer, nonce: Buffer = ...) -> ChaCha20Cipher: ...

block_size: int
key_size: int