aboutsummaryrefslogtreecommitdiff
path: root/ls47.py
diff options
context:
space:
mode:
authorMirek Kratochvil <exa.exa@gmail.com>2018-04-12 10:12:34 +0200
committerMirek Kratochvil <exa.exa@gmail.com>2018-04-12 10:12:34 +0200
commitf73bc96360b385ad167d7f7e91b6b2a8e6266d0a (patch)
tree6db13d8e461af0e5feb75b330b5142db18138543 /ls47.py
parentaaf98a3d7d1f4197c1e320fde6cb0513a1c6e270 (diff)
downloadls47-f73bc96360b385ad167d7f7e91b6b2a8e6266d0a.tar.gz
ls47-f73bc96360b385ad167d7f7e91b6b2a8e6266d0a.tar.bz2
fix the fixpoint-ish problem for ls47
Closes #1 Try encrypting ############## with lc4.
Diffstat (limited to 'ls47.py')
-rwxr-xr-xls47.py4
1 files changed, 0 insertions, 4 deletions
diff --git a/ls47.py b/ls47.py
index f548514..cb9f555 100755
--- a/ls47.py
+++ b/ls47.py
@@ -106,10 +106,8 @@ def encrypt(key, plaintext):
ciphertext += c
key = rotate_right(key, pp[0], 1)
- mp = rotate_marker_right(mp, pp[0], 1)
cp = find_pos(key, c)
key = rotate_down(key, cp[1], 1)
- mp = rotate_marker_down(mp, cp[1], 1)
mp = add_pos(mp, find_ix(c))
return ciphertext
@@ -126,10 +124,8 @@ def decrypt(key, ciphertext):
plaintext += p
key = rotate_right(key, pp[0], 1)
- mp = rotate_marker_right(mp, pp[0], 1)
cp = find_pos(key, c)
key = rotate_down(key, cp[1], 1)
- mp = rotate_marker_down(mp, cp[1], 1)
mp = add_pos(mp, find_ix(c))
return plaintext