From e8f351b7b3cfcf16d2b72cbed8211ab1fd4640d2 Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Mon, 7 Oct 2024 20:54:07 -0700 Subject: [PATCH] Fix another bug in the modular inverse --- hill.lisp | 2 +- shift-affine.lisp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hill.lisp b/hill.lisp index 10f0746..544c4d8 100644 --- a/hill.lisp +++ b/hill.lisp @@ -146,7 +146,7 @@ return a cons of (x . y) such char x * N1 + y * N2 = GCD." integer i such that (N * i) mod M = 1." (destructuring-bind (gcd (x . y)) (multiple-value-list (extended-gcd (if (minusp n) - (+ 26 n) + (+ m n) n) m)) (declare (ignorable y)) diff --git a/shift-affine.lisp b/shift-affine.lisp index fde6706..0f1c768 100644 --- a/shift-affine.lisp +++ b/shift-affine.lisp @@ -62,7 +62,7 @@ return a cons of (x . y) such char x * N1 + y * N2 = GCD." integer i such that (N * i) mod M = 1." (destructuring-bind (gcd (x . y)) (multiple-value-list (extended-gcd (if (minusp n) - (+ 26 n) + (+ m n) n) m)) (declare (ignorable y))