Commit 7ae1aa2e authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Better apidoc for ElGamal

parent 81004289
......@@ -22,7 +22,7 @@ let hashZ x = Cryptokit.(x |>
let check_modulo p x = Z.(geq x zero && lt x p)
let make_ff_msubgroup p q g =
let make_ff_msubgroup ~p ~q ~g =
if
Z.probab_prime p 10 > 0 &&
Z.probab_prime q 10 > 0 &&
......
(** Module [ElGamal] *)
(** ElGamal cryptographic operations *)
open Helios_datatypes_t
module type GROUP = sig
type t
(** type of elements *)
val g : t
(** generator *)
val q : Z.t
(** order of [g] *)
val p : Z.t
(** order of surrounding group *)
val ( *~ ) : t -> t -> t
(** multiplication *)
val ( **~ ) : t -> Z.t -> t
(** exponentiation *)
val ( =~ ) : t -> t -> bool
(** equality test *)
val inv : t -> t
(** inversion *)
val check_element : t -> bool
(** check group membership *)
val hash : t list -> Z.t
(** hash a list of elements into an integer mod [q] using SHA-1 *)
end
(** Signature of an abstract group suitable for ElGamal *)
(** Signature of an abstract group suitable for ElGamal. *)
val make_ff_msubgroup : Z.t -> Z.t -> Z.t -> (module GROUP with type t = Z.t)
val make_ff_msubgroup : p:Z.t -> q:Z.t -> g:Z.t -> (module GROUP with type t = Z.t)
(** [make_ff_msubgroup p q g] builds the multiplicative subgroup of
F[p], generated by [g], of order [q]. *)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment