From d876a66b15b4cc82e51bc58fe808565c20428fd4 Mon Sep 17 00:00:00 2001 From: Christoph Fuerst Date: Wed, 19 Apr 2017 21:24:41 +0200 Subject: [PATCH] Update after Review Wolfgang --- discrete_log.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/discrete_log.txt b/discrete_log.txt index 2db452e..b66aa0c 100644 --- a/discrete_log.txt +++ b/discrete_log.txt @@ -9,11 +9,11 @@ type prime = ℕ[K]; type res = ℕ[L]; pred divides(m:prime,n:prime) ⇔ ∃p:prime. m⋅p = n; -pred isPrime(m:prime) ⇔ ∀n:prime. divides(n,m) ⇒ (n ≤ 1 ∨ n = m); +pred isPrime(m:prime) ⇔ m > 1 ∧ ∀n:prime. n>1 ∧ divides(n,m) ⇒ (n = m); pred isComposite(m:prime) ⇔ ¬isPrime(m); proc InvModP(a:ℕ[K^2],p:prime): prime - requires p>1 ∧ isPrime(p) ∧ + requires isPrime(p) ∧ 0 < a ∧ a < p; ensures (a*result) % p = 1; { @@ -21,6 +21,7 @@ proc InvModP(a:ℕ[K^2],p:prime): prime var i:prime; for i=1;i