aboutsummaryrefslogtreecommitdiff
path: root/frozen_deps/Cryptodome/Cipher/ChaCha20.pyi
blob: 3d00a1d4806ecd9b8fc884d40650b74952ca8a99 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from typing import Union, overload

Buffer = Union[bytes, bytearray, memoryview]

def _HChaCha20(key: Buffer, nonce: Buffer) -> bytearray: ...

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