-
-
Notifications
You must be signed in to change notification settings - Fork 482
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
1 changed file
with
17 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,9 @@ | |
This module contains base classes for various cryptosystems, including | ||
symmetric key and public-key cryptosystems. The classes defined in this | ||
module should not be called directly. It is the responsibility of child | ||
classes to implement specific cryptosystems. Take for example the | ||
classes to implement specific cryptosystems. | ||
Take for example the | ||
Hill or matrix cryptosystem as implemented in | ||
:class:`HillCryptosystem <sage.crypto.classical.HillCryptosystem>`. It is a | ||
symmetric key cipher so | ||
|
@@ -27,22 +29,21 @@ class of | |
| + VigenereCryptosystem | ||
+ PublicKeyCryptosystem | ||
""" | ||
|
||
#***************************************************************************** | ||
# **************************************************************************** | ||
# Copyright (C) 2007 David Kohel <[email protected]> | ||
# | ||
# Distributed under the terms of the GNU General Public License (GPL) | ||
# | ||
# http://www.gnu.org/licenses/ | ||
#***************************************************************************** | ||
|
||
import sage.structure.parent_old as parent_old | ||
# https://www.gnu.org/licenses/ | ||
# **************************************************************************** | ||
from sage.sets.set import Set_generic | ||
|
||
class Cryptosystem(parent_old.Parent, Set_generic): | ||
|
||
class Cryptosystem(Set_generic): | ||
r""" | ||
A base cryptosystem class. This is meant to be extended by other | ||
specialized child classes that implement specific cryptosystems. | ||
A cryptosystem is a pair of maps | ||
.. MATH:: | ||
|
@@ -143,7 +144,9 @@ def __init__(self, plaintext_space, ciphertext_space, key_space, | |
|
||
def __eq__(self, right): | ||
r""" | ||
Comparing ``self`` with ``right``. Two ``Cryptosystem`` objects | ||
Comparing ``self`` with ``right``. | ||
Two ``Cryptosystem`` objects | ||
are the same if they satisfy all of these conditions: | ||
- share the same type | ||
|
@@ -323,7 +326,9 @@ def key_space(self): | |
|
||
def block_length(self): | ||
r""" | ||
Return the block length of this cryptosystem. For some cryptosystems | ||
Return the block length of this cryptosystem. | ||
For some cryptosystems | ||
this is not relevant, in which case the block length defaults to 1. | ||
EXAMPLES: | ||
|
@@ -348,6 +353,7 @@ def period(self): | |
raise TypeError("Argument has no associated period.") | ||
return self._period | ||
|
||
|
||
class SymmetricKeyCryptosystem(Cryptosystem): | ||
r""" | ||
The base class for symmetric key, or secret key, cryptosystems. | ||
|
@@ -373,6 +379,7 @@ def alphabet_size(self): | |
""" | ||
return self._cipher_domain.ngens() | ||
|
||
|
||
class PublicKeyCryptosystem(Cryptosystem): | ||
r""" | ||
The base class for asymmetric or public-key cryptosystems. | ||
|