Commit 6dd3639d authored by Stephane Glondu's avatar Stephane Glondu

Split out "question" and "answer" types in atd definitions

parent 1a7d3ba7
......@@ -20,6 +20,8 @@
(**************************************************************************)
open Platform
open Serializable_core_j
open Question_std_t
open Serializable_j
open Signatures
open Common
......
(**************************************************************************)
(* BELENIOS *)
(* *)
(* Copyright © 2012-2019 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 for standard questions">
(** {2 Predefined types} *)
type 'a ciphertext <ocaml predef from="Serializable_core"> = abstract
type disjunctive_proof <ocaml predef from="Serializable_core"> = abstract
(** {2 Questions and answers} *)
type question = {
answers : string list <ocaml repr="array">;
?blank : bool option;
min : int;
max : int;
question : string;
} <ocaml field_prefix="q_">
type 'a answer = {
choices : 'a ciphertext list <ocaml repr="array">;
individual_proofs : disjunctive_proof list <ocaml repr="array">;
overall_proof : disjunctive_proof;
?blank_proof : disjunctive_proof option;
}
<doc text="An answer to a question. It consists of a weight for each
choice, a proof that each of these weights is 0 or 1, and an overall
proof that the total weight is within bounds.">
......@@ -25,26 +25,15 @@
type number <ocaml predef from="Serializable_builtin"> = abstract
type uuid <ocaml predef from="Serializable_builtin"> = abstract
type 'a ciphertext <ocaml predef from="Serializable_core"> = abstract
type proof <ocaml predef from="Serializable_core"> = abstract
type question <ocaml predef from="Question_std"> = abstract
type 'a answer <ocaml predef from="Question_std"> = abstract
(** {2 Basic cryptographic datastructures} *)
type 'a group_element = 'a
type 'a ciphertext = {
alpha : 'a;
beta : 'a;
}
<doc text="An ElGamal ciphertext.">
type proof = {
challenge : number;
response : number;
}
<doc text="A Fiat-Shamir non-interactive zero-knowledge proof of knowledge (ZKP).">
type disjunctive_proof = proof list <ocaml repr="array">
<doc text="A disjunctive ZKP. The size of the array is the number of disjuncts. ">
(** {2 Trustees} *)
type 'a trustee_public_key = {
......@@ -67,14 +56,6 @@ type ('a, 'b) wrapped_pubkey = {
} <ocaml field_prefix="wpk_">
<doc text="A public key wrapped with its group parameters.">
type question = {
answers : string list <ocaml repr="array">;
?blank : bool option;
min : int;
max : int;
question : string;
} <ocaml field_prefix="q_">
type 'a params = {
description : string;
name : string;
......@@ -91,16 +72,6 @@ type template = {
} <ocaml field_prefix="t_">
<doc text="Election template.">
type 'a answer = {
choices : 'a ciphertext list <ocaml repr="array">;
individual_proofs : disjunctive_proof list <ocaml repr="array">;
overall_proof : disjunctive_proof;
?blank_proof : disjunctive_proof option;
}
<doc text="An answer to a question. It consists of a weight for each
choice, a proof that each of these weights is 0 or 1, and an overall
proof that the total weight is within bounds.">
(* FIXME: merge this with trustee_public_key *)
type 'a signature = {
public_key : 'a;
......
(**************************************************************************)
(* BELENIOS *)
(* *)
(* Copyright © 2012-2019 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 number <ocaml predef from="Serializable_builtin"> = abstract
(** {2 Basic cryptographic datastructures} *)
type 'a ciphertext = {
alpha : 'a;
beta : 'a;
}
<doc text="An ElGamal ciphertext.">
type proof = {
challenge : number;
response : number;
}
<doc text="A Fiat-Shamir non-interactive zero-knowledge proof of knowledge (ZKP).">
type disjunctive_proof = proof list <ocaml repr="array">
<doc text="A disjunctive ZKP. The size of the array is the number of disjuncts. ">
......@@ -20,6 +20,7 @@
(**************************************************************************)
open Platform
open Serializable_core_t
open Serializable_j
open Signatures
open Common
......
......@@ -22,6 +22,7 @@
open Js_of_ocaml
open Platform
open Serializable_builtin_t
open Question_std_t
open Serializable_j
open Signatures
open Common
......
......@@ -20,6 +20,7 @@
(**************************************************************************)
open Js_of_ocaml
open Question_std_t
open Serializable_j
open Tool_js_common
......
......@@ -2,6 +2,8 @@ src/platform/native/Belenios_version
src/platform/native/Platform
Serializable_builtin_t
Serializable_builtin_j
Serializable_core_j
Question_std_j
Serializable_j
Common
Group_field
......
......@@ -23,6 +23,7 @@ open Lwt
open Platform
open Common
open Serializable_builtin_t
open Question_std_t
open Serializable_t
open Web_serializable_builtin_t
open Web_serializable_j
......
......@@ -22,6 +22,7 @@
open Lwt
open Platform
open Serializable_builtin_t
open Question_std_t
open Serializable_j
open Signatures
open Common
......
......@@ -21,6 +21,7 @@
open Lwt
open Serializable_builtin_t
open Question_std_t
open Serializable_j
open Signatures
open Common
......
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