hyb
2026-01-09 4cb426cb3ae31e772a09d4ade5b2f0242aaeefa0
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, Tuple, Optional, overload, Optional
 
Buffer = bytes|bytearray|memoryview
 
class Salsa20Cipher:
    nonce: bytes
    block_size: int
    key_size: int
 
    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 new(key: Buffer, nonce: Optional[Buffer] = ...) -> Salsa20Cipher: ...
 
block_size: int
key_size: Tuple[int, int]