-
Notifications
You must be signed in to change notification settings - Fork 1
/
ECTemplate2.txt
39 lines (27 loc) · 1.14 KB
/
ECTemplate2.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
cnst g_T : G_T.
cnst q : int.
cnst limit_Hash : int.
op [*] : (G_1, G_1) -> G_1 as G_1_mul.
op [^] : (G_1, int) -> G_1 as G_1_pow.
op [*] : (G_T, G_T) -> G_T as G_T_mul.
op [^] : (G_T, int) -> G_T as G_T_pow.
op G_1_log : G_1 -> int.
op G_T_log : G_T -> int.
op e : (G_1, G_1) -> G_T as G_1_pair.
(*
From easycrypt ElGamal:
If we use the native modulo alt-ergo is not able
to perform the proof.
So we declare an operator (%%) which stand for the modulo ...
*)
op [%%] : (int,int) -> int as int_mod.
axiom q_pos : 0 < q.
(* Axioms largely pulled from ElGamal. Note that G_1 and G_T have the same order if the order is prime. *)
axiom G_1_mult_1 : forall (x : G_1), x * g_1_i = x.
axiom G_1_exp_0 : forall (x : G_1), x ^ 0 = g_1_i.
axiom G_1_exp_S : forall (x : G_1, k : int), k > 0 => x ^ k = x * (x^(k-1)).
axiom G_T_mult_1 : forall (x : G_T), x * g_T_i = x.
axiom G_T_exp_0 : forall (x : G_T), x ^ 0 = g_T_i.
axiom G_T_exp_S : forall (x : G_T, k : int), k > 0 => x ^ k = x * (x^(k-1)).
axiom bilinearity : forall (x : G_1, y : G_1, a : int, b : int), e(x ^ a, y ^ b) = e(x, y) ^ (a * b).
(* axiom non_degenerate : !(e(g_1, g_1) = g_T_i). *)