kryptools 1.9.6__tar.gz → 1.9.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {kryptools-1.9.6 → kryptools-1.9.7}/PKG-INFO +1 -1
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/__init__.py +1 -1
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/ec.py +8 -2
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/la.py +4 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/nt.py +1 -1
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools.egg-info/PKG-INFO +1 -1
- {kryptools-1.9.6 → kryptools-1.9.7}/pyproject.toml +1 -1
- {kryptools-1.9.6 → kryptools-1.9.7}/LICENSE +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/README.md +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/GF2.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/Zmod.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/aes.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/blockcipher.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/code.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/conway_polynomials.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/des.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/dlp.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/dlp_bsgs.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/dlp_ic.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/dlp_qs.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/dlp_rho.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/factor.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/factor_dix.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/factor_ecm.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/factor_fmt.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/factor_pm1.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/factor_qs.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/factor_rho.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/intfuncs.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/keccak.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/lat.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/lat2.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/poly.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/primes.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools/sha1.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools.egg-info/SOURCES.txt +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools.egg-info/dependency_links.txt +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/kryptools.egg-info/top_level.txt +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/setup.cfg +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/tests/test_GF2.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/tests/test_Zmod.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/tests/test_aes.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/tests/test_code.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/tests/test_des.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/tests/test_dlog.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/tests/test_ec.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/tests/test_factor.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/tests/test_factor_fmt.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/tests/test_factor_pm1.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/tests/test_factor_qs.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/tests/test_intfuncs.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/tests/test_keccak.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/tests/test_la.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/tests/test_lat.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/tests/test_nt.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/tests/test_poly.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/tests/test_primes.py +0 -0
- {kryptools-1.9.6 → kryptools-1.9.7}/tests/test_sha1.py +0 -0
|
@@ -5,7 +5,7 @@ Implemenation of same basic algorithms used in cryptography.
|
|
|
5
5
|
__author__ = "Gerald Teschl"
|
|
6
6
|
__copyright__ = "Copyright 2024-2026, Gerald Teschl"
|
|
7
7
|
__license__ = "MIT License"
|
|
8
|
-
__version__ = "1.9.
|
|
8
|
+
__version__ = "1.9.7"
|
|
9
9
|
__email__ = "Gerald.Teschl@univie.ac.at"
|
|
10
10
|
|
|
11
11
|
from .nt import egcd, cf, convergents, legendre_symbol, jacobi_symbol, sqrt_mod, euler_phi, carmichael_lambda, moebius_mu, is_carmichael_number, order, crt
|
|
@@ -97,10 +97,16 @@ class EC_Weierstrass():
|
|
|
97
97
|
"Display some basic info on the curve"
|
|
98
98
|
out = "Weierstrass curve y^2 = x^3"
|
|
99
99
|
if int(self.a):
|
|
100
|
-
|
|
100
|
+
if int(self.a) == 1:
|
|
101
|
+
out += " + x"
|
|
102
|
+
else:
|
|
103
|
+
out += f" + {self.a} x"
|
|
101
104
|
if int(self.b):
|
|
102
105
|
out += f" + {self.b}"
|
|
103
|
-
out += f" over Z_{self.p}
|
|
106
|
+
out += f" over Z_{self.p}"
|
|
107
|
+
if self.group_order:
|
|
108
|
+
out += f" of order {self.group_order}"
|
|
109
|
+
out += "."
|
|
104
110
|
print(out)
|
|
105
111
|
|
|
106
112
|
def add(self, x1, y1, x2, y2):
|
|
@@ -698,6 +698,10 @@ class Matrix:
|
|
|
698
698
|
K[i, k] = - M[l, j]
|
|
699
699
|
return K
|
|
700
700
|
|
|
701
|
+
def img(self) -> "Matrix":
|
|
702
|
+
"Compute a basis for the image."
|
|
703
|
+
return self.transpose().rref(drop_zero_rows = True).transpose()
|
|
704
|
+
|
|
701
705
|
def det(self) -> int:
|
|
702
706
|
"Compute the determinant."
|
|
703
707
|
n, m = self.cols, self.rows
|
|
@@ -144,7 +144,7 @@ def sqrt_mod(a: int, p: int) -> int|None:
|
|
|
144
144
|
return x
|
|
145
145
|
return (x * pow(2, (p - 1)//4, p)) % p
|
|
146
146
|
# Cipolla's algorithm
|
|
147
|
-
for c in range(
|
|
147
|
+
for c in range(0, p): # find a field extension
|
|
148
148
|
tmp = (c * c - a) % p
|
|
149
149
|
if tmp == 0:
|
|
150
150
|
return c
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|