mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
run lint with pyupgrade at py39-plus
This commit is contained in:
@ -2,9 +2,6 @@ from dataclasses import (
|
||||
dataclass,
|
||||
)
|
||||
import hmac
|
||||
from typing import (
|
||||
Tuple,
|
||||
)
|
||||
|
||||
from Crypto.Cipher import (
|
||||
AES,
|
||||
@ -66,7 +63,7 @@ class MacAndCipher:
|
||||
|
||||
def initialize_pair(
|
||||
cipher_type: str, hash_type: str, secret: bytes
|
||||
) -> Tuple[EncryptionParameters, EncryptionParameters]:
|
||||
) -> tuple[EncryptionParameters, EncryptionParameters]:
|
||||
"""
|
||||
Return a pair of ``Keys`` for use in securing a communications channel
|
||||
with authenticated encryption derived from the ``secret`` and using the
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
from typing import (
|
||||
Callable,
|
||||
Tuple,
|
||||
cast,
|
||||
)
|
||||
|
||||
@ -22,7 +21,7 @@ SharedKeyGenerator = Callable[[bytes], bytes]
|
||||
int_bytelen = util.int_bytelen
|
||||
|
||||
|
||||
def create_ephemeral_key_pair(curve_type: str) -> Tuple[PublicKey, SharedKeyGenerator]:
|
||||
def create_ephemeral_key_pair(curve_type: str) -> tuple[PublicKey, SharedKeyGenerator]:
|
||||
"""Facilitates ECDH key exchange."""
|
||||
if curve_type != "P-256":
|
||||
raise NotImplementedError()
|
||||
|
||||
Reference in New Issue
Block a user