X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=cipher%2Fhill.py;h=8233de721231b5b4b2d1c2b3bafff982f48756e6;hb=refs%2Fheads%2Fsimulated-annealing-testing;hp=75048f9a52ddd3840ef19d614455de848f314153;hpb=311b300d197536622980f7a837294d8245e326b4;p=cipher-tools.git

diff --git a/cipher/hill.py b/cipher/hill.py
index 75048f9..8233de7 100644
--- a/cipher/hill.py
+++ b/cipher/hill.py
@@ -1,9 +1,10 @@
-from utilities import *
-from language_models import *
 import multiprocessing
 import numpy as np
 from numpy import matrix
 from numpy import linalg
+from support.utilities import *
+from support.language_models import *
+from cipher.affine import modular_division_table
 
 from logger import logger
 
@@ -41,7 +42,7 @@ def hill_decipher(matrix, message, fillvalue='a'):
     'hellothereaa'
     """
     adjoint = linalg.det(matrix)*linalg.inv(matrix)
-    inverse_determinant = modular_division_table[int(round(linalg.det(matrix))) % 26][1]
+    inverse_determinant = modular_division_table[int(round(linalg.det(matrix))) % 26, 1]
     inverse_matrix = (inverse_determinant * adjoint) % 26
     return hill_encipher(inverse_matrix, message, fillvalue)