Commit 8fb2a8f1 authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Initial commit

parents
((nil . ((eval . (setq default-directory (locate-dominating-file
buffer-file-name
".dir-locals.el"))))))
*~
_build
#use "topfind";;
#require "zarith";;
#require "calendar";;
#require "uuidm";;
#require "atdgen";;
#require "yojson";;
#directory "_build/src";;
#load "lib.cma";;
let pp_print_datetime ppf x =
Format.pp_print_string ppf (Core_datatypes_j.string_of_datetime x)
;;
let pp_print_uuid ppf x =
Format.pp_print_string ppf (Core_datatypes_j.string_of_uuid x)
;;
#install_printer Z.pp_print;;
#install_printer pp_print_datetime;;
#install_printer pp_print_uuid;;
This diff is collapsed.
all:
ocamlbuild all.otarget
clean:
ocamlbuild -clean
rm -f *~
<**/*.{ml,mli}>: package(zarith), package(calendar), package(uuidm)
<**/*_{t,j}.{ml,mli}>: package(atdgen), package(yojson)
src/lib.cma
open Ocamlbuild_plugin
let atdgen_action opts env build =
let x = env "%.atd" in
let d = Pathname.dirname x and f = Pathname.basename x in
Cmd (S [A"cd"; P d; Sh"&&"; A"atdgen"; S opts; P f])
let () = dispatch & function
| Before_options ->
Options.use_ocamlfind := true;
Options.make_links := false;
| After_rules ->
rule "%.atd -> %_t.ml & %_t.mli" ~deps:["%.atd"] ~prods:["%_t.ml"; "%_t.mli"]
(atdgen_action [A"-t"]);
rule "%.atd -> %_j.ml & %_j.mli" ~deps:["%.atd"] ~prods:["%_j.ml"; "%_j.mli"]
(atdgen_action [A"-j"; A"-j-std"]);
| _ -> ()
open Core_datatypes_t
(** {1 Serializers for type number} *)
let write_number buf n =
Bi_outbuf.add_char buf '"';
Bi_outbuf.add_string buf (Z.to_string n);
Bi_outbuf.add_char buf '"'
let string_of_number ?(len=2048) n =
let buf = Bi_outbuf.create len in
write_number buf n;
Bi_outbuf.contents buf
let number_of_json = function
| `String s -> Z.of_string s
| _ -> assert false
let read_number state buf =
number_of_json (Yojson.Safe.from_lexbuf ~stream:true state buf)
let number_of_string s =
number_of_json (Yojson.Safe.from_string s)
(** {1 Serializers for type uuid} *)
let write_uuid buf n =
Bi_outbuf.add_char buf '"';
Bi_outbuf.add_string buf (Uuidm.to_string n);
Bi_outbuf.add_char buf '"'
let string_of_uuid ?(len=38) n =
let buf = Bi_outbuf.create len in
write_uuid buf n;
Bi_outbuf.contents buf
let uuid_of_json = function
| `String s ->
(match Uuidm.of_string s with Some s -> s | _ -> assert false)
| _ -> assert false
let read_uuid state buf =
uuid_of_json (Yojson.Safe.from_lexbuf ~stream:true state buf)
let uuid_of_string s =
uuid_of_json (Yojson.Safe.from_string s)
(** {1 Serializers for type datetime} *)
open CalendarLib
let datetime_format = "%Y-%m-%d %H:%M:%S"
let write_datetime buf n =
Bi_outbuf.add_char buf '"';
Bi_outbuf.add_string buf (Printer.Precise_Fcalendar.sprint datetime_format n);
let ts = Printf.sprintf "%.6f" (Fcalendar.Precise.to_unixfloat n) in
let i = String.index ts '.' in
Bi_outbuf.add_substring buf ts i (String.length ts - i);
Bi_outbuf.add_char buf '"'
let string_of_datetime ?(len=28) n =
let buf = Bi_outbuf.create len in
write_datetime buf n;
Bi_outbuf.contents buf
let datetime_of_json = function
| `String s ->
let i = String.index s '.' in
let l = Printer.Precise_Fcalendar.from_fstring datetime_format (String.sub s 0 i) in
let r = float_of_string ("0" ^ String.sub s i (String.length s-i)) in
Fcalendar.Precise.add l (Fcalendar.Precise.Period.second r)
| _ -> assert false
let read_datetime state buf =
datetime_of_json (Yojson.Safe.from_lexbuf ~stream:true state buf)
let datetime_of_string s =
datetime_of_json (Yojson.Safe.from_string s)
open Core_datatypes_t
(** {1 Serializers for type number} *)
val write_number : Bi_outbuf.t -> number -> unit
val string_of_number : ?len:int -> number -> string
val read_number : Yojson.Safe.lexer_state -> Lexing.lexbuf -> number
val number_of_string : string -> number
(** {1 Serializers for type uuid} *)
val write_uuid : Bi_outbuf.t -> uuid -> unit
val string_of_uuid : ?len:int -> uuid -> string
val read_uuid : Yojson.Safe.lexer_state -> Lexing.lexbuf -> uuid
val uuid_of_string : string -> uuid
(** {1 Serializers for type datetime} *)
val write_datetime : Bi_outbuf.t -> datetime -> unit
val string_of_datetime : ?len:int -> datetime -> string
val read_datetime : Yojson.Safe.lexer_state -> Lexing.lexbuf -> datetime
val datetime_of_string : string -> datetime
type number = Z.t
type uuid = Uuidm.t
type datetime = CalendarLib.Fcalendar.Precise.t
(** {1 Core types} *)
type number <ocaml predef from="Core_datatypes"> = abstract
type uuid <ocaml predef from="Core_datatypes"> = abstract
type datetime <ocaml predef from="Core_datatypes"> = abstract
(** {1 ElGamal keys} *)
type public_key = {
g : number;
p : number;
q : number;
y : number;
}
type private_key = {
public_key : public_key;
x : number;
}
(** {1 Elections} *)
type tally_type = [
| Homomorphic <json name="homomorphic">
]
type choice_type = [
| Approval <json name="approval">
]
type result_type = [
| Absolute <json name="absolute">
| Relative <json name="relative">
]
type question = {
answer_urls : unit list;
answers : string list;
choice_type : choice_type;
max : int;
min : int;
question : string;
result_type : result_type;
short_name : string;
tally_type : tally_type;
} <ocaml field_prefix="q_">
type election = {
cast_url : string;
description : string;
frozen_at : datetime;
name : string;
openreg : bool;
public_key : public_key;
questions : question list;
uuid : uuid;
short_name : string;
use_voter_aliases : bool;
voters_hash : unit;
voting_ends_at : unit;
voting_starts_at : unit;
} <ocaml field_prefix="e_">
(** {1 Ballots} *)
type choice = {
alpha : number;
beta : number;
}
type commitment = {
a <json name="A"> : number;
b <json name="B"> : number;
}
type proof_item = {
challenge : number;
commitment : commitment;
response : number;
}
type proof = proof_item list
type answer = {
choices : choice list;
individual_proofs : proof list;
overall_proof : proof;
}
type vote = {
answers : answer list;
election_hash : string;
election_uuid : uuid;
}
(** {1 Tally} *)
type tally = choice list list
type encrypted_tally = {
num_tallied : int;
tally : tally;
}
(** {1 Partial decryptions} *)
type partial_decryption = {
decryption_factors : number list list;
decryption_proofs : proof list;
}
Core_datatypes_j
Helios_datatypes_t
Helios_datatypes_j
{"cast_url": "http://localhost:8000/helios/elections/d341fe6e-0bcf-11e2-8c73-3cd92b7981b8/cast", "description": "lorem ipsum", "frozen_at": "2012-10-01 14:15:59.725606", "name": "What is the best editor?", "openreg": true, "public_key": {"g": "14887492224963187634282421537186040801304008017743492304481737382571933937568724473847106029915040150784031882206090286938661464458896494215273989547889201144857352611058572236578734319505128042602372864570426550855201448111746579871811249114781674309062693442442368697449970648232621880001709535143047913661432883287150003429802392229361583608686643243349727791976247247948618930423866180410558458272606627111270040091203073580238905303994472202930783207472394578498507764703191288249547659899997131166130259700604433891232298182348403175947450284433411265966789131024573629546048637848902243503970966798589660808533", "p": "16328632084933010002384055033805457329601614771185955389739167309086214800406465799038583634953752941675645562182498120750264980492381375579367675648771293800310370964745767014243638518442553823973482995267304044326777047662957480269391322789378384619428596446446984694306187644767462460965622580087564339212631775817895958409016676398975671266179637898557687317076177218843233150695157881061257053019133078545928983562221396313169622475509818442661047018436264806901023966236718367204710755935899013750306107738002364137917426595737403871114187750804346564731250609196846638183903982387884578266136503697493474682071", "q": "61329566248342901292543872769978950870633559608669337131139375508370458778917", "y": "11035146050035319356603071667181326439937107807515709201088015685404040978202063892648229897064130469270615066636381052131142452085234023888839560741606148281002768419540819182281284019365550459609708750759509427014369275748159616258886464283801997052408332150134151844490269051643031165719622678277666381061405843519219397144388843770110318707956593020618624814461542575834319632590650385764594793230396295178235566947356367794274375968671210737081852189350311421617066801356623920201204094622477024074187819873457371119227948971770780245662741429808612196084567496103734758919688927090038376236289215017424770469742"}, "questions": [{"answer_urls": [null, null, null, null], "answers": ["emacs", "vim", "gedit", "something else"], "choice_type": "approval", "max": 1, "min": 0, "question": "What is your favourite editor?", "result_type": "relative", "short_name": "What is your favourite editor?", "tally_type": "homomorphic"}], "short_name": "editor", "use_voter_aliases": false, "uuid": "d341fe6e-0bcf-11e2-8c73-3cd92b7981b8", "voters_hash": null, "voting_ends_at": null, "voting_starts_at": null}
\ No newline at end of file
{"num_tallied": 1, "tally": [[{"alpha": "16231187554018758103687951126977674652689607290192319102301901233153369730982889595882297018729275340990022108263238378062438440480760781494635200558451217524088777975551854978074321971979626940219129197197237387712993092004174001664944608860035693897773287318060166979911479648619040186486804754888546787753647026108252164028406196477624845031140943267596599375486401624054381110894258181756960740818707034377545357419702540575779349198115954940165943900655657262201664830803815915115293123155425616124433921225884918308359707680081083223244941741389532756326628834408522606234435599073688178162835927931318869340802", "beta": "7034175267246877538043659866394000831810644943135180686573229267601592490867583833272958746179117827484002875120289500550402901764787728267654443499229624609274150136882487955558535526512239157476190140734416233230665824073679670161274154015686921518937765367179670485240647087315409474724671396042104056012000869381268759230058338844825813299528633458411417650333694925829331207025537443461434271195459610350744944005809149441977344107023900952754665964139732290790358023812673523120373199703570040957235773438692116743580060750697278912368526379443774646197678045522710332877667012113012855577106594016334071520739"}, {"alpha": "15898639232488354667643439528795636609561668957913175509829557334027836970886227465681704135156967716579589023281731829909769953279073215323871253849908472539859798799151244816877514767403739776778722558071160091507687830368776532316641215986905958055266570822583955206520648719239982250967606977140736912063924699158023214787993037127004876642512360587284506119748466124347518490960739030301781507842672917199310134593770387643720033057372593691938788452884346357598873870321777535399138865922300716511522594669876795523902047568502466756935190650774604450978819632220952400719795922784571046726272967352290965882951", "beta": "12554293160906409572083394417836183952659300779926853229252976751649724782970270049320543193218876286245121178915011545131270094646982281865380273813223095910800357822650789373535457718140983187204489749505494823707566035974985834342646153212603087886214971624678297269834608131527454386859510756135793086041988487280884668455916750871147803644163704351305397487003545488371970225056812154121439538933756979285693860330387253433179788652826776697252605804673437789453619171566540228948527014648298337393643273323033168843910160149922168536504330003476674349223201438729360131395234386130874087951962472995822276354969"}, {"alpha": "14598899407028906701527241390334818863650978722545475543295957938352369233517012437011822674497718468554526976660645746274469236493118647720224382669800673329506723112777339285619916849350416268610538414786238573591749532619916322519439387835658766549966501303201127635350271693279220120440979743640588352307902798781122678482555114527641644187609971216120091782368503598280389260081062822949536125503642113139731909707223261842744991663235908337242331978073628414293517598226895539290028804956777840447202996381167436775515490693587234027222446721614001605889806981206911122872147239255245776971936811864787281044083", "beta": "14080030339974526247061508257532986354547794006812466501919910734933484136185866463175804374256378716016608685964009522031526373943061444536525399819409248225485041086471029218549452119756735300577586240799692853521323670006712052039932240010455116351461415224404140824312747664176013871967581825035016949198740884986723064064719612956068670728509846846433142012460566742185519552930629841766104374213499778250023986364680562641547182031457202196106484234142338118383251111039057533594043281190875164715939337920833400408206783249339326658555762142495320889147902376782289771040672008497316929336286652676562028298777"}, {"alpha": "16088713325416936095455134402224097922860724880536668884283001692929412611423408740533577756964175566757734863217128347928534013588595554029564932684525082015525956299557076920652653695701138736132535300865659065726712141443652348896130267534647766619186205416901999030575434872788460392497821017365893499294206263138771444893977921121693426082912853816418619885371231356537496424791784181729259561647845352176937107678767295850079550657368141306012838261744280190759071600730004005096841231367916265390122746250067203368219517933926875567601658851155059321322379369782128175144567000390449860268840633225300675109934", "beta": "2056392119650181302430495573826723482452196528741839501003858240161643443517744123119752704132588867395067835071518946538230381247573861962447514595365253076635393332765545973011113001408036331134664178108812312276104422495454554091344850310657056485903465607647519265740179096301913918524612535544484209625097559171030436603780022869510228684551628760155567374382801214765690425118984208209638050527608817320144991472043880018493074686692430196583107590586267222358224671887040392949981657491648120986624625805120552959276967332444370843856711745752480476488357524019173183343036490736791116893007805158549346326002"}]]}
\ No newline at end of file
{"decryption_factors": [["557921718569628523210465453415533114432234581558682432807722950476262063138318780218078692576933747933433938677192490920131127134729599337943299218722831026752960394965368780768551423724941718789188803584418531166777903076802808949315052861947289231724363141336691663881791112110357876882977553209562458677954228756798559273126772866883180312361831065629523226836954935889181198519238530664996487809939544203858912614988522534898358207091856729166816493672321490718501686857577760337879981179441256910845954255421274814724290269381822273510263727895409345933818718816945712950886180521151408885386226860359229689171", "12554293160906409572083394417836183952659300779926853229252976751649724782970270049320543193218876286245121178915011545131270094646982281865380273813223095910800357822650789373535457718140983187204489749505494823707566035974985834342646153212603087886214971624678297269834608131527454386859510756135793086041988487280884668455916750871147803644163704351305397487003545488371970225056812154121439538933756979285693860330387253433179788652826776697252605804673437789453619171566540228948527014648298337393643273323033168843910160149922168536504330003476674349223201438729360131395234386130874087951962472995822276354969", "14080030339974526247061508257532986354547794006812466501919910734933484136185866463175804374256378716016608685964009522031526373943061444536525399819409248225485041086471029218549452119756735300577586240799692853521323670006712052039932240010455116351461415224404140824312747664176013871967581825035016949198740884986723064064719612956068670728509846846433142012460566742185519552930629841766104374213499778250023986364680562641547182031457202196106484234142338118383251111039057533594043281190875164715939337920833400408206783249339326658555762142495320889147902376782289771040672008497316929336286652676562028298777", "2056392119650181302430495573826723482452196528741839501003858240161643443517744123119752704132588867395067835071518946538230381247573861962447514595365253076635393332765545973011113001408036331134664178108812312276104422495454554091344850310657056485903465607647519265740179096301913918524612535544484209625097559171030436603780022869510228684551628760155567374382801214765690425118984208209638050527608817320144991472043880018493074686692430196583107590586267222358224671887040392949981657491648120986624625805120552959276967332444370843856711745752480476488357524019173183343036490736791116893007805158549346326002"]], "decryption_proofs": [[{"challenge": "210103431342067606292683463751180547044282699293", "commitment": {"A": "900558172644318599621705627749982943953041765587405816549621576798728483806900697940185991343857884167815147751321191149992113785652948119012064771415333204648940767134576504466327763935736153011198689903910305202904350310502541210885674751189690104629249764201655014500749984604356308955615100009083235302685876466537988915761461045045640754314258349774710884331544963359167144246774982044652327561748684547852148507685319079269289453182777402869476182308504989051820038868214473621781528267887313843995581370331279354845736525350552965685599316393439741129666391331731266071952253779237118563410165552333839002078", "B": "8849702972191721177012829140282887463132268281545854919963232521702779463423761025402253236878232993571174151378919360999346502930259697643712427065855431922372051805826145944400088774085537298445488779436292491837398972736085015018957278671852808542738402697906823583062225191473333057816946351542252780253746147264993404333327617309881808686165623001574788110225271380131573827419468452315035000701442274655308697317625679897707768443641293152353764782015482170659740800438569778609669456082904121452730236278648142022038220095410594033328356224240638826584749281683533692719080489769368549927082179239783378825855"}, "response": "86102527358774054946164613573670140955370817055550656745043143488506928594103"}, {"challenge": "1123755634531363061953907079533855493130891742181", "commitment": {"A": "10148776746242500530145314392057164810283205049774265415135792731997562455773211278573941792502704620870723219650519574101413037932290498799082084936238189189664616445415300061099303301078174302808493308118590071456899611680218704072165982681285992359325351343857561631374076783829309958261637545792045102657216275079935659287478723027283124731745825581960714708617580596167418769902327730612972390175252979551453844806169349987710042781753401650632871037128452495366064030757749680469001385892141738793089639997905866537222746060225595895803004304577066162114129409623692013239135692264744162134421954795844811370820", "B": "12993535667506608369391391144064257165278076206916958976640870267405249678865111498887609894054286415479372333305392321660788999911465923427847899272450067703542831097762156223527972844475792022089202319975712332772169213407517802265294194023128933578008787316435098933689433892339311305605816818151236776390465489555775680964463953531416897986176934122228408301164966483639178891609669698016579029867444029668159577412398514427944632546860279520855153694641889324316054286708301037748317136903660677403363991642825442836526318712007283060799798832713394063197159960655048485875103132635747483821185387729907698893083"}, "response": "40511610907727624561508034722793328513082443280086884054521093866661934625418"}, {"challenge": "1154066041186580635767816694754107216399704312021", "commitment": {"A": "11226193081852679033074567460827008849964127653883613777728532499251783518346319941465820150220177852203249407610076834214484560534452866545158013631290763103564194773002799696548712448679215229704672910971203796986261413247634704361242189958681448590409188505750206385516274309530930234569770154287557907167561424897994521646525815646945922178731756915970823860731150888171421386976307015350174815688237218210581613669166864168515711348306448348305963632431612150418036169829136620733410301805897318762391292206790824894546135798486748877652877992583763717082882661250294420001281133296724520833038117172907520132252", "B": "14112425955832480227878614110187321710897379792939804235597779030689019605913741930899651738172798937832805080274759413295699168681338563266062343755055022745584055820708323766071840907647154587657804041333316077678527914797351515749468774535815195417336109702743626537288115105688413426921018220877738289796981041853142117632812161045108165180454504323292175282961194968769977675252024266987175485359236662347613629368581697992027197691575687475055242750171752001068426165640979266753871979242061354959920114570674647704334292082086425846461353680731992634519198560942704393424613978588674786470807238851879941147583"}, "response": "68836627089203833456322305379472272973879660199492191037783255835540283167566"}, {"challenge": "105828945151618414020125669844826017014947067032", "commitment": {"A": "12664313313457493941028293355546444987683760928070302741065776520190445227598378957683201613838648154510639462731208498836595143884963304489205135121977004047498737593050558776956712474612808776674729974759534963978288814939601036524224574820287871534570690703617564295865683148429715508603292074562173970829227974450418585707777432916989538900914871253760368534215304809376796858548770362597454038226188065971847060530251403788299248855076743324519454337725817983801348841937052507736609511904946978127246908391522091940496164193059598755351339885319770323690510136813131385385780125442992504721956414390419167435794", "B": "14149328989658266283185156538738641069214904338386202285562273593169328596306463275522944054477520333961348859131834040351958962873323731657407598890092104918542942354821878332992417161482986642894510615733467831332974019097710760198826703111189144562584788484140087409703933428207510252042149919453732090966773773731454586905429147178987205136844025571235646581662794971700217343879024100649490312759352793202400465497257366756672337723856389077767296898934084233250020046243404512558072841959806183788675295791578101197816793545398411688840884515043705663815427728300775066922419751439532725833233593838264437079873"}, "response": "42201196483050844569704124556090369253589913223487656599596838414876627936320"}]]}
\ No newline at end of file
{"public_key":{"g":"14887492224963187634282421537186040801304008017743492304481737382571933937568724473847106029915040150784031882206090286938661464458896494215273989547889201144857352611058572236578734319505128042602372864570426550855201448111746579871811249114781674309062693442442368697449970648232621880001709535143047913661432883287150003429802392229361583608686643243349727791976247247948618930423866180410558458272606627111270040091203073580238905303994472202930783207472394578498507764703191288249547659899997131166130259700604433891232298182348403175947450284433411265966789131024573629546048637848902243503970966798589660808533","p":"16328632084933010002384055033805457329601614771185955389739167309086214800406465799038583634953752941675645562182498120750264980492381375579367675648771293800310370964745767014243638518442553823973482995267304044326777047662957480269391322789378384619428596446446984694306187644767462460965622580087564339212631775817895958409016676398975671266179637898557687317076177218843233150695157881061257053019133078545928983562221396313169622475509818442661047018436264806901023966236718367204710755935899013750306107738002364137917426595737403871114187750804346564731250609196846638183903982387884578266136503697493474682071","q":"61329566248342901292543872769978950870633559608669337131139375508370458778917","y":"11035146050035319356603071667181326439937107807515709201088015685404040978202063892648229897064130469270615066636381052131142452085234023888839560741606148281002768419540819182281284019365550459609708750759509427014369275748159616258886464283801997052408332150134151844490269051643031165719622678277666381061405843519219397144388843770110318707956593020618624814461542575834319632590650385764594793230396295178235566947356367794274375968671210737081852189350311421617066801356623920201204094622477024074187819873457371119227948971770780245662741429808612196084567496103734758919688927090038376236289215017424770469742"},"x":"19736913957784887045176970911962160888763575987426059978300192969648710184027"}
\ No newline at end of file
{"answers":[{"choices":[{"alpha":"16004645554638684209602479798815608288407707886587919157554597086102212881898854051107414029513988808002898564729879043257053876446821524096859887006566664716457928937576172939333725114260210207927778667282158673628090555415562341470987024979880689088257210992339648476508618085124856770231757894911416921622861555891270358937421052728436218269174444892406414856886160955758656612671762034364263022226167325925229574976405238397517526902088092982763659971261311330893237035888525983665842575447119611946915140981921762642894348195467024893329250496294553158020736854058925931791458094588858438023877578066026303470786","beta":"15601569198540990793228878986252659933276512945381663415919190762206201655353572411229626789007675686152334258165348269971963222960047347381613777103654023886831628679299653477528413013645107070419917983245797107793192292206588665840545259069185415150607137951161356632975634049802384520554024888878500586975459711933673095139513298901363615826708197251910250736035531573149821136435722471536205981992388446522517349068240349131672377042003872849452814297246508022170312786187610703188438955345873247369364047029306422532451356275967833965885574883585557057173606846163979223469765098869679100348427307908139432019703"},{"alpha":"11122396280741904804139964063111744989603131061276415543913045834288688219614480123361919029390434096854337718611850470647307320693657327440701942603928652973380370852782533482627846464960991562378967458582338873891150557457303620982011974990582087332739477817586166759682897432600462819722780193265138853171992722334625189508642619444878876512162738403290826222593968886344995500617648677876672287010450352705300156941282420826214278488914571346826719464998376379221601809703352328645683126646241180690974099289386978241839120886306331967412732081005551556233084734053123767613686946888618439826224021494568365118765","beta":"13548736087551870802727836211204184464114007145525700779914938990058941223999756731107735098024750533890840997460510964426444940502702191781058315465979315333920776407834196599485713780781339478349863272118215694280082189359073781477196571774272419942550337690673347279361295117854251015484469632058455833831846855909932064804881063110767006647573540526343315473134294255379135693071546377436487960701009045427219520681159735034689346047306205337953821539256941901688404908470316601186182131744082667182328498601249366351079167426924383194547140395497797215743198791366778593870125495546384960527592562454041038846510"},{"alpha":"859756373553261110532105918512056072555607084287242642242997280996209385525471373744262884032080555326671218778446530207485775757780378780196972937585348552914570827335011663067856634785786711919150099809098525552264879029784412552920165735090105072230278313642692882376900713820914463887524487161125299747163882535630770907069103767093031385706579421225839788779409111291676489794021858349201844785361250050341291937966405706758874543826071452468729464415844505335585682907364798439269254117067634514577689184662036216107785255041007510410214010393280072805009226941873146839069322315783345432772376226929947452870","beta":"5379964921624819915350951381986944277237139166541808178933332314531158008570236970520601651662231265985693931343093250211919200811557641899179316091456950814309898047406150459316873848665054209302841619293321275393351659997333371508640160520380597916395813371080797373395048834971114676730553823775138066274131126121437601840740931381142798415991517222352232850342788126819151478280281914250799161920965072590405597178637774378963453087546045193592153265188163307746562834600363554283350876165421754726850703911490281728712442822530022586804215375299606249903135216350602157255997503610540493178488613577463849763604"},{"alpha":"305268282424253487841022451481259697156783286728712560842904137567232484203082743974656908031033505741108862217716032925099494356432835947416979371466277319370833490140795895227309519773359984576392951671539880560120631812557231530333842856664097600391721275326665354355726203826181636385471901546180065279739584032769667914305649334057890120222755070645968311847227423849992698080175329306752267411802194240251360091231031257155246086827900389766129552235858155015081834365218596144367634888402619294677114847257407062742357790041122439720338118334371910429681098322310348946545926009556039654815182139704927158103","beta":"10903215578752644172449993216800180752451885913541070241147070181757591813077602463224993506537963214605067486407707798775202249013040474986258943510448559197321992609605711626204886733221946639803780937538261038715311476521489419183248210789375787555851857772053815627042430696781419684807103013599777410666583452535264405866675386547096474238358386829270875530853653450581207434878822098183103522624627434724568315870893219260855810746307613702732394390291183054097091682276062477019617973038622388633237800713773220457397192927720162627947780204660094093925167941075319543094568437168035201075472016481539213805746"}],"individual_proofs":[[{"challenge":"2977166524743799709631609942127415283767719634229866861766596703424722956169","commitment":{"A":"5115974032410261858394033963734505701168088963154084893592496725810742776449505058894546208759717372289916747827301232647996909241941329098425855763379506792144884677383755465967529059167969014380408990172019596077493784166800542145109385421199780237747901291800070673563738737193709529637286071122898850773782776507093782114403166134095729021666777459642607129792426534587501765845092160601273495328443155751711358048422401258169975141771110820077866408141380795325854912715312250862141680845902845770899498380070028813923142336010350843680843078108364616872540082718715191717185409262553081542941275514621197070606","B":"9363393005073033258782516247646122347339739019050324340994671912704948602463556593931792046522647889215336771892981678401752678276557446041817563954562844199593473137864198578191856399986279530547835505891629071173149477993573606888963880665453363751801350392093019507487177689349517531849602968520954248627034378176695132862492849258590828873513446229856619426523696454592369216031806655342852227029494912344827314568427930153679281729647737607211782620796520044304782415168882498273314057972441206922435676542439087030606226793947094199606702004903543574123643968726652366902243179012420445359617934373988192125518"},"response":"8071565905406899197534731506470390784511661177875640467191584067597404058835"},{"challenge":"58352399723599101582912262827881328039500073949699847043822602371441501069574","commitment":{"A":"3904050879745459953822916737315850178642223446279936453862213128230306851068477201358692520434476059160145779984022007653534121443329206906376745285350259713923324390467433101633751697697924518459540077254956566568528826632153061716574655280257816178950362403820368407577475302142148095499805721336634802284664520116309157027985851511972778525666975419543979274491993701210159559189627132381494487778602950552326141760078960533254203856679423568250678559688945596881173581432048575191617565210694686391175953365599100619531106289048910801012808054109114692399301152919384820240995109120372167941559110847039063614967","B":"6720110233350503254068483207021382557244356846547919224192243143113544291168732462495799126251488779441088235862668794702827060207403292366841223285607061141919299055230697909937169836058041582990547266543006287787507096706058010648996563897095664730237307384750370025562066108048952916589343113278312012025497767878129201402222654678630077942732684687793084731148913851095809826811363395675526481854093777354845259224978646863487933080055878845584490878968611327471969383366272742566923963447858463871183099340193906286129092457407193659986187331730297252767944169494425008918569853570714429406325076622527506115945"},"response":"85798553052025605810737363871699224769252018395829365723290032486985024941819"}],[{"challenge":"55232097098062611095911222823193227907146698598595393123661960095647898415242","commitment":{"A":"13155790662366773853685580538466604037480078288391686130818034911693255974314600730061863119853905915471870407022497985475572356452429740947509601724570105302728003188292976209125676400429571835768340720433750873062183671040059318829231720324131302641035567293878152674524020389580317858693922139935385856962632588333111357437798541136529677237368106584725137448593395122176600805903494905730784909309403073491364782838700019747298279263014353451146588639966931023255104493740627593416532281756570237521204568134961867700958393190133815683664182379328142340642121313428908298964378301950582345111777607720490839193743","B":"11215965642757951762603534829735984582849162071346086620638396003613185255306408304001338317524702989376617295437441483343756605550001412149035325397082977188560099479887193093203953492520942543950918215377229751580382532786137618317679794117982054312453090845515501547442382217947422967231201329367349581121797141482459991243860116490782044279637118389673663385151866273503959676042297903099239157693194556451382017122769845392897250186149037827177107611016073195241082165659458490846734432202478745388539970136914135922542914383870991502427164806388620532259691861354774909075529258831943284017085090776128238813355"},"response":"38309640568476150519886082362285090225449976682114579651676914932748541337526"},{"challenge":"6097469150280290196632649947944479005736826376015810737540392380327175636915","commitment":{"A":"4202346230210645129252737118785350533825753762437781173999581854463484624065222102828326293272307443223167341967836904951259633684034134595703443095405000238898492379471971690413904200842992343962906305309932110248298452094242586543725775092533895134468682066223130558165835812707861369630483590268898366523825330071086469968002035976277016761297792967083126495332642758599852905762193994988873819488428908093102457516765112636702819624090037076467520688935301525040218011094413453324433914187330716246213691412825341845351348524221577295385944488990487783535037390250692436786306970469005373971833562411396561744762","B":"1077757711594638358498835013108360798718829075925524068042133608354499302123559607198680522333573234162107133559221756330052233948602832803653706353334002973823856857881347098192189534754424722741489414785406527898000146867646894240081998530650418085994468980633858777256921960268831592317245631274979617730910563252187483166474262192276033135557234707369601462740624621390581255778935338330638979123871627804063691645525406080904736282642194434684739368164774495906931125166635582304037892743370210116943564856746127729398704165693654423126959797366566710462066340751566641029867047233997772531202694156769929255796"},"response":"7704719679600739480140529043503326671085763190807737426563907575584846217515"}],[{"challenge":"38134319735074299768781403629432468565449208621280222515597410967498127638172","commitment":{"A":"8512210561784721591825533014852579246052508209125638883962470390461854738869465145781979924296485951589339463884450890015489309456064706208012062666027821639567491257288650047748808705815589602053844372335175192926219746978029922227699958619540397534452771964146283578800723011521569551182319126844103007088469242928274919845952058329291290461842434199650075832972095984108579186377754912634978272056388328343398347711604550675690968673984376505379998309355636258684452381141322446527066277531223043688849293931854248923687554682491189960421533858784641121024431846804834314520275235902694851819029564337510286087315","B":"5926160808567068739380596674744344173358252902174533502205004314675951269565421635251310790366061519712038904007966542941858613155821120115268740627078734160681360971618291474253210046433974605999140590645043341752088543975318925133413198771566708328399376144174863516232714084214830040192039092148357289108034738374150821157957347454202317799012875662987959694712061203507103407876347163035726553318777219272264589121301905909641754563612884677603152880304876006877280137486735249877419498876806239595829488148905189229334307292836767123033278138949865377946912236120344044981749375089426128088023687275232844013225"},"response":"36425715971556094337919857358461316638854430953981472162969084279751160433729"},{"challenge":"23195246513268601523762469141886073681448649024180449116244416507526555502629","commitment":{"A":"2045228662462444044267094124519668953741920742267260800045504961055920968777785778308453318489368604706360881324647226575898096010706456718735154623551176180421224521897960911125856753937803111487158643840567085386249490509856380884208012025954579325251991499497875840448331600048904566527140316343719149344735532346234897864554341899428334225893530444169236537539491248560376137862968549023102709540841110956468573477513241341669277706543267735321323970869214331386350441141728391018390001596375884625988601988337117885166853777331737523180015755066781150466846510094393365086825377403521137231096442262132675544081","B":"4486457522573868004540872231293076767308951793105818883370475200303969520582750121257407838933824431972942338445177906148227404156339260818673628452930690272822702753634533155652049245284740559298046097051479178624355455674283462243325932281785033452692415208500614356870551488259772802139139255238463912674789358642931064123612479142146577763945404966283069964495562393036063577256989807950476882336159718210883829907222303018060839618377820865657243993597705106771163128505681603292027744363944800438315795591742282570904501801461433027827463240496254421548527681681198252588456002722794566699475559671614714671280"},"response":"33388144119416508123984631553028205249980837919484845764577253539540385161105"}],[{"challenge":"52741505503878092269456175349456926649256442022976029967833257249931336972629","commitment":{"A":"10564041310974488232673169121739797802380014845955512672967932125512253074934495763322562638565646293507768217130047705089480173256502666464218585589918440162334235102185867687111108297308109572836669999575016934598375082234629851320995785502600777599539025598136550419741096837568026103356873330435567488242324718897931979436908172253758578038561013657761891267350620480549517804534865242547198585712262195484941364668074909753639477120634493970281136172220403907133481904065585723755907985428591709229375334338200822944730910186066319650209804978960399503112658418180947681541031284993060570406500883148716067491706","B":"15702715645591259207520831174371924554650061612045475220177693565770827423302452267970797611400991638325724624338379587036850712505591123561186918998494174178466281197323294216306381431195088903352879842947958589685079768861448319533767705827944796621349867471015471472675233985995461728418357294848421130392067682447651269107561257742313298517281775577267770829200490174796275241557773466511715390907291280096483419550566829920485562740715053308288036814669516848835338363967270968661794084641148373734340421488983277930325364061359250963645135702898224224972176583864494062137295240783008624877696822555244927109465"},"response":"28684611689656363961023417143436789836299309743932731438267385869593762824052"},{"challenge":"8588060744464809023087697421079340380932873309788065734165475285887846974815","commitment":{"A":"15993950603629650300882094584410768948980234083818332072207573704755729128610080989629979617707657993153724947802452088949178267227222449055073063430075584726943715644692016654000453036003434724870063195818720432807718678639035723722821468794114686759766573600368261857417575591696625549665066340506896682284554853945378049688136638239946153561626822496907617575840228529121889725783976950409660405840379015139919730591497337352511853881658679758588975657156467429448851872905004002771354787995335815324629024846671166352865621912835217765950261349830716075347115871112312731807159945792520672220061792435103048868778","B":"11748383991733507589068378268113461486173477713496017061398556374928513022456455709762396398197616027770399038542111759448465618966361805430842964766856130311275121712258657344846467779359582230709326615446880985482256068490828242907098545325184195196006794770516963073414151189170025651147187056612934601590182551016059357496707842496182748086532497813829750233610333848893435366962496425802776821800980833521083322330319769219811200140514891034130163178854518882788132030616123314200300683314681395819715032688644811879101074860761949951981777184965374639419917274347720082845728103917671011350768335754161808462117"},"response":"26042385649281052333123587903830532417363804652514543513013306725670718643873"}]],"overall_proof":[{"challenge":"40243497195041520807390972803929387140783204802886296625425420082234972995752","commitment":{"A":"13262724328647843764638453694803036937297925628383791390873642474756124548236268569741259140836709172869701404239199406291598896715623450298056714536142698078471151911142496502946001255520306437303365522270817715065413585558675634571263613070446601377111403294760371734476979631660310700325612448872294156761380424794856381202903625273751630784963861905581007930637828799743759366302599987226224659258682436966334739165449103146337461246547083082527198638744189564569955896317953367802438494622081964852719809563046013480008184480943672805598124994972530367925686130514931085236810344191689019717038858616450880528999","B":"7877769347595304306781370836801930153920485469016447489734283313715594533739154046836759868890166002946700682272908505206115533472350142877178518638664619471882625614553159784335243737743980363413099167792960373129257881955425346545435490167757960889294635281305815292215959821375861890438976707641115878230234672170050873547934456196578761127082603219767418902697152798028314224628777143121178039102198545824807385476772757375612977948400850206621639852171188391831589660102400484591565909924904071822381472978907449103472231103379481049134129711550940800283057266692863974268367137309092928795299043915361864720098"},"response":"12761893520111853363753745747266394078414156401404517776928718232454709100113"},{"challenge":"21086069053301380485152899967279172499215591713006980008282700170453770935134","commitment":{"A":"5737870327600388892049722584519774666704371719822959086176503063975361653894710392156381704570094491950571307242813477800342050399749131780403190676211183417973864644111150725657754921138941615338374231097729868371595104889452937094227734282280900869159549656840192227658822267018171492615705026549937049541958141122445721569395826863264170677459829057687994813682258757592304336605213987729552695867414030364191823949174073032143031793064333264008535092322215371500544489697797004031597622760396529137947271467987526063770335568070470712362790001178669053440738485916245751496006217907761431418193788415917659420684","B":"15797915146852215297861487978370461042977797797926107152010893501096402405557698042451955856503396903738755934500898194881716678040902210766394119969934496672325697393278994887223873215733804374465372286697750551775788545986951872572479365184866979058629338627851325076371523020920472336768639599273222844662905574107562669344068225804676487222475310095838900390663105301247078735842675637148650394636907942126870814240012463382399223629249648020094276086919599578448412475895953582745639792109957357862629775399525954399446714442556953579852447476742098168000019548510326411534705217558973396233323268554586922074665"},"response":"61449592292700369640439031418743376196628917357548047400008226279036063673633"}]}],"election_hash":"jm5sEhSHiqnMbSVCfYUHEl148ACh /eRTFvmmw9GMjM","election_uuid":"d341fe6e-0bcf-11e2-8c73-3cd92b7981b8"}
\ No newline at end of file
{"answers":[{"choices":[{"alpha":"784955503461638364688892452799505392903555535259879558769492959597276204621213997238438804202127911812584903447379753711492198354656622055846886359612907791720247190443199802830543676186896381923133697795445554415658413701851934212216988052553473972826552562232269934861796762259637578124847533951056322251180318853384702233821730908495585692844374227764533817593096354819069113902413811595660160931033108056237297914102517010594164359757065101264596033895244644802834619259204657759942066001465342953605760787471768777091895667974848614727896882928454994187675957146201028692023114362886846209224601174860965061336","beta":"7185502580461537870526565055877318456931596491524110520769431568703881311687606250572596423716660499087998444182329182763563703614848294269631702222505833748592556117760396783073598140998909430541059279257524602806669768362103701679341037684082333322111752165241744329990006953298527158368096641485200111006914306853438291134358201421596760824919454425544286866461294347359788451020281766104772136409753707504183973265459066089579752314658310150958211669585959377738720398549890578129679242824414665193783760239786231533395745489336261772387164387151708657252795003400769021931333308120118288307975739483707178571533"},{"alpha":"16047074449241411764923005555499297334817410536706329233045271462407657898379937749774443682025022155804318434623393350246399738598606860664320153740964273765141479046945750405748127026619135076345438406099662307330870550203685611203306168401073298358595330930613099052808039101442046603954666596088319138397816953028137079669104588873365426294430617262830305029592119567967603713632819645150289573465463537489008056907531012537863947032816195695992454846329529167978280820761892514280640085520884107215861291471948578993447513655484057150361457952228926248425675328365124340771910519150710515289392475666594962835271","beta":"5248224532477857576097405008535925075490713150978681592761509556722399810620953119742973612399614552005203709769596876097687846935729071214391926155538697306322188042072279862988705164220704940378153044374543678739484272401947802402503983679800790459998290851555482416986111498934692406753439728555211657483681788858693648382188426972823807143767648282077335975612057604963788323417592067661539682866520105638248969844836750391961228451106280469987153243055805775776101835011310134311572604741324743986773127142506361186279278527688127237614219155686031919628618709823874218931273909097586939643230719104672702634991"},{"alpha":"4506463352308640841677813916359659091725324896767629664688964803330483331711023665860031215567533597860325522424672946536495995886413823463051076015100980473982450872135796089631490943902459989085149442481117065915292587030070405086649872053158461068278954785795120833483680861341097117337151308419111239998440956303038857914776202044737982850874048823254060357003667040345459525796416729287795372616578427398799485137488416804458962787273756805673689878541144443585376071280213619385691836282234490268522073872026851529000315590138428464081912934983545805252046689352170821568812076101902328310851003038676287307392","beta":"1719717497524030643077643072263190100016591948648983440641624262490390436978736752204024425806905822170316229952051239969349206570213176166937747141608737493194181374327362015167725802981788307284480918356963875689220821916335806883454024551814766465982927212892096591450337969641288226920146975088925972579935538661136127054720801764572788030080610223444645655534627930714806287984650411161098626775804044342987216364787055359755914903223571653122707871291151570804728300761382294486634639568896915755655119285082609923917029967319616629237755040618694016553303575630195271176268416332695449127987134228318329567619"},{"alpha":"2760834796767554306625851128458499486685111219067024682983921510882588333292578969130972908194365069966537478176945287430758657338737618849235965273038288296656105861649742122284169826588865627165335587610182010280837425316195136837934517203584366162578901134634802229840408053830380314656820950278960430871872392587120950350557300474448492756991122814109867603952980194787381861594532237813234186297784890824708007688184391896028292143587561312698609885138570088230763185948465683721768429441544692641642897358958621667338987973435695272866184576236449047402329795224254312286711648516051116803658155028765952938984","beta":"5201202052522143087547857242757182298388639374931515882076084383054306016517526211485684113122729446987042228744957438894475271004984766705985699968411330790109099536891381382619941756313382972156618256883692528248945006952182774137765646969375867999832199381263500730002152838331130564256641942819969604141371184584257635787121420756057210475315418281843939241027202165170847526878262543620963608259387682146111985229554710649133916454838492420228411028734025708509430203860548461366966656524298183874529976313348927055165968222946902903218956655311956303785255237650446528306264084573468110382630332871169793019863"}],"individual_proofs":[[{"challenge":"23475223172013361660517061772841603925791870549092668823721868773958114057642","commitment":{"A":"12515509115353625054294512913499065439710297148405401481395578455517930937425814788474583984514168634764356726074193275655264874499224369251760887480147871966626302859269399088596656577658441105363979452819020183477364506315018197408251840932266607691626070346313922236372709195806628008907236510112556954446637856714826924289731749474226182470609998244217725491143394467016937969716959398260165299272883961042749526853802790422904198233356284977524648067518625904415370300615431892824820322021305790633717215274988122735460570711790886693051661576047630682985535875693350026732349381908751230737026257384853536549212","B":"12821032197959700186441086066589519267049036564830018758474529891540716348124851275332507141449028636376890509876088094894308651674528872262913687291532978489000358135247104074731243872382006159689312699217668122526437459784150479539093202998518819190747445959320555494023502698940158928304255949379833528767142191402277562069165938352561016706490628583556982297549857740155390463181240923760458457954076364668614311673450490621225742849191125603748755208458722063373792141190327256573656671426236096736250853792226184501563320034327415132009520045343577575972367105673701609223590095590823804555855161526116734155697"},"response":"8536435139604395483687097618678992701137283130216384859081054603039426276363"},{"challenge":"37854343076329539632026810998316509316806123540632266896667894624642044825551","commitment":{"A":"3742002840418401369750678667735027760290023665589914957228065461229585184972458475108460701292763024512581027136359264998389596238438041874130092570060442451724154300822900025571991539225413787076875664202654073536868681975089950963962035017417606510980384785253456748840481128036109254363455941586692253721218564520453555334126846610155550669295454425938227929376990182710777791389075938538252832971763363054244743980117830260346548913391872155877141958896433945914596350651738144030115466755971453924900433833032476519396116978959001169720496829606034604412109153127380362789771245852539062149708344619098854691523","B":"3264700430417559683357105360880993843645990212411201480429133480131981766188419403186756733983346409571767405555985994637226253165982986000002815822507526766894242845009062062577805561428663301913439610181353894090112856816799134242308000925439974316836596371725194182223257103581285074868842040173155984788634907249742780014925419452684565853992573640547285374502502542182484364816690861681600293309700325415387436966975573035444445388987647653111603678325512127811464253873671164671347254341111594363677496875005320522442988065806362317500511267553686921563695977730027881275949248187003494610809221335600244148635"},"response":"79797797265201558339397622028928557253060819096334216355122442526395883694520"}],[{"challenge":"37560954545818620931365447090100219216563973443883982907118867241762911580634","commitment":{"A":"8488922099174873499900572042258862160493125084181260425914292005012707867045402166542460911088077976996429723092057048365078758735057848285146684205223347822548697133844340058170058771842406418724256082796739422952302242448249786253869778500210142128104564273803218890700609588946542594038392662440582028690901312115838517940178186699645020677315950987616081252115470028017599591557115426929381285446678421818263924801923616483167076367255400907943604620290517963862790279061189413501366633982039252357902822066393977196171121755340503711033620744297048018379547727420707510746837790748828130611533592673101774160742","B":"5426320092274641969613925465520693427687658849994473982914165006126795809774620341712322951561393844605466099026601895488198417992215742193743285681795345800147431984085958671454988536371867125650518703989831368868476714428950241860042800868255764851006838341112476495310493594762324761521042822678809416037822170205487131664657300016432243794417806236703041970823854796596607165549885217284126067545112768589156171824385056833925045612820464500297684305416387789818528675367639634202837398647996542393196131584956838290790413587867444775078210718451845250055772210747100996403609915568157206388492984409213975491764"},"response":"80514053384336247857332536961650122298753020230216898203552681262519743908322"},{"challenge":"23768611702524280361178425680464698275241362399870828973430019150916292633429","commitment":{"A":"3485612956232634997653075317170774104393258681647130252530897523691072541884206974523433136997368431688833638010174172246494558351867012734199928826064574287088812269753908637368869728213929189838392769293917514596647617075672004403991406839830178040535361571520301013967976546188738202645035242700501067910917905054488587529304044303465340976942451551658725301631975585674942073853639100055756290976860770642775772287106784728096064679269375528150741141388244087320940289290228803188881715845909677818242738373347132448023508232691485919721242886980754994201193671022218081920405743356883191211062819265104470501550","B":"14188873177349001333468382790204376161403487197648017174800594862533507436649536363616881773750305099146538099801605861939704848941502155149117682632405917802909491782394046911469147433860325470068196247925813577649762095460638097408752007360186037274922307769892757679305310069602240067756048117872649227011160469998108774856473910960832335795347725551567506961277459865473399447845267063222507217422911041631264766522985426569860047817815730881025041418838272089043831240327258700122130994728089743324342099298023826675408773449160341155621206151393962928149717915529421795844430845939047356449956510585479072357466"},"response":"30383429097778620717973919763174326215921170559106604239399953940024146812258"}],[{"challenge":"61297482559810577350741703497224731207638507979970339167612880695593242812362","commitment":{"A":"3008461672929210626761376350049614448076276599051083108358575341208839882147450255562023296938361131046887827798223355537666160205479237908507194250486360627705180128647482623920791458722325621974689495819696508330969073159149094401482397207971679488991513088047549909036050044265340378164493469909055688282089557435548873639321705289210157777583404944646791236680190131138907120560066691574122773554272952833619856391517344415938679394096539846623099415067067348923496994750694115921663800323578485974011301714356818773476581599622451688381285827740681481377699067576256635521951335106806785091096031221792349130457","B":"15191974908285688717412076997935699774532018658636468348408042594294703545295678554292934912368781139685130044853535250101804281491454234588672730611989592711609177601490655972463457549560395147142332539289343110405788456915611541117378015891366023724725384013752860631565357658271588756783099473059457017764064497608888121855478925199944794348222309356006920971703427589750531337115342371600035037518477783363070571587817670502488242922378403768478087674814533836322097025472418825301200435018873570348405342138418999824013726213278128858557506437609620753169695652956617590990199064590337724249991383629216616577082"},"response":"81426599759799619842291020752186792081679448459981989612277305203724568945428"},{"challenge":"32083688532323941802169274096841904043407303433912120214506447656717807345","commitment":{"A":"12482333411338459816470776986380918991514340036670924914512751812473948782105693756476401906104709341333289040082181292136344526680887938336021552922407929537883837448665942679892337006095637110757607108127717605867013617010611078752016368223099825601015889667763550362377967428861660003343944450395683615067062150560478335970930367145684850603858683427382326721512482258976513790136239561836065282862529143430422547059728618035568061588589380595370343555987948065723571221877001535945748352305387004986632096070788481037120174434736962963639154310322507670496265814018045042126373405551212148143048349822200490825724","B":"2731330118144509783289089148848228159807543229958013462193300413297366100074142842568584520852374892579600933592681426178225582614663912183842249559972668873381253110836193783207643365284718767012002468351880971839609618415752117037674480983478421172483157013483121084874401869878027882393727000004536136695977817251681740531724268012143933695431576952224186418286586553847009018066833894265334204598016221812833138610325482126277054242989168848606436007554009964295387515248634999191106707175335817097127603725678030759697544995514746902236837118560036249195606275875751943351010257595097915092628746673758371292784"},"response":"30323404648021751666243965010790943721301332111689385077513708835451686711059"}],[{"challenge":"9615138624345241527528029289561362120454128719708195796339976514613401652080","commitment":{"A":"177902272904631101406671094276721621620055471704246620424639912765014988422885118351363092376756213449978617437757360891962373259084418769189942726983480720191930653815811471761623881330378898734889422350181434568591934490420600313958747627173732738684821773673625431108628770581478794273847713972631534811279176269917059665507912795949710070466721871575858294338518932305949033390164341659447699839773887709999104562524303575863593843546463871402080974099097710077269614485959749974989278621972762054074933524586849160500810604790847115976491520410591740747912840999536364253400522342343996238460651661692493374817","B":"148132439670602982166183703463357635346092842040726586907659041538284401959200323926820582669241815295042929642626315086766548670040123538346475456980134647949654378143411022247892853021842567754593073175876514222108696032587710651588743592815788777872712160792875344562647028627497790964140984685182908180297714929928872473573995918546333779574823949709065784485672974952968024817431998435297237983611799715543263509544183539433765914050197395706563391938494311860842917395863388375641882133775255950624611180157686308788756353649634130700120553161959256551990546056724802005116526075869176051588396151386213251104"},"response":"38880744429492029444071284235932249926941039416426111013184497767290150824573"},{"challenge":"51714427623997659765015843480792177536167115513571188958759725734417425185382","commitment":{"A":"5278025965094923891188209438278200627128054096816293060366779140076264522455847844040392275536515078508274914419477489623968457952810553374917155747011969610937246412977407399842714445704806320521669701682240925717074548010700092756420562981500211912665430279402105476386410270730460808302181710704761796507953289864045073968620585379739626978491812358423311827391740377245983904759329082174053034122124996238097842517924333818159322557033363100618415506151177195307949746960599068445275553502094037143140526479955734416197962124442208647419002791967564287193675849556219806185031773907605763041167573298000297036144","B":"14756405399906177305467634678687371413037781381549145526420598946003111773676032983905795280744506652899247898078142124853085317364926225389580500573223017230651043959055212143575842283708095313470675407261921119836754243955024466824237100839594698365274701990247633005186111324538031140645220117541668462558019565373059979507130120985083405024511336278047667221008004154502321087911649394496688474077459516945770377994507978746791633825590741225611997459570113024957963331503966252695763393981382851416721254843403921035170906411803802018435984488690122404781763917842007058873351619924185519037799000874475891353929"},"response":"22138040665731830022351107386180379412016902748293130250154731373367075185957"}]],"overall_proof":[{"challenge":"50070307612862247603552482768809694054596050684036995497353702754566030915157","commitment":{"A":"7636035219660583890540207972408558218653766626047834080238145869306616381728446663260069331427998881818892337504138664288851512812037702553933558372590710103014640560783725335555475268209478590294390411305754417721804457576487740904885845830677906633113791516691116653421100661149725595889020699855363181797795117414426816195031277318525247600184444669386422103688266212369606809112847426518440173651012001999112300016674551305702313061587435504770526411015053649941038760348926490009657121097366374693243665858823252852258717032272448573716813262669268752252575498735351241564717984479720163792738100301690781569734","B":"380683751752578970669240669473324233615551682538029242714510800009677678024584823296794574868147233996953469449356447661650200771361876329981007334127848153064535384216796648143822871402142540055905964986268469226825353008992157388810387828427907481678392607099318908072244491364519088192728742158376844735713347902254356230171527926552483116059070732208197000475483765425381649923353947594257137510178314368687755932032818618719391812281271862228828311578928209742617402630887920180645481748515087171811950546985925913079304255091426410571607044961270195610176311355445994130068600119708131439725215851258323325582"},"response":"14292557198320884845120629074339467477523846579859588328044566249397784912260"},{"challenge":"11259258635480653688991390001296154513957842529644535695842673100109472191562","commitment":{"A":"4164333785655476234862856823596734483773722682211811017133504790171236103334621473418178697607232417073215574427972458379865188387575726678165754225456964601387973471760567830513830434742552832141116100982160591297461936855540093412942871642292380662646828849237812443542460502504591999473633991148053269099808407756946571517206503460911158657251165703728558821330019993269306218515943320574120426683418630894983356640314582932831494742359901325391374058569768140881660888693390934192000658559247680818088589954826273774750592537629210013079433439828119750562221239150071672585895027295643893861983692559293602869196","B":"8807994836138995332358767072520334210600824980467398735475887546297391002066571330948721321516029769374148977884857918952252620007888687253675638736305455512452957523475955666156818980544288300268975296582130026519796660074410713424329540542238519427986763740798624842046101167763391513747416446116892317888844584494177333445821130576704125534102841461624155247638982036969761364702845079925975919203072427205393609937476016209671455467257373291107469870170877685225665561676411609683577801907302340562370940418908749709368507609287114833256182617512829669669955874888367394041475676760687871204101896970500105565428"},"response":"98106421344231718158638233846439497965646053465043726294962001923413350928606"}]}],"election_hash":"jm5sEhSHiqnMbSVCfYUHEl148ACh /eRTFvmmw9GMjM","election_uuid":"d341fe6e-0bcf-11e2-8c73-3cd92b7981b8"}
\ No newline at end of file
open Helios_datatypes_t
module type TYPES = sig
type 'a t
val read : 'a t -> Yojson.Safe.lexer_state -> Lexing.lexbuf -> 'a
val write : 'a t -> Bi_outbuf.t -> 'a -> unit
val election : election t
val private_key : private_key t
val vote : vote t
val encrypted_tally : encrypted_tally t
val partial_decryption : partial_decryption t
end
module Types : TYPES = struct
open Helios_datatypes_j
type 'a t = (Yojson.Safe.lexer_state -> Lexing.lexbuf -> 'a) * (Bi_outbuf.t -> 'a -> unit)
let read = fst
let write = snd
let election = (read_election, write_election)
let private_key = (read_private_key, write_private_key)
let vote = (read_vote, write_vote)
let encrypted_tally = (read_encrypted_tally, write_encrypted_tally)
let partial_decryption = (read_partial_decryption, write_partial_decryption)
end
let load typ fname =
let i = open_in fname in
let buf = Lexing.from_channel i in
let lex = Yojson.init_lexer ~fname () in
let result = Types.read typ lex buf in
close_in i;
result
let save typ fname x =
let o = open_out fname in
let buf = Bi_outbuf.create_channel_writer o in
Types.write typ buf x;
Bi_outbuf.flush_channel_writer buf;
close_out o
let () =
assert (Sys.command "mkdir -p _build/tests/data" = 0)
let load_and_check typ fname =
let one_thing = load typ fname in
save typ (Filename.concat "_build" fname) one_thing;
let r = Printf.ksprintf Sys.command "bash -c '\
diff -u <(json_pp < %s) <(json_pp < _build/%s)
'" fname fname
in
assert (r = 0);
one_thing
let one_election = load_and_check Types.election "tests/data/election.json"
let one_private_key = load_and_check Types.private_key "tests/data/private-key.json"
let vote_1 = load_and_check Types.vote "tests/data/vote-emacs-1.json"
let vote_2 = load_and_check Types.vote "tests/data/vote-emacs-2.json"
let encrypted_tally = load_and_check Types.encrypted_tally "tests/data/encrypted-tally.json"
let one_partial_decryption = load_and_check Types.partial_decryption "tests/data/partial-decryption.json"
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