Compare commits
	
		
			8 Commits 
		
	
	
		
			master
			...
			voting-boo
		
	
	| Author | SHA1 | Date | 
|---|---|---|
|  | 24d00a89fb | |
|  | ce2fe0e8f2 | |
|  | dadf301fcf | |
|  | 8ace24677b | |
|  | 95700f360e | |
|  | 9db8d8708a | |
|  | b9613ed693 | |
|  | 19a7d5731c | 
|  | @ -36,3 +36,5 @@ testem.log | ||||||
| bundle.js | bundle.js | ||||||
| bundle.d.ts | bundle.d.ts | ||||||
| 
 | 
 | ||||||
|  | /voting-booth-gui/meerkat_election_params_tempfile.dat | ||||||
|  | /voting-booth-gui/meerkat_booth_system_messages.dat | ||||||
|  |  | ||||||
|  | @ -3,5 +3,5 @@ distributionBase=GRADLE_USER_HOME | ||||||
| distributionPath=wrapper/dists | distributionPath=wrapper/dists | ||||||
| zipStoreBase=GRADLE_USER_HOME | zipStoreBase=GRADLE_USER_HOME | ||||||
| zipStorePath=wrapper/dists | zipStorePath=wrapper/dists | ||||||
| distributionUrl=https://services.gradle.org/distributions/gradle-4.2.1-all.zip | distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip | ||||||
| distributionSha256Sum=7897b59fb45148cd8a79f078e5e4cef3861a252dd1a1af729d0c6e8a0a8703a8 | distributionSha256Sum=a0af75d3d35799a90f56255a24de69c53cd9aea90f0b532586c8f818668e1734 | ||||||
|  |  | ||||||
|  | @ -0,0 +1 @@ | ||||||
|  | sdk.dir=C\:/Users/Laura/AppData/Local/Android/sdk | ||||||
|  | @ -81,6 +81,12 @@ message BallotSecrets { | ||||||
| 
 | 
 | ||||||
|     EncryptionRandomness encryption_randomness = 2; |     EncryptionRandomness encryption_randomness = 2; | ||||||
|     RandomnessGenerationProof proof = 3; |     RandomnessGenerationProof proof = 3; | ||||||
|  |     uint64 serial_number = 4; // Ballot serial number | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | message SignedBallotSecrets { | ||||||
|  |     BallotSecrets ballot_secrets = 1; | ||||||
|  |     Signature signature = 2; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| message BoothParams { | message BoothParams { | ||||||
|  |  | ||||||
|  | @ -15,7 +15,7 @@ For future compatibility, each ciphertext actually written to disk is encoded as | ||||||
| Ciphertexts are serialized using the [ElGamalCiphertext](concrete_crypto.proto) message, with fields "c1" and "c2" for the first and second group elements. | Ciphertexts are serialized using the [ElGamalCiphertext](concrete_crypto.proto) message, with fields "c1" and "c2" for the first and second group elements. | ||||||
| 
 | 
 | ||||||
| ### EC Group elements | ### EC Group elements | ||||||
| Group elements use the [GroupElement](concrete_crypto.proto) message. Its only field is "data", which should be an ASN.1-encoded curve point with compression (see section 4.3.6 of  [X9.62-1998](https://www.security-audit.com/files/x9-62-09-20-98.pdf) "Public Key Cryptography For The Financial Services Industry: The Elliptic Curve Digital  Signature Algorithm (ECDSA)") | Group elements use the [GroupElement](concrete_crypto.proto) message. It's only field is "data", which should be an ASN.1-encoded curve point with compression (see section 4.3.6 of  [X9.62-1998](https://www.security-audit.com/files/x9-62-09-20-98.pdf) "Public Key Cryptography For The Financial Services Industry: The Elliptic Curve Digital  Signature Algorithm (ECDSA)") | ||||||
| 
 | 
 | ||||||
| ### EC-ElGamal Key Format | ### EC-ElGamal Key Format | ||||||
| The ECElGamal Key is stored in the [ElGamalPublicKey](concrete_crypto.proto) message that contains a standard DER-encoded SubjectPublicKeyInfo as in [RFC 3279](https://tools.ietf.org/html/rfc3279)  (note that this encoding includes the elliptic-curve group parameters). | The ECElGamal Key is stored in the [ElGamalPublicKey](concrete_crypto.proto) message that contains a standard DER-encoded SubjectPublicKeyInfo as in [RFC 3279](https://tools.ietf.org/html/rfc3279)  (note that this encoding includes the elliptic-curve group parameters). | ||||||
|  |  | ||||||
|  | @ -41,6 +41,11 @@ message ScannedBallot { | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | //Container for auditing messages | ||||||
|  | message ScannedAudit { | ||||||
|  |     SignedBallotSecrets signed_ballot_secrets = 1; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| // Container for error messages | // Container for error messages | ||||||
| message ScanError { | message ScanError { | ||||||
|     string msg = 1; |     string msg = 1; | ||||||
|  | @ -49,12 +54,14 @@ message ScanError { | ||||||
| 
 | 
 | ||||||
| // Container for scanned data | // Container for scanned data | ||||||
| message ScannedData { | message ScannedData { | ||||||
|  |     uint64 serial = 1; // Serial number of the message | ||||||
|  |     bytes scannerId = 2; // hash of the scannerPK | ||||||
|     oneof data { |     oneof data { | ||||||
|         ScannedBallot ballot = 2; |         ScannedBallot ballot = 3; | ||||||
|         ScanError error = 3; |         ScanError error = 4; | ||||||
|  |         ScannedAudit audit_ballot = 5; | ||||||
|     } |     } | ||||||
|     uint64 serial = 4; // Serial number of the message | 
 | ||||||
|     bytes scannerId = 5; // hash of the scannerPK |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| message SignedScannedData { | message SignedScannedData { | ||||||
|  |  | ||||||
|  | @ -31,8 +31,8 @@ public class ChannelChoiceController { | ||||||
|     String questionText; |     String questionText; | ||||||
| 
 | 
 | ||||||
|     @FXML ToggleGroup answerGroup; |     @FXML ToggleGroup answerGroup; | ||||||
|     @FXML private Text question; | //    @FXML private Text question;
 | ||||||
|     @FXML private Text warningMsg; | //    @FXML private Text warningMsg;
 | ||||||
|     @FXML private Pane questionPane; |     @FXML private Pane questionPane; | ||||||
| 
 | 
 | ||||||
|     @FXML |     @FXML | ||||||
|  | @ -72,13 +72,17 @@ public class ChannelChoiceController { | ||||||
| 
 | 
 | ||||||
|     private void showCodeSelection() { |     private void showCodeSelection() { | ||||||
|         questionText = "Here we show code pad."; |         questionText = "Here we show code pad."; | ||||||
|         question.setText(questionText); |         questionPane.getChildren().clear(); | ||||||
|  |         Text txt = new Text(); | ||||||
|  |         questionPane.getChildren().add(txt); | ||||||
|  |         txt.setText(questionText); | ||||||
|  | //        question.setText(questionText);
 | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     private void showQuestion() { |     private void showQuestion() { | ||||||
|             Voting.BallotQuestion ballotQuestion = questions.get(index); |             Voting.BallotQuestion ballotQuestion = questions.get(index); | ||||||
|             questionText = "Please answer this question before voting:"; |             questionText = "Please answer this question before voting:"; | ||||||
|             question.setText(questionText); | //            question.setText(questionText);
 | ||||||
|             answerGroup.getToggles().clear(); |             answerGroup.getToggles().clear(); | ||||||
|             VBox vbox = VistaNavigator.uiThread.showQuestionInFX(ballotQuestion, answerGroup); |             VBox vbox = VistaNavigator.uiThread.showQuestionInFX(ballotQuestion, answerGroup); | ||||||
|             questionPane.getChildren().clear(); |             questionPane.getChildren().clear(); | ||||||
|  | @ -87,8 +91,10 @@ public class ChannelChoiceController { | ||||||
| 
 | 
 | ||||||
|     private void showError() { |     private void showError() { | ||||||
|         questionText = "There was an error reading the channel, please go back to polling station."; |         questionText = "There was an error reading the channel, please go back to polling station."; | ||||||
|         question.setText(questionText); | //        question.setText(questionText);
 | ||||||
| 
 |         questionPane.getChildren().clear(); | ||||||
|  |         Text txt = new Text(); | ||||||
|  |         questionPane.getChildren().add(txt); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @FXML |     @FXML | ||||||
|  | @ -97,6 +103,8 @@ public class ChannelChoiceController { | ||||||
|             String s = answerGroup.getSelectedToggle().getUserData().toString(); |             String s = answerGroup.getSelectedToggle().getUserData().toString(); | ||||||
|             answers.add(UIUtils.translateStringAnswerToProtoBufMessageAnswer(s)); |             answers.add(UIUtils.translateStringAnswerToProtoBufMessageAnswer(s)); | ||||||
|         } else { |         } else { | ||||||
|  |             Text warningMsg = new Text(); | ||||||
|  |             questionPane.getChildren().add(0,warningMsg); | ||||||
|             warningMsg.setText("(Please give an answer to continue)"); |             warningMsg.setText("(Please give an answer to continue)"); | ||||||
|         } |         } | ||||||
|         if (answers.size()!=0) { |         if (answers.size()!=0) { | ||||||
|  |  | ||||||
|  | @ -4,9 +4,14 @@ package meerkat.voting.gui.controllersFX; | ||||||
|  * Created by Laura on 12/16/2016. |  * Created by Laura on 12/16/2016. | ||||||
|  */ |  */ | ||||||
| import javafx.fxml.FXML; | import javafx.fxml.FXML; | ||||||
|  | import javafx.geometry.Insets; | ||||||
| import javafx.scene.Node; | import javafx.scene.Node; | ||||||
| import javafx.scene.Parent; | import javafx.scene.Parent; | ||||||
|  | import javafx.scene.layout.Background; | ||||||
|  | import javafx.scene.layout.BackgroundFill; | ||||||
|  | import javafx.scene.layout.CornerRadii; | ||||||
| import javafx.scene.layout.StackPane; | import javafx.scene.layout.StackPane; | ||||||
|  | import javafx.scene.paint.Color; | ||||||
| import meerkat.protobuf.Voting; | import meerkat.protobuf.Voting; | ||||||
| import meerkat.voting.controller.callbacks.VoterCancelThrowable; | import meerkat.voting.controller.callbacks.VoterCancelThrowable; | ||||||
| import meerkat.voting.gui.ui.CommandPend; | import meerkat.voting.gui.ui.CommandPend; | ||||||
|  | @ -38,6 +43,7 @@ public class MainController { | ||||||
|      * @param node the vista node to be swapped in. |      * @param node the vista node to be swapped in. | ||||||
|      */ |      */ | ||||||
|     public void setVista(Node node) { |     public void setVista(Node node) { | ||||||
|  | //        vistaHolder.setBackground(new Background(new BackgroundFill(Color.web("#D1B6E1"), CornerRadii.EMPTY, Insets.EMPTY)));
 | ||||||
|         vistaHolder.getChildren().setAll(node); |         vistaHolder.getChildren().setAll(node); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -6,16 +6,19 @@ package meerkat.voting.gui.controllersFX; | ||||||
| import javafx.embed.swing.SwingFXUtils; | import javafx.embed.swing.SwingFXUtils; | ||||||
| import javafx.fxml.FXML; | import javafx.fxml.FXML; | ||||||
| import javafx.scene.Node; | import javafx.scene.Node; | ||||||
|  | import javafx.scene.control.*; | ||||||
| import javafx.scene.control.Label; | import javafx.scene.control.Label; | ||||||
| import javafx.scene.image.Image; | import javafx.scene.image.Image; | ||||||
| import javafx.scene.image.ImageView; | import javafx.scene.image.ImageView; | ||||||
| import javafx.scene.layout.StackPane; | import javafx.scene.layout.StackPane; | ||||||
| import javafx.scene.layout.VBox; | import javafx.scene.layout.VBox; | ||||||
|  | import javafx.scene.control.ScrollPane; | ||||||
| import javafx.scene.text.Text; | import javafx.scene.text.Text; | ||||||
| import meerkat.voting.gui.ui.CommandPend; | import meerkat.voting.gui.ui.CommandPend; | ||||||
| import meerkat.voting.gui.ui.uicommands.UICommand; | import meerkat.voting.gui.ui.uicommands.UICommand; | ||||||
| 
 | 
 | ||||||
| import javax.imageio.ImageIO; | import javax.imageio.ImageIO; | ||||||
|  | import java.awt.*; | ||||||
| import java.awt.image.BufferedImage; | import java.awt.image.BufferedImage; | ||||||
| import java.io.IOException; | import java.io.IOException; | ||||||
| import java.io.InputStream; | import java.io.InputStream; | ||||||
|  | @ -26,10 +29,9 @@ import java.io.InputStream; | ||||||
| public class PrinterController { | public class PrinterController { | ||||||
| 
 | 
 | ||||||
|     /** Holder of vista. */ |     /** Holder of vista. */ | ||||||
|     @FXML |     @FXML private VBox vBox; | ||||||
|     private VBox vBox; |     @FXML private ScrollPane scrollPane; | ||||||
|     @FXML |     @FXML private Text content; | ||||||
|     private Text content; |  | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|     public void clean() { |     public void clean() { | ||||||
|  | @ -40,6 +42,7 @@ public class PrinterController { | ||||||
|         Text txt = new Text(s); |         Text txt = new Text(s); | ||||||
|         vBox.getChildren().add(txt); |         vBox.getChildren().add(txt); | ||||||
|         vBox.getScene().getWindow().sizeToScene(); |         vBox.getScene().getWindow().sizeToScene(); | ||||||
|  |         adjustScrolling(vBox); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     public void addContent(BufferedImage i) { |     public void addContent(BufferedImage i) { | ||||||
|  | @ -50,6 +53,20 @@ public class PrinterController { | ||||||
| //        String old_content = content.getText();
 | //        String old_content = content.getText();
 | ||||||
| //        content.setText(old_content+"\n"+s);
 | //        content.setText(old_content+"\n"+s);
 | ||||||
|         vBox.getScene().getWindow().sizeToScene(); |         vBox.getScene().getWindow().sizeToScene(); | ||||||
|  |         adjustScrolling(vBox); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     private void adjustScrolling(VBox content) { | ||||||
|  |         scrollPane.setContent(content); | ||||||
|  |         scrollPane.setFitToHeight(true); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public void addSeparator() { | ||||||
|  |         Separator sep = new Separator(); | ||||||
|  |         sep.setMaxWidth(vBox.getPrefWidth()); | ||||||
|  |         vBox.getChildren().add(sep); | ||||||
|  |         adjustScrolling(vBox); | ||||||
|  | 
 | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
|  | @ -170,6 +170,19 @@ public class VistaNavigator { | ||||||
|         ); |         ); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     /** | ||||||
|  |      * Prints an horizontal separator into the printer application layout. | ||||||
|  |      */ | ||||||
|  |     public static void printFXSeparator() { | ||||||
|  |         Platform.runLater(new Runnable() { | ||||||
|  |                               @Override | ||||||
|  |                               public void run() { | ||||||
|  |                                   printerController.addSeparator(); | ||||||
|  |                               } | ||||||
|  |                           } | ||||||
|  |         ); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     /** |     /** | ||||||
|      * Loads the 'LOADING' vista |      * Loads the 'LOADING' vista | ||||||
|      * vistaHolder pane of the main application layout. |      * vistaHolder pane of the main application layout. | ||||||
|  |  | ||||||
|  | @ -1,11 +1,21 @@ | ||||||
| package meerkat.voting.gui.controllersFX; | package meerkat.voting.gui.controllersFX; | ||||||
| 
 | 
 | ||||||
| import javafx.fxml.FXML; | import javafx.fxml.FXML; | ||||||
|  | import javafx.geometry.HPos; | ||||||
|  | import javafx.geometry.Pos; | ||||||
|  | import javafx.scene.control.Button; | ||||||
|  | import javafx.scene.control.ScrollPane; | ||||||
|  | import javafx.scene.control.Separator; | ||||||
| import javafx.scene.control.ToggleGroup; | import javafx.scene.control.ToggleGroup; | ||||||
|  | import javafx.scene.layout.HBox; | ||||||
| import javafx.scene.layout.Pane; | import javafx.scene.layout.Pane; | ||||||
| import javafx.scene.layout.VBox; | import javafx.scene.layout.VBox; | ||||||
|  | import javafx.scene.text.Font; | ||||||
|  | import javafx.scene.text.FontWeight; | ||||||
| import javafx.scene.text.Text; | import javafx.scene.text.Text; | ||||||
|  | import javafx.scene.text.TextAlignment; | ||||||
| import meerkat.protobuf.Voting; | import meerkat.protobuf.Voting; | ||||||
|  | import meerkat.voting.VotingBooth; | ||||||
| import meerkat.voting.controller.callbacks.VoterCancelThrowable; | import meerkat.voting.controller.callbacks.VoterCancelThrowable; | ||||||
| import meerkat.voting.gui.ui.UIUtils; | import meerkat.voting.gui.ui.UIUtils; | ||||||
| import meerkat.voting.gui.ui.uicommands.RaceVotingUICommand; | import meerkat.voting.gui.ui.uicommands.RaceVotingUICommand; | ||||||
|  | @ -31,13 +41,16 @@ public class VotingController { | ||||||
|     RaceVotingUICommand command = (RaceVotingUICommand) VistaNavigator.getCurrentCommand(); |     RaceVotingUICommand command = (RaceVotingUICommand) VistaNavigator.getCurrentCommand(); | ||||||
| 
 | 
 | ||||||
|     @FXML ToggleGroup answerGroup; |     @FXML ToggleGroup answerGroup; | ||||||
|     @FXML private Text question; |     @FXML private Text currentPage; | ||||||
|     @FXML private Pane questionPane; |     @FXML private Text totalPage; | ||||||
|  |     @FXML private ScrollPane questionPane; | ||||||
|  |     @FXML private Button nextButton; | ||||||
| 
 | 
 | ||||||
|     @FXML |     @FXML | ||||||
|     public void initialize() { |     public void initialize() { | ||||||
|         questions = command.getQuestions(); |         questions = command.getQuestions(); | ||||||
|         answerGroup = new ToggleGroup(); |         answerGroup = new ToggleGroup(); | ||||||
|  |         totalPage.setText(""+(questions.size()+1)); | ||||||
|         showQuestion(); |         showQuestion(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | @ -53,23 +66,70 @@ public class VotingController { | ||||||
|             answers.add(UIUtils.translateStringAnswerToProtoBufMessageAnswer(s)); |             answers.add(UIUtils.translateStringAnswerToProtoBufMessageAnswer(s)); | ||||||
|             index++; |             index++; | ||||||
|         } |         } | ||||||
|  |         if (nextButton.getText().equals("Confirm")) { | ||||||
|  |             index++; | ||||||
|  |         } | ||||||
|         if (index < questions.size()) { |         if (index < questions.size()) { | ||||||
|             showQuestion(); |             showQuestion(); | ||||||
|  |         } else { | ||||||
|  |             if (index == questions.size()) { | ||||||
|  |                 showSummary(); | ||||||
|             } else { |             } else { | ||||||
|                 //return answers to main threads
 |                 //return answers to main threads
 | ||||||
|                 nextPane(); |                 nextPane(); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  |     } | ||||||
| 
 | 
 | ||||||
|     private void showQuestion() { |     private void showQuestion() { | ||||||
|             Voting.BallotQuestion ballotQuestion = questions.get(index); |             Voting.BallotQuestion ballotQuestion = questions.get(index); | ||||||
|             question.setText("This is question n. "+index); |             //question.setText("This is question n. "+index);
 | ||||||
|  |             currentPage.setText("Page "+(index+1)); | ||||||
|             answerGroup.getToggles().clear(); |             answerGroup.getToggles().clear(); | ||||||
|             VBox vbox = VistaNavigator.uiThread.showQuestionInFX(ballotQuestion, answerGroup); |             VBox vbox = VistaNavigator.uiThread.showQuestionInFX(ballotQuestion, answerGroup); | ||||||
|             questionPane.getChildren().clear(); |             nextButton.setText("Next"); | ||||||
|             questionPane.getChildren().addAll(vbox); |             questionPane.setContent(vbox); | ||||||
|  |             questionPane.setFitToHeight(true); | ||||||
|  |             //questionPane.getChildren().clear();
 | ||||||
|  | //            questionPane.getChildren().addAll(vbox);
 | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     private void showSummary() { | ||||||
|  | //        Voting.BallotQuestion ballotQuestion = questions.get(index);
 | ||||||
|  |         currentPage.setText("Page "+(index+1)); | ||||||
|  |         answerGroup.getToggles().clear(); | ||||||
|  |         VBox vbox = new VBox();//VistaNavigator.uiThread.showQuestionInFX(ballotQuestion, answerGroup);
 | ||||||
|  |         vbox.setPrefWidth(questionPane.getPrefWidth()-30); | ||||||
|  |         /*Set title of summary*/ | ||||||
|  |         Text title = new Text("Almost done!"); | ||||||
|  |         title.setFont(Font.font("System", FontWeight.BOLD, 24)); | ||||||
|  |         vbox.getChildren().add(title); | ||||||
|  |         /*Set subtitle of summary*/ | ||||||
|  |         Text subtitle = new Text("Review your selections. If you are satisfied, press confirm."); | ||||||
|  |         subtitle.setFont(Font.font("System", FontWeight.BOLD, 18)); | ||||||
|  |         subtitle.setStyle("-fx-margin: 0 0 70 0;"); | ||||||
|  |         vbox.getChildren().add(subtitle); | ||||||
|  |         /*Create summery*/ | ||||||
|  |         for (int i=0; i<questions.size(); i++) { | ||||||
|  |             String qst = UIUtils.bytesToString(questions.get(i).getQuestion().getData()); | ||||||
|  |             int a_i = (int) answers.get(i).getAnswer(0); | ||||||
|  |             String ans = UIUtils.bytesToString(questions.get(i).getAnswer(a_i-1).getData()); | ||||||
|  |             Text qst_txt = new Text((i+1)+". "+qst); | ||||||
|  |             Text ans_txt = new Text(ans); | ||||||
|  |             Separator sep = new Separator(); | ||||||
|  |             sep.setMaxWidth(vbox.getPrefWidth()); | ||||||
|  |             vbox.getChildren().add(sep); | ||||||
|  |             vbox.getChildren().add(qst_txt); | ||||||
|  |             vbox.getChildren().add(ans_txt); | ||||||
|  |         } | ||||||
|  |         vbox.setAlignment(Pos.CENTER); | ||||||
|  |         nextButton.setText("Confirm"); | ||||||
|  |         questionPane.setContent(vbox); | ||||||
|  |         questionPane.setFitToHeight(true); | ||||||
|  | 
 | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|     @FXML |     @FXML | ||||||
|     private void goBack() throws VoterCancelThrowable{ |     private void goBack() throws VoterCancelThrowable{ | ||||||
|         if (index == 0) { |         if (index == 0) { | ||||||
|  |  | ||||||
|  | @ -6,11 +6,9 @@ import com.google.zxing.WriterException; | ||||||
| import meerkat.protobuf.Crypto.EncryptionRandomness; | import meerkat.protobuf.Crypto.EncryptionRandomness; | ||||||
| import meerkat.protobuf.Crypto.RandomnessGenerationProof; | import meerkat.protobuf.Crypto.RandomnessGenerationProof; | ||||||
| import meerkat.protobuf.PollingStation; | import meerkat.protobuf.PollingStation; | ||||||
| import meerkat.protobuf.PollingStation.ScannedData; | import meerkat.protobuf.Voting; | ||||||
| import meerkat.protobuf.Voting.BallotSecrets; | import meerkat.protobuf.Voting.BallotSecrets; | ||||||
| import meerkat.protobuf.Voting.PlaintextBallot; | import meerkat.protobuf.Voting.PlaintextBallot; | ||||||
| import meerkat.protobuf.Voting.SignedEncryptedBallot; |  | ||||||
| import meerkat.rest.Constants; |  | ||||||
| import meerkat.voting.gui.controllersFX.VistaNavigator; | import meerkat.voting.gui.controllersFX.VistaNavigator; | ||||||
| import meerkat.voting.output.AsyncRunnableOutputDevice; | import meerkat.voting.output.AsyncRunnableOutputDevice; | ||||||
| import meerkat.voting.output.outputcommands.AuditOutputCommand; | import meerkat.voting.output.outputcommands.AuditOutputCommand; | ||||||
|  | @ -20,7 +18,6 @@ import meerkat.voting.output.outputcommands.CommitOutputCommand; | ||||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||||
| 
 | 
 | ||||||
| import javax.ws.rs.client.Entity; |  | ||||||
| import java.awt.image.BufferedImage; | import java.awt.image.BufferedImage; | ||||||
| import java.io.IOException; | import java.io.IOException; | ||||||
| import java.util.Base64; | import java.util.Base64; | ||||||
|  | @ -49,7 +46,7 @@ public class FXWindowOutputDevice extends AsyncRunnableOutputDevice { | ||||||
|         ByteString channel = command.getChannelIdentifierByteString(); |         ByteString channel = command.getChannelIdentifierByteString(); | ||||||
|         printPlainText(plaintextBallot, channel); |         printPlainText(plaintextBallot, channel); | ||||||
| 
 | 
 | ||||||
|         printEncryptedText(plaintextBallot, command); |         printCommitBallot(plaintextBallot, command); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -60,11 +57,11 @@ public class FXWindowOutputDevice extends AsyncRunnableOutputDevice { | ||||||
|      */ |      */ | ||||||
|     public void doAudit(AuditOutputCommand command) { |     public void doAudit(AuditOutputCommand command) { | ||||||
|         logger.debug("entered method doAudit"); |         logger.debug("entered method doAudit"); | ||||||
|         String msg = "Auditing"; |         VistaNavigator.printFXSeparator(); | ||||||
|         VistaNavigator.printFX(msg); |  | ||||||
|         BallotSecrets ballotSecrets = command.getBallotSecrets(); |         BallotSecrets ballotSecrets = command.getBallotSecrets(); | ||||||
|         printEncryptionRandomness(ballotSecrets.getEncryptionRandomness()); | //        printEncryptionRandomness(ballotSecrets.getEncryptionRandomness());
 | ||||||
|         printRandomnessGenerationProof (ballotSecrets.getProof()); | //        printRandomnessGenerationProof (ballotSecrets.getProof());
 | ||||||
|  |         printAuditBallot(ballotSecrets); | ||||||
|         command.getCallback().onSuccess(null); |         command.getCallback().onSuccess(null); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | @ -105,19 +102,15 @@ public class FXWindowOutputDevice extends AsyncRunnableOutputDevice { | ||||||
|         VistaNavigator.printFX(toPrint); |         VistaNavigator.printFX(toPrint); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     private void printEncryptedText(PlaintextBallot plaintextBallot, CommitOutputCommand command) { |     private void printCommitBallot(PlaintextBallot plaintextBallot, CommitOutputCommand command) { | ||||||
|         String encryptedText; |  | ||||||
|         SignedEncryptedBallot signedEncryptedBallot = command.getSignedEncryptedBallot(); |  | ||||||
|         long encryptedSerialNumber = signedEncryptedBallot.getEncryptedBallot().getSerialNumber(); |  | ||||||
|         long plaintextSerialNumber = plaintextBallot.getSerialNumber(); |  | ||||||
| 
 |  | ||||||
|         String toPrint = ""; |         String toPrint = ""; | ||||||
|         toPrint+="Commitment of Ballot #" + encryptedSerialNumber + " (ciphertext):"; |         toPrint+="Commitment of Ballot #" + command.getSignedEncryptedBallot().getEncryptedBallot().getSerialNumber() + " (ciphertext):"; | ||||||
|         toPrint+="\n"; |         toPrint+="\n"; | ||||||
|         VistaNavigator.printFX(toPrint); |         VistaNavigator.printFX(toPrint); | ||||||
|         if (plaintextSerialNumber != encryptedSerialNumber) { | 
 | ||||||
|  |         if (plaintextBallot.getSerialNumber() != command.getSignedEncryptedBallot().getEncryptedBallot().getSerialNumber()) { | ||||||
|             logger.error("plaintext and encryption serial numbers do not match!! plaintext# = " + |             logger.error("plaintext and encryption serial numbers do not match!! plaintext# = " + | ||||||
|                     plaintextSerialNumber + ", ciphertext# = " + encryptedSerialNumber); |                     plaintextBallot.getSerialNumber() + ", ciphertext# = " + command.getSignedEncryptedBallot().getEncryptedBallot().getSerialNumber()); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         PollingStation.ScannedBallot scannedBallot = PollingStation.ScannedBallot.newBuilder() |         PollingStation.ScannedBallot scannedBallot = PollingStation.ScannedBallot.newBuilder() | ||||||
|  | @ -125,15 +118,15 @@ public class FXWindowOutputDevice extends AsyncRunnableOutputDevice { | ||||||
|                 .setSignedEncryptedBallot(command.getSignedEncryptedBallot()) |                 .setSignedEncryptedBallot(command.getSignedEncryptedBallot()) | ||||||
|                 .build(); |                 .build(); | ||||||
| 
 | 
 | ||||||
|         System.out.println(scannedBallot.getSerializedSize()); |         logger.info("ScannedBallot serialized size: "+scannedBallot.getSerializedSize()); | ||||||
|         encryptedText = Base64.getEncoder().encodeToString(scannedBallot.toByteArray()); |         String encryptedText = Base64.getEncoder().encodeToString(scannedBallot.toByteArray()); | ||||||
| 
 | 
 | ||||||
|         try { |         try { | ||||||
|             PollingStation.ScannedBallot result = PollingStation.ScannedBallot.parseFrom(Base64.getDecoder().decode(encryptedText.getBytes())); |             PollingStation.ScannedBallot result = PollingStation.ScannedBallot.parseFrom(Base64.getDecoder().decode(encryptedText.getBytes())); | ||||||
|             System.out.println(result.getChannel()); |             System.out.println(result.getChannel()); | ||||||
|             System.out.println(command.getChannelIdentifierByteString()); |             System.out.println(command.getChannelIdentifierByteString()); | ||||||
|         } catch (InvalidProtocolBufferException e) { |         } catch (InvalidProtocolBufferException e) { | ||||||
|             e.printStackTrace(); |             command.getCallback().onFailure(e); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         try { |         try { | ||||||
|  | @ -147,10 +140,43 @@ public class FXWindowOutputDevice extends AsyncRunnableOutputDevice { | ||||||
| 
 | 
 | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     private void printQRCode(String toQRCode, int size) throws IOException, WriterException { |     private void printAuditBallot(BallotSecrets ballotSecrets) { | ||||||
|         BufferedImage image = null; |         String toPrint = ""; | ||||||
|         image = GenerateQRCode.createQRImage(toQRCode, size); |         toPrint+="Audit of Ballot";// + command.getSignedEncryptedBallot().getEncryptedBallot().getSerialNumber() + " (ciphertext):";
 | ||||||
|         VistaNavigator.printFX(image); |         toPrint+="\n"; | ||||||
|  |         VistaNavigator.printFX(toPrint); | ||||||
|  | 
 | ||||||
|  |         //generate the PollingStation.<protobuf> corresponding to [ballotID, plaintext, randomness, Signed(ballotID, plaintext, randomness)]
 | ||||||
|  |         PollingStation.ScannedAudit scannedAudit = PollingStation.ScannedAudit.newBuilder() | ||||||
|  |                 .setSignedBallotSecrets(ballotSecrets); | ||||||
|  | //        PollingStation.ScannedBallot scannedBallot = PollingStation.ScannedBallot.newBuilder()
 | ||||||
|  | //                .setChannel(command.getChannelIdentifierByteString())
 | ||||||
|  | //                .setSignedEncryptedBallot(command.getSignedEncryptedBallot())
 | ||||||
|  | //                .build();
 | ||||||
|  | 
 | ||||||
|  |         //encode to String
 | ||||||
|  | //        logger.info("ScannedAudit serialized size: "+scannedBallot.getSerializedSize());
 | ||||||
|  | //        String auditText = Base64.getEncoder().encodeToString(scannedBallot.toByteArray());
 | ||||||
|  | 
 | ||||||
|  |         //check that decoding encoded gives same as original
 | ||||||
|  | //        try {
 | ||||||
|  | //            PollingStation.ScannedBallot result = PollingStation.ScannedBallot.parseFrom(Base64.getDecoder().decode(auditText.getBytes()));
 | ||||||
|  | //            System.out.println(result.getChannel());
 | ||||||
|  | //            System.out.println(command.getChannelIdentifierByteString());
 | ||||||
|  | //        } catch (InvalidProtocolBufferException e) {
 | ||||||
|  | //            command.getCallback().onFailure(e);
 | ||||||
|  | //        }
 | ||||||
|  | 
 | ||||||
|  |         //print to FX
 | ||||||
|  | //        try {
 | ||||||
|  | //            printQRCode(auditText, 250);
 | ||||||
|  | //            command.getCallback().onSuccess(null);
 | ||||||
|  | //        } catch (IOException e) {
 | ||||||
|  | //            command.getCallback().onFailure(e);
 | ||||||
|  | //        } catch (WriterException e) {
 | ||||||
|  | //            command.getCallback().onFailure(e);
 | ||||||
|  | //        }
 | ||||||
|  | 
 | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     private void printEncryptionRandomness (EncryptionRandomness encryptionRandomness) { |     private void printEncryptionRandomness (EncryptionRandomness encryptionRandomness) { | ||||||
|  | @ -167,6 +193,16 @@ public class FXWindowOutputDevice extends AsyncRunnableOutputDevice { | ||||||
|         VistaNavigator.printFX(msg); |         VistaNavigator.printFX(msg); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     /** | ||||||
|  |      * Creates an image of the QRcode with the String toQRCode in it and displays it to the virtual printer (FX window) | ||||||
|  |      * @param toQRCode a String that contains the text to encode into the QRcode | ||||||
|  |      * @param size the size of the QRcode (we use 250 for testing) | ||||||
|  |      */ | ||||||
|  |     private void printQRCode(String toQRCode, int size) throws IOException, WriterException { | ||||||
|  |         BufferedImage image = null; | ||||||
|  |         image = GenerateQRCode.createQRImage(toQRCode, size); | ||||||
|  |         VistaNavigator.printFX(image); | ||||||
|  |     } | ||||||
| 
 | 
 | ||||||
|     /* |     /* | ||||||
|      * Returns the UTF8 decoding of byte-string data |      * Returns the UTF8 decoding of byte-string data | ||||||
|  |  | ||||||
|  | @ -2,13 +2,10 @@ | ||||||
| 
 | 
 | ||||||
| <?import javafx.scene.control.Button?> | <?import javafx.scene.control.Button?> | ||||||
| <?import javafx.scene.layout.Pane?> | <?import javafx.scene.layout.Pane?> | ||||||
| <?import javafx.scene.text.Text?> |  | ||||||
| 
 | 
 | ||||||
| <Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.112" xmlns:fx="http://javafx.com/fxml/1" fx:controller="meerkat.voting.gui.controllersFX.ChannelChoiceController"> | <Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.112" xmlns:fx="http://javafx.com/fxml/1" fx:controller="meerkat.voting.gui.controllersFX.ChannelChoiceController"> | ||||||
|    <children> |    <children> | ||||||
|       <Button layoutX="469.0" layoutY="343.0" mnemonicParsing="false" onMousePressed="#nextPane" prefHeight="39.0" prefWidth="109.0" text="Next" /> |       <Button layoutX="469.0" layoutY="343.0" mnemonicParsing="false" onMousePressed="#nextPane" prefHeight="39.0" prefWidth="109.0" text="Next" /> | ||||||
|       <Text fx:id="question" layoutX="84.0" layoutY="89.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Channel selection:" wrappingWidth="431.3046875" /> |       <Pane fx:id="questionPane" layoutX="1.0" layoutY="-1.0" prefHeight="326.0" prefWidth="600.0" /> | ||||||
|       <Pane fx:id="questionPane" layoutX="84.0" layoutY="97.0" prefHeight="234.0" prefWidth="422.0" /> |  | ||||||
|       <Text fx:id="warningMsg" fill="#ee0909" layoutX="82.0" layoutY="64.0" strokeType="OUTSIDE" strokeWidth="0.0" wrappingWidth="431.3046875" /> |  | ||||||
|    </children> |    </children> | ||||||
| </Pane> | </Pane> | ||||||
|  |  | ||||||
|  | @ -6,7 +6,7 @@ | ||||||
| <?import javafx.scene.layout.VBox?> | <?import javafx.scene.layout.VBox?> | ||||||
| <?scenebuilder-stylesheet vista.css?> | <?scenebuilder-stylesheet vista.css?> | ||||||
| 
 | 
 | ||||||
| <VBox prefHeight="709.0" prefWidth="1259.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1" fx:controller="meerkat.voting.gui.controllersFX.MainController"> | <VBox prefHeight="709.0" prefWidth="1259.0" xmlns="http://javafx.com/javafx/8.0.112" xmlns:fx="http://javafx.com/fxml/1" fx:controller="meerkat.voting.gui.controllersFX.MainController"> | ||||||
|     <children> |     <children> | ||||||
|         <Label fx:id="headerLabel" maxWidth="1.7976931348623157E308" prefHeight="70.0" prefWidth="1162.0" text="Header of Election" textFill="#939090" VBox.vgrow="NEVER"> |         <Label fx:id="headerLabel" maxWidth="1.7976931348623157E308" prefHeight="70.0" prefWidth="1162.0" text="Header of Election" textFill="#939090" VBox.vgrow="NEVER"> | ||||||
|          <VBox.margin> |          <VBox.margin> | ||||||
|  | @ -15,6 +15,9 @@ | ||||||
|         <StackPane fx:id="vistaHolder" prefHeight="553.0" prefWidth="1259.0" VBox.vgrow="ALWAYS"> |         <StackPane fx:id="vistaHolder" prefHeight="553.0" prefWidth="1259.0" VBox.vgrow="ALWAYS"> | ||||||
|          <VBox.margin> |          <VBox.margin> | ||||||
|             <Insets bottom="70.0" /> |             <Insets bottom="70.0" /> | ||||||
|          </VBox.margin></StackPane> |          </VBox.margin> | ||||||
|  |          <padding> | ||||||
|  |             <Insets bottom="30.0" left="30.0" right="30.0" top="30.0" /> | ||||||
|  |          </padding></StackPane> | ||||||
|     </children> |     </children> | ||||||
| </VBox> | </VBox> | ||||||
|  |  | ||||||
|  | @ -1,10 +1,20 @@ | ||||||
| <?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||||||
| 
 | 
 | ||||||
|  | <?import javafx.scene.control.ScrollPane?> | ||||||
|  | <?import javafx.scene.layout.Pane?> | ||||||
| <?import javafx.scene.layout.VBox?> | <?import javafx.scene.layout.VBox?> | ||||||
| <?scenebuilder-stylesheet vista.css?> | <?scenebuilder-stylesheet vista.css?> | ||||||
| 
 | 
 | ||||||
| <VBox fx:id="vBox" prefHeight="200.0" prefWidth="350.0" style="-fx-background-color: white;" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1" fx:controller="meerkat.voting.gui.controllersFX.PrinterController"> | <Pane prefHeight="486.0" prefWidth="352.0" xmlns="http://javafx.com/javafx/8.0.112" xmlns:fx="http://javafx.com/fxml/1" fx:controller="meerkat.voting.gui.controllersFX.PrinterController"> | ||||||
|  |    <children> | ||||||
|  |       <ScrollPane fx:id="scrollPane" prefHeight="486.0" prefWidth="352.0"> | ||||||
|  |          <content> | ||||||
|  |             <VBox fx:id="vBox" prefHeight="479.0" prefWidth="350.0" style="-fx-background-color: white;"> | ||||||
|                 <children> |                 <children> | ||||||
| 
 | 
 | ||||||
|     </children> |     </children> | ||||||
| </VBox> |             </VBox> | ||||||
|  |          </content> | ||||||
|  |       </ScrollPane> | ||||||
|  |    </children> | ||||||
|  | </Pane> | ||||||
|  |  | ||||||
|  | @ -1,14 +1,22 @@ | ||||||
| <?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||||||
| 
 | 
 | ||||||
|  | <?import javafx.scene.Group?> | ||||||
| <?import javafx.scene.control.Button?> | <?import javafx.scene.control.Button?> | ||||||
|  | <?import javafx.scene.control.ScrollPane?> | ||||||
| <?import javafx.scene.layout.Pane?> | <?import javafx.scene.layout.Pane?> | ||||||
| <?import javafx.scene.text.Text?> | <?import javafx.scene.text.Text?> | ||||||
| 
 | 
 | ||||||
| <Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.112" xmlns:fx="http://javafx.com/fxml/1" fx:controller="meerkat.voting.gui.controllersFX.VotingController"> | <Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.112" xmlns:fx="http://javafx.com/fxml/1" fx:controller="meerkat.voting.gui.controllersFX.VotingController"> | ||||||
|    <children> |    <children> | ||||||
|       <Button layoutX="469.0" layoutY="343.0" mnemonicParsing="false" onMousePressed="#nextQuestion" text="Next" /> |       <Button fx:id="nextButton" layoutX="469.0" layoutY="343.0" mnemonicParsing="false" onMousePressed="#nextQuestion" text="Next" /> | ||||||
|       <Text fx:id="question" layoutX="84.0" layoutY="89.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Click 'Next' to see the first question." wrappingWidth="431.3046875" /> |       <Button layoutX="74.0" layoutY="343.0" mnemonicParsing="false" onMousePressed="#goBack" text="Back" /> | ||||||
|       <Pane fx:id="questionPane" layoutX="84.0" layoutY="97.0" prefHeight="234.0" prefWidth="422.0" /> |       <Group layoutX="220.0" layoutY="369.0"> | ||||||
|       <Button layoutX="84.0" layoutY="343.0" mnemonicParsing="false" onMousePressed="#goBack" text="Back" /> |          <children> | ||||||
|  |             <Text fx:id="currentPage" layoutX="-16.0" strokeType="OUTSIDE" strokeWidth="0.0" text="XXX" textAlignment="RIGHT" wrappingWidth="112.30468860268593" /> | ||||||
|  |             <Text fx:id="question111" layoutX="99.0" strokeType="OUTSIDE" strokeWidth="0.0" text="/" wrappingWidth="12.304688602685928" /> | ||||||
|  |             <Text fx:id="totalPage" layoutX="109.0" strokeType="OUTSIDE" strokeWidth="0.0" text="YYY" wrappingWidth="46.30468860268593" /> | ||||||
|  |          </children> | ||||||
|  |       </Group> | ||||||
|  |       <ScrollPane fx:id="questionPane" layoutY="1.0" prefHeight="322.0" prefWidth="600.0" /> | ||||||
|    </children> |    </children> | ||||||
| </Pane> | </Pane> | ||||||
|  |  | ||||||
|  | @ -1,104 +1,33 @@ | ||||||
| <?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||||||
| 
 | 
 | ||||||
| <?import javafx.scene.text.*?> | <?import javafx.geometry.Insets?> | ||||||
| <?import javafx.scene.control.*?> | <?import javafx.scene.control.Button?> | ||||||
| <?import java.lang.*?> | <?import javafx.scene.layout.AnchorPane?> | ||||||
| <?import javafx.scene.layout.*?> | <?import javafx.scene.layout.VBox?> | ||||||
|  | <?import javafx.scene.text.Font?> | ||||||
|  | <?import javafx.scene.text.Text?> | ||||||
| 
 | 
 | ||||||
| <GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="meerkat.voting.gui.controllersFX.WelcomeScreenController"> | 
 | ||||||
|   <columnConstraints> | <AnchorPane xmlns="http://javafx.com/javafx/8.0.112" xmlns:fx="http://javafx.com/fxml/1" fx:controller="meerkat.voting.gui.controllersFX.WelcomeScreenController"> | ||||||
|     <ColumnConstraints /> |  | ||||||
|       <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> |  | ||||||
|   </columnConstraints> |  | ||||||
|   <rowConstraints> |  | ||||||
|     <RowConstraints /> |  | ||||||
|     <RowConstraints maxHeight="129.0" minHeight="10.0" prefHeight="47.0" vgrow="SOMETIMES" /> |  | ||||||
|     <RowConstraints maxHeight="222.0" minHeight="10.0" prefHeight="201.0" vgrow="SOMETIMES" /> |  | ||||||
|       <RowConstraints maxHeight="170.0" minHeight="10.0" prefHeight="129.0" vgrow="SOMETIMES" /> |  | ||||||
|   </rowConstraints> |  | ||||||
|    <children> |    <children> | ||||||
|       <GridPane GridPane.columnIndex="1" GridPane.rowIndex="1"> |       <VBox alignment="CENTER" prefHeight="400.0" prefWidth="600.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> | ||||||
|         <columnConstraints> |  | ||||||
|           <ColumnConstraints hgrow="SOMETIMES" maxWidth="185.0" minWidth="10.0" prefWidth="185.0" /> |  | ||||||
|             <ColumnConstraints hgrow="SOMETIMES" maxWidth="334.0" minWidth="10.0" prefWidth="258.0" /> |  | ||||||
|           <ColumnConstraints hgrow="SOMETIMES" maxWidth="194.0" minWidth="10.0" prefWidth="124.0" /> |  | ||||||
|         </columnConstraints> |  | ||||||
|         <rowConstraints> |  | ||||||
|           <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> |  | ||||||
|         </rowConstraints> |  | ||||||
|          <children> |          <children> | ||||||
|             <BorderPane prefHeight="200.0" prefWidth="200.0"> |             <Text fx:id="electionName" strokeType="OUTSIDE" strokeWidth="0.0" text="Name of the Election" textAlignment="CENTER" wrappingWidth="343.205078125"> | ||||||
|                <center> |                <font> | ||||||
|                   <Label text="Organization Logo" BorderPane.alignment="CENTER" /> |                   <Font name="System Bold" size="24.0" /> | ||||||
|                </center> |                </font> | ||||||
|             </BorderPane> |             </Text> | ||||||
|             <BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="2"> |             <Text fx:id="electionLocation" layoutX="138.0" layoutY="191.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Location" textAlignment="CENTER" wrappingWidth="343.205078125"> | ||||||
|                <center> |                <VBox.margin> | ||||||
|                   <Label text="Date" BorderPane.alignment="CENTER" /> |                   <Insets bottom="70.0" /> | ||||||
|                </center> |                </VBox.margin> | ||||||
|             </BorderPane> |             </Text> | ||||||
|          </children> |             <Button mnemonicParsing="false" onMousePressed="#nextPane" prefHeight="51.0" prefWidth="214.0" text="Start Here"> | ||||||
|       </GridPane> |  | ||||||
|       <GridPane GridPane.columnIndex="1" GridPane.rowIndex="1"> |  | ||||||
|         <columnConstraints> |  | ||||||
|           <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> |  | ||||||
|         </columnConstraints> |  | ||||||
|         <rowConstraints> |  | ||||||
|           <RowConstraints maxHeight="74.0" minHeight="10.0" prefHeight="74.0" vgrow="SOMETIMES" /> |  | ||||||
|           <RowConstraints maxHeight="123.0" minHeight="10.0" prefHeight="93.0" vgrow="SOMETIMES" /> |  | ||||||
|           <RowConstraints maxHeight="59.0" minHeight="10.0" prefHeight="29.0" vgrow="SOMETIMES" /> |  | ||||||
|         </rowConstraints> |  | ||||||
|       </GridPane> |  | ||||||
|       <GridPane GridPane.columnIndex="1" GridPane.rowIndex="2"> |  | ||||||
|         <columnConstraints> |  | ||||||
|           <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> |  | ||||||
|         </columnConstraints> |  | ||||||
|         <rowConstraints> |  | ||||||
|           <RowConstraints maxHeight="75.0" minHeight="10.0" prefHeight="75.0" vgrow="SOMETIMES" /> |  | ||||||
|           <RowConstraints maxHeight="107.0" minHeight="10.0" prefHeight="107.0" vgrow="SOMETIMES" /> |  | ||||||
|           <RowConstraints maxHeight="56.0" minHeight="10.0" prefHeight="27.0" vgrow="SOMETIMES" /> |  | ||||||
|         </rowConstraints> |  | ||||||
|          <children> |  | ||||||
|             <BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.rowIndex="1"> |  | ||||||
|                <center> |  | ||||||
|                   <Button mnemonicParsing="false" onMousePressed="#nextPane" prefHeight="50.0" prefWidth="170.0" text="Start Here" BorderPane.alignment="CENTER"> |  | ||||||
|                <font> |                <font> | ||||||
|                   <Font size="24.0" /> |                   <Font size="24.0" /> | ||||||
|                </font> |                </font> | ||||||
|             </Button> |             </Button> | ||||||
|                </center> |  | ||||||
|             </BorderPane> |  | ||||||
|             <GridPane> |  | ||||||
|               <columnConstraints> |  | ||||||
|                 <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> |  | ||||||
|               </columnConstraints> |  | ||||||
|               <rowConstraints> |  | ||||||
|                 <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> |  | ||||||
|                 <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> |  | ||||||
|               </rowConstraints> |  | ||||||
|                <children> |  | ||||||
|                   <BorderPane prefHeight="200.0" prefWidth="200.0"> |  | ||||||
|                      <center> |  | ||||||
|                         <Label text="This is the name of the Election" BorderPane.alignment="CENTER"> |  | ||||||
|                            <font> |  | ||||||
|                               <Font size="18.0" /> |  | ||||||
|                            </font> |  | ||||||
|                         </Label> |  | ||||||
|                      </center> |  | ||||||
|                   </BorderPane> |  | ||||||
|                   <BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.rowIndex="1"> |  | ||||||
|                      <top> |  | ||||||
|                         <Label text="Location | Precinct" BorderPane.alignment="CENTER" /> |  | ||||||
|                      </top> |  | ||||||
|                   </BorderPane> |  | ||||||
|          </children> |          </children> | ||||||
|             </GridPane> |       </VBox> | ||||||
|    </children> |    </children> | ||||||
|       </GridPane> | </AnchorPane> | ||||||
|       <BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="3"> |  | ||||||
|          <center> |  | ||||||
|             <Label fx:id="ErrorPanel" maxHeight="30.0" maxWidth="500.0" minHeight="30.0" minWidth="500.0" prefHeight="30.0" prefWidth="500.0" BorderPane.alignment="CENTER" /> |  | ||||||
|          </center> |  | ||||||
|       </BorderPane> |  | ||||||
|    </children> |  | ||||||
| </GridPane> |  | ||||||
|  |  | ||||||
|  | @ -40,5 +40,5 @@ public interface VBCryptoManager { | ||||||
|     // TODO: do we seed the random here?
 |     // TODO: do we seed the random here?
 | ||||||
|     public EncryptionAndSecrets encrypt (PlaintextBallot plaintextBallot) throws SignatureException, IOException; |     public EncryptionAndSecrets encrypt (PlaintextBallot plaintextBallot) throws SignatureException, IOException; | ||||||
| 
 | 
 | ||||||
| 
 |     //TODO: Laura: there should be a method here to sign whatever I need to sign, no? Does it mean that I need to create a class for each type of thing I need to sign?
 | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue