From dbcfdfa96be8b52664b394b4d946b83ee3d84d5a Mon Sep 17 00:00:00 2001 From: Christoph Fuerst Date: Thu, 6 Apr 2017 21:46:06 +0200 Subject: [PATCH] Added calculation for m --- discrete_log.txt | 52 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 16 deletions(-) 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