Skip to content

Commit 5c6004b

Browse files
author
Release Manager
committed
gh-36547: expurge parent_old from cryptosystem This is removing the import of "parent_old" in crypto folder. ### 📝 Checklist - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. URL: #36547 Reported by: Frédéric Chapoton Reviewer(s): Kwankyu Lee
2 parents 7c6cda9 + 6d9f69f commit 5c6004b

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

src/sage/crypto/cryptosystem.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
This module contains base classes for various cryptosystems, including
66
symmetric key and public-key cryptosystems. The classes defined in this
77
module should not be called directly. It is the responsibility of child
8-
classes to implement specific cryptosystems. Take for example the
8+
classes to implement specific cryptosystems.
9+
10+
Take for example the
911
Hill or matrix cryptosystem as implemented in
1012
:class:`HillCryptosystem <sage.crypto.classical.HillCryptosystem>`. It is a
1113
symmetric key cipher so
@@ -27,22 +29,21 @@ class of
2729
| + VigenereCryptosystem
2830
+ PublicKeyCryptosystem
2931
"""
30-
31-
#*****************************************************************************
32+
# ****************************************************************************
3233
# Copyright (C) 2007 David Kohel <[email protected]>
3334
#
3435
# Distributed under the terms of the GNU General Public License (GPL)
3536
#
36-
# http://www.gnu.org/licenses/
37-
#*****************************************************************************
38-
39-
import sage.structure.parent_old as parent_old
37+
# https://www.gnu.org/licenses/
38+
# ****************************************************************************
4039
from sage.sets.set import Set_generic
4140

42-
class Cryptosystem(parent_old.Parent, Set_generic):
41+
42+
class Cryptosystem(Set_generic):
4343
r"""
4444
A base cryptosystem class. This is meant to be extended by other
4545
specialized child classes that implement specific cryptosystems.
46+
4647
A cryptosystem is a pair of maps
4748
4849
.. MATH::
@@ -143,7 +144,9 @@ def __init__(self, plaintext_space, ciphertext_space, key_space,
143144

144145
def __eq__(self, right):
145146
r"""
146-
Comparing ``self`` with ``right``. Two ``Cryptosystem`` objects
147+
Comparing ``self`` with ``right``.
148+
149+
Two ``Cryptosystem`` objects
147150
are the same if they satisfy all of these conditions:
148151
149152
- share the same type
@@ -323,7 +326,9 @@ def key_space(self):
323326

324327
def block_length(self):
325328
r"""
326-
Return the block length of this cryptosystem. For some cryptosystems
329+
Return the block length of this cryptosystem.
330+
331+
For some cryptosystems
327332
this is not relevant, in which case the block length defaults to 1.
328333
329334
EXAMPLES:
@@ -348,6 +353,7 @@ def period(self):
348353
raise TypeError("Argument has no associated period.")
349354
return self._period
350355

356+
351357
class SymmetricKeyCryptosystem(Cryptosystem):
352358
r"""
353359
The base class for symmetric key, or secret key, cryptosystems.
@@ -373,6 +379,7 @@ def alphabet_size(self):
373379
"""
374380
return self._cipher_domain.ngens()
375381

382+
376383
class PublicKeyCryptosystem(Cryptosystem):
377384
r"""
378385
The base class for asymmetric or public-key cryptosystems.

0 commit comments

Comments
 (0)