From: Christoph Fuerst Date: Thu, 6 Apr 2017 19:46:06 +0000 (+0200) Subject: Added calculation for m X-Git-Url: http://git.risc.jku.at/gitweb/?a=commitdiff_plain;h=dbcfdfa96be8b52664b394b4d946b83ee3d84d5a;p=cfuerst%2Fformal-numbers.git Added calculation for m --- diff --git a/discrete_log.txt b/discrete_log.txt index c64a129..5ea4687 100644 --- a/discrete_log.txt +++ b/discrete_log.txt @@ -18,25 +18,39 @@ proc InvModP(a:ℕ[K^2],p:prime): prime { var ainv:prime := 0; var i:ℕ[K^2]; - - if a = 1 then - { - ainv = 1; - } - else + + // straight search + // algorithmic alternative: Euclidean algorithm + for i=1;i