|
62 | 62 | from sage.structure.sage_object import SageObject
|
63 | 63 | from sage.rings.integer_ring import ZZ
|
64 | 64 | from sage.rings.integer import Integer
|
65 |
| -from sage.misc.lazy_import import lazy_import |
66 | 65 | from sage.modules.free_module_element import vector
|
67 | 66 | from sage.rings.finite_rings.finite_field_constructor import GF
|
| 67 | +from sage.structure.element import Vector |
68 | 68 | from sage.crypto.sboxes import PRESENT as PRESENTSBOX
|
69 | 69 |
|
70 |
| -lazy_import('sage.modules.vector_mod2_dense', 'Vector_mod2_dense') |
71 |
| - |
72 | 70 |
|
73 | 71 | def _smallscale_present_linearlayer(nsboxes=16):
|
74 | 72 | """
|
@@ -420,7 +418,7 @@ def encrypt(self, plaintext, key):
|
420 | 418 | \leq 32` and current STATE `b_{63} \dots b_0`, addRoundkey consists of
|
421 | 419 | the operation for `0 \leq j \leq 63`, `b_j = b_j \oplus \kappa^i_j`.
|
422 | 420 | """
|
423 |
| - if isinstance(plaintext, (list, tuple, Vector_mod2_dense)): |
| 421 | + if isinstance(plaintext, (list, tuple, Vector)): |
424 | 422 | inputType = 'vector'
|
425 | 423 | elif isinstance(plaintext, (Integer, int)):
|
426 | 424 | inputType = 'integer'
|
@@ -476,7 +474,7 @@ def decrypt(self, ciphertext, key):
|
476 | 474 | sage: present.decrypt(c4, k4) == p4
|
477 | 475 | True
|
478 | 476 | """
|
479 |
| - if isinstance(ciphertext, (list, tuple, Vector_mod2_dense)): |
| 477 | + if isinstance(ciphertext, (list, tuple, Vector)): |
480 | 478 | inputType = 'vector'
|
481 | 479 | elif isinstance(ciphertext, (Integer, int)):
|
482 | 480 | inputType = 'integer'
|
@@ -776,7 +774,7 @@ def __call__(self, K):
|
776 | 774 | pass a ``master_key`` value on initialisation. Otherwise you can
|
777 | 775 | omit ``master_key`` and pass a key when you call the object.
|
778 | 776 | """
|
779 |
| - if isinstance(K, (list, tuple, Vector_mod2_dense)): |
| 777 | + if isinstance(K, (list, tuple, Vector)): |
780 | 778 | inputType = 'vector'
|
781 | 779 | elif isinstance(K, (Integer, int)):
|
782 | 780 | inputType = 'integer'
|
|
0 commit comments