From: Sergey Matveev Date: Mon, 19 Oct 2020 10:07:15 +0000 (+0300) Subject: PEP8 typing stubs X-Git-Tag: 5.2~5 X-Git-Url: http://www.git.cypherpunks.ru/?p=pygost.git;a=commitdiff_plain;h=61d68bda6f6d7c39243701b5f647f62cc4d9d286 PEP8 typing stubs --- diff --git a/pygost/stubs/pygost/gost28147.pyi b/pygost/stubs/pygost/gost28147.pyi index 0c513e0..be31261 100644 --- a/pygost/stubs/pygost/gost28147.pyi +++ b/pygost/stubs/pygost/gost28147.pyi @@ -38,64 +38,64 @@ def ecb( key: bytes, data: bytes, action: Callable[[str, bytes, Words], Words], - sbox: str=..., + sbox: str = ..., ) -> bytes: ... def ecb_encrypt( key: bytes, data: bytes, - sbox: str=..., + sbox: str = ..., ) -> bytes: ... def ecb_decrypt( key: bytes, data: bytes, - sbox: str=..., + sbox: str = ..., ) -> bytes: ... def cbc_encrypt( key: bytes, data: bytes, - iv: bytes=..., - pad: bool=..., - sbox: str=..., - mesh: bool=..., + iv: bytes = ..., + pad: bool = ..., + sbox: str = ..., + mesh: bool = ..., ) -> bytes: ... def cbc_decrypt( key: bytes, data: bytes, - pad: bool=..., - sbox: str=..., - mesh: bool=..., + pad: bool = ..., + sbox: str = ..., + mesh: bool = ..., ) -> bytes: ... def cnt( key: bytes, data: bytes, - iv: bytes=..., - sbox: str=..., + iv: bytes = ..., + sbox: str = ..., ) -> bytes: ... def cfb_encrypt( key: bytes, data: bytes, - iv: bytes=..., - sbox: str=..., - mesh: bool=..., + iv: bytes = ..., + sbox: str = ..., + mesh: bool = ..., ) -> bytes: ... def cfb_decrypt( key: bytes, data: bytes, - iv: bytes=..., - sbox: str=..., - mesh: bool=..., + iv: bytes = ..., + sbox: str = ..., + mesh: bool = ..., ) -> bytes: ... diff --git a/pygost/stubs/pygost/gost28147_mac.pyi b/pygost/stubs/pygost/gost28147_mac.pyi index 4386f37..70d90d6 100644 --- a/pygost/stubs/pygost/gost28147_mac.pyi +++ b/pygost/stubs/pygost/gost28147_mac.pyi @@ -5,9 +5,9 @@ class MAC(PEP247): def __init__( self, key: bytes, - data: bytes=..., - iv: bytes=..., - sbox: str=..., + data: bytes = ..., + iv: bytes = ..., + sbox: str = ..., ) -> None: ... @property @@ -22,4 +22,4 @@ class MAC(PEP247): def hexdigest(self) -> str: ... -def new(key: bytes, data: bytes=..., iv: bytes=..., sbox: str=...) -> MAC: ... +def new(key: bytes, data: bytes = ..., iv: bytes = ..., sbox: str = ...) -> MAC: ... diff --git a/pygost/stubs/pygost/gost3410.pyi b/pygost/stubs/pygost/gost3410.pyi index ee0e9b6..4be9bbb 100644 --- a/pygost/stubs/pygost/gost3410.pyi +++ b/pygost/stubs/pygost/gost3410.pyi @@ -33,7 +33,7 @@ class GOST3410Curve(object): def pos(self, v: int) -> int: ... - def exp(self, degree: int, x: int=..., y: int=...) -> int: ... + def exp(self, degree: int, x: int = ..., y: int = ...) -> int: ... def st(self) -> Tuple[int, int]: ... @@ -46,7 +46,7 @@ class GOST3410Curve(object): def public_key(curve: GOST3410Curve, prv: int) -> PublicKey: ... -def sign(curve: GOST3410Curve, prv: int, digest: bytes, rand: bytes=None) -> bytes: ... +def sign(curve: GOST3410Curve, prv: int, digest: bytes, rand: bytes = None) -> bytes: ... def verify(curve: GOST3410Curve, pub: PublicKey, digest: bytes, signature: bytes) -> bool: ... diff --git a/pygost/stubs/pygost/gost3410_vko.pyi b/pygost/stubs/pygost/gost3410_vko.pyi index c6d35e5..bb9c54b 100644 --- a/pygost/stubs/pygost/gost3410_vko.pyi +++ b/pygost/stubs/pygost/gost3410_vko.pyi @@ -8,7 +8,7 @@ def ukm_unmarshal(ukm: bytes) -> int: ... def kek_34102001(curve: GOST3410Curve, prv: int, pub: PublicKey, ukm: int) -> bytes: ... -def kek_34102012256(curve: GOST3410Curve, prv: int, pub: PublicKey, ukm: int=...) -> bytes: ... +def kek_34102012256(curve: GOST3410Curve, prv: int, pub: PublicKey, ukm: int = ...) -> bytes: ... -def kek_34102012512(curve: GOST3410Curve, prv: int, pub: PublicKey, ukm: int=...) -> bytes: ... +def kek_34102012512(curve: GOST3410Curve, prv: int, pub: PublicKey, ukm: int = ...) -> bytes: ... diff --git a/pygost/stubs/pygost/gost34112012.pyi b/pygost/stubs/pygost/gost34112012.pyi index dd0cc4c..3d5cc41 100644 --- a/pygost/stubs/pygost/gost34112012.pyi +++ b/pygost/stubs/pygost/gost34112012.pyi @@ -4,7 +4,7 @@ from pygost.iface import PEP247 class GOST34112012(PEP247): block_size = ... # type: int - def __init__(self, data: bytes=..., digest_size: int=...) -> None: ... + def __init__(self, data: bytes = ..., digest_size: int = ...) -> None: ... @property def digest_size(self) -> int: ... diff --git a/pygost/stubs/pygost/gost34112012256.pyi b/pygost/stubs/pygost/gost34112012256.pyi index 1bae785..a1d2a01 100644 --- a/pygost/stubs/pygost/gost34112012256.pyi +++ b/pygost/stubs/pygost/gost34112012256.pyi @@ -4,7 +4,7 @@ from pygost.iface import PEP247 class GOST34112012256(PEP247): block_size = ... # type: int - def __init__(self, data: bytes=...) -> None: ... + def __init__(self, data: bytes = ...) -> None: ... @property def digest_size(self) -> int: ... @@ -18,4 +18,4 @@ class GOST34112012256(PEP247): def hexdigest(self) -> str: ... -def new(data: bytes=...) -> GOST34112012256: ... +def new(data: bytes = ...) -> GOST34112012256: ... diff --git a/pygost/stubs/pygost/gost34112012512.pyi b/pygost/stubs/pygost/gost34112012512.pyi index 0a3d7b3..349bddd 100644 --- a/pygost/stubs/pygost/gost34112012512.pyi +++ b/pygost/stubs/pygost/gost34112012512.pyi @@ -4,7 +4,7 @@ from pygost.iface import PEP247 class GOST34112012512(PEP247): block_size = ... # type: int - def __init__(self, data: bytes=...) -> None: ... + def __init__(self, data: bytes = ...) -> None: ... @property def digest_size(self) -> int: ... @@ -18,6 +18,7 @@ class GOST34112012512(PEP247): def hexdigest(self) -> str: ... -def new(data: bytes=...) -> GOST34112012512: ... +def new(data: bytes = ...) -> GOST34112012512: ... + def pbkdf2(password: bytes, salt: bytes, iterations: int, dklen: int) -> bytes: ... diff --git a/pygost/stubs/pygost/gost341194.pyi b/pygost/stubs/pygost/gost341194.pyi index 87492c8..24de2e4 100644 --- a/pygost/stubs/pygost/gost341194.pyi +++ b/pygost/stubs/pygost/gost341194.pyi @@ -5,7 +5,7 @@ class GOST341194(PEP247): sbox = ... # type: str block_size = ... # type: int - def __init__(self, data: bytes=..., sbox: str=...) -> None: ... + def __init__(self, data: bytes = ..., sbox: str = ...) -> None: ... @property def digest_size(self) -> int: ... @@ -19,7 +19,7 @@ class GOST341194(PEP247): def hexdigest(self) -> str: ... -def new(data: bytes=..., sbox: str=...) -> GOST341194: ... +def new(data: bytes = ..., sbox: str = ...) -> GOST341194: ... def pbkdf2(password: bytes, salt: bytes, iterations: int, dklen: int) -> bytes: ... diff --git a/pygost/stubs/pygost/kdf.pyi b/pygost/stubs/pygost/kdf.pyi index 932d6ef..ac5cf2a 100644 --- a/pygost/stubs/pygost/kdf.pyi +++ b/pygost/stubs/pygost/kdf.pyi @@ -14,7 +14,7 @@ def kdf_tree_gostr3411_2012_256( label: bytes, seed: bytes, keys: int, - i_len=1, + i_len: int = 1, ) -> Sequence[bytes]: ... diff --git a/pygost/stubs/pygost/utils.pyi b/pygost/stubs/pygost/utils.pyi index 1b5f461..aff49bc 100644 --- a/pygost/stubs/pygost/utils.pyi +++ b/pygost/stubs/pygost/utils.pyi @@ -14,7 +14,7 @@ def hexenc(data: bytes) -> str: ... def bytes2long(raw: bytes) -> int: ... -def long2bytes(n: int, size: int=...) -> bytes: ... +def long2bytes(n: int, size: int = ...) -> bytes: ... def modinvert(a: int, n: int) -> int: ...