-
-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sage.crypto
: Update # needs
, modularization fixes
#36106
Conversation
src/sage/crypto/classical_cipher.py
Outdated
@@ -165,25 +170,23 @@ def __init__(self, parent, key): | |||
EXAMPLES:: | |||
|
|||
sage: S = AlphabeticStrings() | |||
sage: E = HillCryptosystem(S,3) | |||
sage: E | |||
sage: E = HillCryptosystem(S,3); E # needs sage.modules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
block scope
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, done in 826f72d
- ``'cyclotomic'`` -- Special case of ideal. Allows for | ||
efficient processing proposed by [LM2006]_. | ||
|
||
- ``n`` -- Determinant size, primal: `det(L) = q^n`, dual: `det(L) = q^{m-n}`. | ||
For ideal lattices this is also the degree of the quotient polynomial. | ||
- ``m`` -- Lattice dimension, `L \subseteq Z^m`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you inserted empty lines lines 39 and 50 to separate items but not here. Shouldn't it be the same for all items of the list ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, done in 2f0f2f6
@@ -511,7 +512,7 @@ def encrypt(self, plaintext, key): | |||
sage: des.encrypt(P, K56) == C | |||
True | |||
""" | |||
if isinstance(plaintext, (list, tuple, Vector_mod2_dense)): | |||
if isinstance(plaintext, (list, tuple, Vector)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we sure that this change is safe for users ? I'm not sure it's currently tested...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this just distinguishes scalar input from list/vector input. In fact, when neither of the two conditions holds, inputType
remains uninitialized, leading to an error in the last line of the function
could you fix the following warnings:
We have also several compilation warnings that should be fixed in the future |
done in 37a6b46 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thank you! |
Documentation preview for this PR (built with commit 37a6b46; changes) is ready! 🎉 |
📝 Checklist
⌛ Dependencies