Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
belenios
belenios
Commits
7ae1aa2e
Commit
7ae1aa2e
authored
Jan 23, 2013
by
Stephane Glondu
Browse files
Better apidoc for ElGamal
parent
81004289
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/elGamal.ml
View file @
7ae1aa2e
...
...
@@ -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
&&
...
...
src/elGamal.mli
View file @
7ae1aa2e
(**
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]. *)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment