From c3efd54270ad03eb2c4a6482d4bc3f989d09169b Mon Sep 17 00:00:00 2001 From: Christoph Fuerst Date: Mon, 10 Apr 2017 19:34:06 +0200 Subject: [PATCH] Finally corrected DiscreteLog-Algorithm --- discrete_log.txt | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/discrete_log.txt b/discrete_log.txt index c5c11a5..e92aa12 100644 --- a/discrete_log.txt +++ b/discrete_log.txt @@ -2,6 +2,7 @@ val M: ℕ; val K: ℕ; val L: ℕ; +val MAX: ℕ; type nat = ℕ[M]; type prime = ℕ[K]; @@ -20,13 +21,11 @@ proc InvModP(a:ℕ[K^2],p:prime): prime { var ainv:prime := 0; var i:prime; - - // straight search - // algorithmic alternative: Euclidean algorithm + for i=1;i