https://github.com/EasyCrypt/easycrypt
Raw File
Tip revision: a79f9aeb6de046ca12210d26317fab59c175d0dd authored by Pierre-Yves Strub on 08 July 2014, 09:43:21 UTC
Fix bug w.r.t. _tools presence detection.
Tip revision: a79f9ae
Cyclic_group_prime.ec
(* --------------------------------------------------------------------
 * Copyright IMDEA Software Institute / INRIA - 2013, 2014
 * -------------------------------------------------------------------- *)

(* cyclic groups of prime order *)
require import Prime_field.
require import Real.
require import Distr.

type group.
const g:group. (* the generator *)

op ( * ): group -> group -> group.   (* multiplication of group elements *)
op ( / ): group -> group -> group.   (* division *)
op ( ^ ): group -> gf_q -> group.    (* exponentiation *)
op log:group -> gf_q.                (* discrete logarithm *)

axiom div_def (a b:group): g^(log a - log b) = a / b.

axiom group_pow_add (x y:gf_q):
  g ^ x * g ^ y = g ^ (x + y).

axiom group_pow_mult (x y:gf_q):
  (g ^ x) ^ y = g ^ (x * y).

axiom group_log_pow (a:group):
  g ^ (log a) = a.

axiom group_pow_log (x:gf_q):
  log (g ^ x) = x.

theory Dgroup.
  op dgroup: group distr.

  axiom supp_def: forall (s:group),
    in_supp s dgroup.

  axiom mu_x_def_in: forall (s:group),
    mu_x dgroup s = 1%r/q%r.

  axiom lossless: weight dgroup = 1%r.
end Dgroup.
back to top