Skip to content

Commit e6c5afa

Browse files
Remove parent class object everywhere.
Since Python 3, all classes inherit from `object` by default, so `object` can be omitted from the list of base classes.
1 parent 6fbdf3d commit e6c5afa

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

wolfcrypt/ciphers.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112

113113

114114

115-
class _Cipher(object):
115+
class _Cipher:
116116
"""
117117
A **PEP 272: Block Encryption Algorithms** compliant
118118
**Symmetric Key Cipher**.
@@ -275,7 +275,7 @@ def _decrypt(self, destination, source):
275275
raise ValueError("Invalid mode associated to cipher")
276276

277277
if _lib.AES_SIV_ENABLED:
278-
class AesSiv(object):
278+
class AesSiv:
279279
"""
280280
AES-SIV (Synthetic Initialization Vector) implementation as described in RFC 5297.
281281
"""
@@ -383,7 +383,7 @@ def _prepare_associated_data(associated_data):
383383

384384

385385
if _lib.AESGCM_STREAM_ENABLED:
386-
class AesGcmStream(object):
386+
class AesGcmStream:
387387
"""
388388
AES GCM Stream
389389
"""
@@ -540,7 +540,7 @@ def set_iv(self, nonce, counter = 0):
540540
self._set_key(0)
541541

542542
if _lib.CHACHA20_POLY1305_ENABLED:
543-
class ChaCha20Poly1305(object):
543+
class ChaCha20Poly1305:
544544
"""
545545
ChaCha20-Poly1305 AEAD cipher.
546546
@@ -645,7 +645,7 @@ def _decrypt(self, destination, source):
645645

646646

647647
if _lib.RSA_ENABLED:
648-
class _Rsa(object): # pylint: disable=too-few-public-methods
648+
class _Rsa: # pylint: disable=too-few-public-methods
649649
RSA_MIN_PAD_SIZE = 11
650650
_mgf = None
651651
_hash_type = None
@@ -1006,7 +1006,7 @@ def sign_pss(self, plaintext):
10061006

10071007

10081008
if _lib.ECC_ENABLED:
1009-
class _Ecc(object): # pylint: disable=too-few-public-methods
1009+
class _Ecc: # pylint: disable=too-few-public-methods
10101010
def __init__(self):
10111011
self.native_object = _ffi.new("ecc_key *")
10121012
ret = _lib.wc_ecc_init(self.native_object)
@@ -1352,7 +1352,7 @@ def sign_raw(self, plaintext, rng=Random()):
13521352

13531353

13541354
if _lib.ED25519_ENABLED:
1355-
class _Ed25519(object): # pylint: disable=too-few-public-methods
1355+
class _Ed25519: # pylint: disable=too-few-public-methods
13561356
def __init__(self):
13571357
self.native_object = _ffi.new("ed25519_key *")
13581358
ret = _lib.wc_ed25519_init(self.native_object)
@@ -1542,7 +1542,7 @@ def sign(self, plaintext):
15421542
return _ffi.buffer(signature, signature_size[0])[:]
15431543

15441544
if _lib.ED448_ENABLED:
1545-
class _Ed448(object): # pylint: disable=too-few-public-methods
1545+
class _Ed448: # pylint: disable=too-few-public-methods
15461546
def __init__(self):
15471547
self.native_object = _ffi.new("ed448_key *")
15481548
ret = _lib.wc_ed448_init(self.native_object)
@@ -1762,7 +1762,7 @@ class MlKemType(IntEnum):
17621762
ML_KEM_768 = _lib.WC_ML_KEM_768
17631763
ML_KEM_1024 = _lib.WC_ML_KEM_1024
17641764

1765-
class _MlKemBase(object):
1765+
class _MlKemBase:
17661766
INVALID_DEVID = _lib.INVALID_DEVID
17671767

17681768
def __init__(self, mlkem_type):
@@ -2045,7 +2045,7 @@ class MlDsaType(IntEnum):
20452045
ML_DSA_65 = _lib.WC_ML_DSA_65
20462046
ML_DSA_87 = _lib.WC_ML_DSA_87
20472047

2048-
class _MlDsaBase(object):
2048+
class _MlDsaBase:
20492049
INVALID_DEVID = _lib.INVALID_DEVID
20502050

20512051
def __init__(self, mldsa_type):

wolfcrypt/hashes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from wolfcrypt.exceptions import WolfCryptError
2828

2929

30-
class _Hash(object):
30+
class _Hash:
3131
"""
3232
A **PEP 247: Cryptographic Hash Functions** compliant
3333
**Hash Function Interface**.

wolfcrypt/random.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from wolfcrypt.exceptions import WolfCryptError
2727

2828

29-
class Random(object):
29+
class Random:
3030
"""
3131
A Cryptographically Secure Pseudo Random Number Generator - CSPRNG
3232
"""

0 commit comments

Comments
 (0)