-
Notifications
You must be signed in to change notification settings - Fork 510
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
76 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
from typing import Any, Union, Iterable | ||
|
||
Buffer = Union[bytes, bytearray, memoryview] | ||
from typing import Any, Union, Iterable, ByteString | ||
|
||
class ARC4Cipher: | ||
block_size: int | ||
key_size: int | ||
|
||
def __init__(self, key: Buffer, *args: Any, **kwargs: Any) -> None: ... | ||
def encrypt(self, plaintext: Buffer) -> bytes: ... | ||
def decrypt(self, ciphertext: Buffer) -> bytes: ... | ||
def __init__(self, key: ByteString, *args: Any, **kwargs: Any) -> None: ... | ||
def encrypt(self, plaintext: ByteString) -> bytes: ... | ||
def decrypt(self, ciphertext: ByteString) -> bytes: ... | ||
|
||
def new(key: Buffer, drop : int = ...) -> ARC4Cipher: ... | ||
def new(key: ByteString, drop : int = ...) -> ARC4Cipher: ... | ||
|
||
block_size: int | ||
key_size: Iterable[int] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,23 @@ | ||
from typing import Union, overload | ||
from typing import Union, overload, ByteString, Optional | ||
|
||
Buffer = Union[bytes, bytearray, memoryview] | ||
|
||
def _HChaCha20(key: Buffer, nonce: Buffer) -> bytearray: ... | ||
def _HChaCha20(key: ByteString, nonce: ByteString) -> bytearray: ... | ||
|
||
class ChaCha20Cipher: | ||
block_size: int | ||
nonce: bytes | ||
|
||
def __init__(self, key: Buffer, nonce: Buffer) -> None: ... | ||
def __init__(self, key: ByteString, nonce: ByteString) -> None: ... | ||
@overload | ||
def encrypt(self, plaintext: Buffer) -> bytes: ... | ||
def encrypt(self, plaintext: ByteString) -> bytes: ... | ||
@overload | ||
def encrypt(self, plaintext: Buffer, output: Union[bytearray, memoryview]) -> None: ... | ||
def encrypt(self, plaintext: ByteString, output: Union[bytearray, memoryview]) -> None: ... | ||
@overload | ||
def decrypt(self, plaintext: Buffer) -> bytes: ... | ||
def decrypt(self, plaintext: ByteString) -> bytes: ... | ||
@overload | ||
def decrypt(self, plaintext: Buffer, output: Union[bytearray, memoryview]) -> None: ... | ||
def decrypt(self, plaintext: ByteString, output: Union[bytearray, memoryview]) -> None: ... | ||
def seek(self, position: int) -> None: ... | ||
|
||
def new(key: Buffer, nonce: Buffer = ...) -> ChaCha20Cipher: ... | ||
def new(key: ByteString, nonce: Optional[ByteString] = ...) -> ChaCha20Cipher: ... | ||
|
||
block_size: int | ||
key_size: int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,26 @@ | ||
from typing import Union, Tuple, overload | ||
|
||
Buffer = Union[bytes, bytearray, memoryview] | ||
from typing import Union, Tuple, overload, ByteString, Optional | ||
|
||
class ChaCha20Poly1305Cipher: | ||
nonce: bytes | ||
|
||
def __init__(self, key: Buffer, nonce: Buffer) -> None: ... | ||
def update(self, data: Buffer) -> None: ... | ||
def __init__(self, key: ByteString, nonce: ByteString) -> None: ... | ||
def update(self, data: ByteString) -> None: ... | ||
@overload | ||
def encrypt(self, plaintext: Buffer) -> bytes: ... | ||
def encrypt(self, plaintext: ByteString) -> bytes: ... | ||
@overload | ||
def encrypt(self, plaintext: Buffer, output: Union[bytearray, memoryview]) -> None: ... | ||
def encrypt(self, plaintext: ByteString, output: Union[bytearray, memoryview]) -> None: ... | ||
@overload | ||
def decrypt(self, plaintext: Buffer) -> bytes: ... | ||
def decrypt(self, plaintext: ByteString) -> bytes: ... | ||
@overload | ||
def decrypt(self, plaintext: Buffer, output: Union[bytearray, memoryview]) -> None: ... | ||
def decrypt(self, plaintext: ByteString, output: Union[bytearray, memoryview]) -> None: ... | ||
def digest(self) -> bytes: ... | ||
def hexdigest(self) -> str: ... | ||
def verify(self, received_mac_tag: Buffer) -> None: ... | ||
def verify(self, received_mac_tag: ByteString) -> None: ... | ||
def hexverify(self, received_mac_tag: str) -> None: ... | ||
def encrypt_and_digest(self, plaintext: Buffer) -> Tuple[bytes, bytes]: ... | ||
def decrypt_and_verify(self, ciphertext: Buffer, received_mac_tag: Buffer) -> bytes: ... | ||
def encrypt_and_digest(self, plaintext: ByteString) -> Tuple[bytes, bytes]: ... | ||
def decrypt_and_verify(self, ciphertext: ByteString, received_mac_tag: ByteString) -> bytes: ... | ||
|
||
def new(key: Buffer, nonce: Buffer = ...) -> ChaCha20Poly1305Cipher: ... | ||
def new(key: ByteString, nonce: Optional[ByteString] = ...) -> ChaCha20Poly1305Cipher: ... | ||
|
||
block_size: int | ||
key_size: int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters