(**************************************************************************)
(*                                BELENIOS                                *)
(*                                                                        *)
(*  Copyright © 2012-2023 Inria                                           *)
(*                                                                        *)
(*  This program is free software: you can redistribute it and/or modify  *)
(*  it under the terms of the GNU Affero General Public License as        *)
(*  published by the Free Software Foundation, either version 3 of the    *)
(*  License, or (at your option) any later version, with the additional   *)
(*  exemption that compiling, linking, and/or using OpenSSL is allowed.   *)
(*                                                                        *)
(*  This program is distributed in the hope that it will be useful, but   *)
(*  WITHOUT ANY WARRANTY; without even the implied warranty of            *)
(*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *)
(*  Affero General Public License for more details.                       *)
(*                                                                        *)
(*  You should have received a copy of the GNU Affero General Public      *)
(*  License along with this program.  If not, see                         *)
(*  <http://www.gnu.org/licenses/>.                                       *)
(**************************************************************************)

<doc text="Serializable datatypes (core)">

(** {2 Predefined types} *)

type 'a identity = 'a
type number = string wrap <ocaml module="Common_types.Number">
type weight = abstract wrap <ocaml module="Common_types.Weight">

(** {2 Basic cryptographic datastructures} *)

type 'a ciphertext = {
  alpha : 'a;
  beta : 'a;
}
<doc text="An ElGamal ciphertext.">

type 'a proof = {
  challenge : 'a;
  response : 'a;
}
<doc text="A Fiat-Shamir non-interactive zero-knowledge proof of knowledge (ZKP).">

type 'a disjunctive_proof = 'a proof list <ocaml repr="array">
<doc text="A disjunctive ZKP. The size of the array is the number of disjuncts. ">

type voter = {
    address : string;
    ?login : string option;
    ?weight : weight option;
}

type voter_list = voter list

type 'a public_credential = {
  credential : 'a;
  ?weight : weight option;
  ?username : string option;
}
