forked from Legrandin/pycryptodome
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
typing.ByteString's behaviour was poorly specified. It is currently scheduled for removal in Python 3.14. See also python/cpython#91896
- Loading branch information
1 parent
bef03fc
commit 1ce9781
Showing
11 changed files
with
98 additions
and
99 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,14 +1,14 @@ | ||
from typing import Any, Union, Iterable, ByteString | ||
from typing import Any, Iterable | ||
|
||
class ARC4Cipher: | ||
block_size: int | ||
key_size: int | ||
|
||
def __init__(self, key: ByteString, *args: Any, **kwargs: Any) -> None: ... | ||
def encrypt(self, plaintext: ByteString) -> bytes: ... | ||
def decrypt(self, ciphertext: ByteString) -> bytes: ... | ||
def __init__(self, key: bytes | bytearray, *args: Any, **kwargs: Any) -> None: ... | ||
def encrypt(self, plaintext: bytes | bytearray) -> bytes: ... | ||
def decrypt(self, ciphertext: bytes | bytearray) -> bytes: ... | ||
|
||
def new(key: ByteString, drop : int = ...) -> ARC4Cipher: ... | ||
def new(key: bytes | bytearray, 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,23 +1,23 @@ | ||
from typing import Union, overload, ByteString, Optional | ||
from typing import Union, overload | ||
|
||
def _HChaCha20(key: ByteString, nonce: ByteString) -> bytearray: ... | ||
def _HChaCha20(key: bytes | bytearray, nonce: bytes | bytearray) -> bytearray: ... | ||
|
||
class ChaCha20Cipher: | ||
block_size: int | ||
nonce: bytes | ||
|
||
def __init__(self, key: ByteString, nonce: ByteString) -> None: ... | ||
def __init__(self, key: bytes | bytearray, nonce: bytes | bytearray) -> None: ... | ||
@overload | ||
def encrypt(self, plaintext: ByteString) -> bytes: ... | ||
def encrypt(self, plaintext: bytes | bytearray) -> bytes: ... | ||
@overload | ||
def encrypt(self, plaintext: ByteString, output: Union[bytearray, memoryview]) -> None: ... | ||
def encrypt(self, plaintext: bytes | bytearray, output: Union[bytearray, memoryview]) -> None: ... | ||
@overload | ||
def decrypt(self, plaintext: ByteString) -> bytes: ... | ||
def decrypt(self, plaintext: bytes | bytearray) -> bytes: ... | ||
@overload | ||
def decrypt(self, plaintext: ByteString, output: Union[bytearray, memoryview]) -> None: ... | ||
def decrypt(self, plaintext: bytes | bytearray, output: Union[bytearray, memoryview]) -> None: ... | ||
def seek(self, position: int) -> None: ... | ||
|
||
def new(key: ByteString, nonce: Optional[ByteString] = ...) -> ChaCha20Cipher: ... | ||
def new(key: bytes | bytearray, nonce: bytes | bytearray | None = ...) -> 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,26 +1,26 @@ | ||
from typing import Union, Tuple, overload, ByteString, Optional | ||
from typing import Union, Tuple, overload | ||
|
||
class ChaCha20Poly1305Cipher: | ||
nonce: bytes | ||
|
||
def __init__(self, key: ByteString, nonce: ByteString) -> None: ... | ||
def update(self, data: ByteString) -> None: ... | ||
def __init__(self, key: bytes | bytearray, nonce: bytes | bytearray) -> None: ... | ||
def update(self, data: bytes | bytearray) -> None: ... | ||
@overload | ||
def encrypt(self, plaintext: ByteString) -> bytes: ... | ||
def encrypt(self, plaintext: bytes | bytearray) -> bytes: ... | ||
@overload | ||
def encrypt(self, plaintext: ByteString, output: Union[bytearray, memoryview]) -> None: ... | ||
def encrypt(self, plaintext: bytes | bytearray, output: Union[bytearray, memoryview]) -> None: ... | ||
@overload | ||
def decrypt(self, plaintext: ByteString) -> bytes: ... | ||
def decrypt(self, plaintext: bytes | bytearray) -> bytes: ... | ||
@overload | ||
def decrypt(self, plaintext: ByteString, output: Union[bytearray, memoryview]) -> None: ... | ||
def decrypt(self, plaintext: bytes | bytearray, output: Union[bytearray, memoryview]) -> None: ... | ||
def digest(self) -> bytes: ... | ||
def hexdigest(self) -> str: ... | ||
def verify(self, received_mac_tag: ByteString) -> None: ... | ||
def verify(self, received_mac_tag: bytes | bytearray) -> None: ... | ||
def hexverify(self, received_mac_tag: str) -> None: ... | ||
def encrypt_and_digest(self, plaintext: ByteString) -> Tuple[bytes, bytes]: ... | ||
def decrypt_and_verify(self, ciphertext: ByteString, received_mac_tag: ByteString) -> bytes: ... | ||
def encrypt_and_digest(self, plaintext: bytes | bytearray) -> Tuple[bytes, bytes]: ... | ||
def decrypt_and_verify(self, ciphertext: bytes | bytearray, received_mac_tag: bytes | bytearray) -> bytes: ... | ||
|
||
def new(key: ByteString, nonce: Optional[ByteString] = ...) -> ChaCha20Poly1305Cipher: ... | ||
def new(key: bytes | bytearray, nonce: bytes | bytearray | None = ...) -> 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
Oops, something went wrong.