auditor
Class PreElectionAudit

java.lang.Object
  extended by auditor.PreElectionAudit

public class PreElectionAudit
extends java.lang.Object

Class that runs pre election audit for Scantegrity elections

Version:
1.0
Author:
Filip Zagorski

Field Summary
private  int[] ballotsOpenedForAudit
          table of ballot's indexes opened for audit read from MeetingTwoOut.xml: xml/database/print/ row[id]
private  int[] ballotsRequestedForAudit
          table of ballot's indexes requested for audit read from MeetingTwoIn.xml: xml/challenges/print/ row[id]
private  java.lang.String[] c1
          Commitments to P table read from MeetingOneOut.xml: xml/database/print/row s1/s2
private  java.lang.String[] c2
           
private  java.lang.String electionConstant
          Election Constant read from MeetingOneIn.xml: xml/constant
private  int[] maxNumberOfAnswersSelected
           
private  int[] numberOfAnswers
           
private  int numberOfBallots
          No of ballots read from MeetingOneIn.xml: xml/noBallots
private  int numberOfDTables
          No of D Tables read from MeetingOneIn.xml: xml/noDs
private  int numberOfQuestions
           
private  java.lang.String[] p1
           
private  java.lang.String[] p2
           
private  Partition[] partitionCommitments
           
private  int[] startFrom
           
private  java.lang.String[] typeOfAnswerChoice
           
 
Constructor Summary
PreElectionAudit(java.lang.String path)
           
 
Method Summary
static void main(java.lang.String[] args)
          Method that runs post-audit check of table RS, RM and RF
private  void readElectionSpec(java.lang.String path, java.lang.String xmlFilename)
          Method parses ElectionSpec.xml - reads information about questions (number of questions, type of questions, number of answers)
private  void readMeetingOneIn(java.lang.String path, java.lang.String xmlFilename)
          Method parses MeetingOneIn.xml and checks:
private  void readMeetingOneOut(java.lang.String path, java.lang.String xmlFilename)
          Method checks: if the number of rows in the print element is the same as the number of ballots in MeetingOneIn.xml if the number of rows in each instance in a partition element is the same as noBallots in MeetingOneIn.xml if the number of instances in each partition element is the same as noDs in MeetingOneIn.xml
private  void readMeetingTwoIn(java.lang.String path, java.lang.String xmlFilename)
          Parses meetingTwoIn and reads id's of ballots requested for audit
private  void readMeetingTwoOut(java.lang.String path, java.lang.String xmlFilename)
          Parses MeetingTwoOut.xml - reads id's of ballots opened for audit - then checks if commitments to p1 and p2 for these ids are formed correctly - then checks for all D-tables if commitments to d2 and d4 are correct verify if d2(d4) = p2(p1^-1)
private  void testRequestedData()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numberOfBallots

private int numberOfBallots
No of ballots read from MeetingOneIn.xml: xml/noBallots


numberOfDTables

private int numberOfDTables
No of D Tables read from MeetingOneIn.xml: xml/noDs


electionConstant

private java.lang.String electionConstant
Election Constant read from MeetingOneIn.xml: xml/constant


c1

private java.lang.String[] c1
Commitments to P table read from MeetingOneOut.xml: xml/database/print/row s1/s2


c2

private java.lang.String[] c2

partitionCommitments

private Partition[] partitionCommitments

ballotsRequestedForAudit

private int[] ballotsRequestedForAudit
table of ballot's indexes requested for audit read from MeetingTwoIn.xml: xml/challenges/print/ row[id]


ballotsOpenedForAudit

private int[] ballotsOpenedForAudit
table of ballot's indexes opened for audit read from MeetingTwoOut.xml: xml/database/print/ row[id]


p1

private java.lang.String[] p1

p2

private java.lang.String[] p2

numberOfQuestions

private int numberOfQuestions

numberOfAnswers

private int[] numberOfAnswers

startFrom

private int[] startFrom

typeOfAnswerChoice

private java.lang.String[] typeOfAnswerChoice

maxNumberOfAnswersSelected

private int[] maxNumberOfAnswersSelected
Constructor Detail

PreElectionAudit

public PreElectionAudit(java.lang.String path)
Method Detail

testRequestedData

private void testRequestedData()
                        throws java.lang.Exception
Throws:
java.lang.Exception

readElectionSpec

private void readElectionSpec(java.lang.String path,
                              java.lang.String xmlFilename)
                       throws java.lang.Exception
Method parses ElectionSpec.xml - reads information about questions (number of questions, type of questions, number of answers)

Parameters:
path - - path to the folder with election files
xmlFilename -
Throws:
java.lang.Exception

readMeetingOneIn

private void readMeetingOneIn(java.lang.String path,
                              java.lang.String xmlFilename)
                       throws java.lang.Exception
Method parses MeetingOneIn.xml and checks:

Parameters:
path -
xmlFilename -
Throws:
java.lang.Exception

readMeetingOneOut

private void readMeetingOneOut(java.lang.String path,
                               java.lang.String xmlFilename)
                        throws java.lang.Exception
Method checks:

Parameters:
path -
xmlFilename -
Throws:
java.lang.Exception

readMeetingTwoIn

private void readMeetingTwoIn(java.lang.String path,
                              java.lang.String xmlFilename)
                       throws java.lang.Exception
Parses meetingTwoIn and reads id's of ballots requested for audit

Parameters:
xmlFilename - - path to the meetingTwoIn
Throws:
java.lang.Exception

readMeetingTwoOut

private void readMeetingTwoOut(java.lang.String path,
                               java.lang.String xmlFilename)
                        throws java.lang.Exception
Parses MeetingTwoOut.xml - reads id's of ballots opened for audit - then checks if commitments to p1 and p2 for these ids are formed correctly - then checks for all D-tables if commitments to d2 and d4 are correct verify if d2(d4) = p2(p1^-1)

Parameters:
xmlFilename - - name of the file to open (usualy meetingTwoOut.xml)
path - - path to the folder with election files
Throws:
java.lang.Exception - - if commitments are not correct

main

public static void main(java.lang.String[] args)
Method that runs post-audit check of table RS, RM and RF

Parameters:
args -