Skip to content

Commit

Permalink
remove preview from compiler options.
Browse files Browse the repository at this point in the history
change manifest to election manifest in comments.
  • Loading branch information
JohnLCaron committed Aug 28, 2024
1 parent 425823b commit b5e1eef
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 26 deletions.
15 changes: 8 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ kotlin {
////////////////

tasks {
val ENABLE_PREVIEW = "--enable-preview"
//val ENABLE_PREVIEW = "--enable-preview"
withType<JavaCompile>() {
options.compilerArgs.add(ENABLE_PREVIEW)
//options.compilerArgs.add(ENABLE_PREVIEW)
// Optionally we can show which preview feature we use.
options.compilerArgs.add("-Xlint:preview")
//options.compilerArgs.add("-Xlint:preview")
// options.compilerArgs.add("--enable-native-access=org.openjdk.jextract")
// Explicitly setting compiler option --release
// is needed when we wouldn't set the
Expand All @@ -48,17 +48,18 @@ tasks {
useJUnitPlatform()
minHeapSize = "512m"
maxHeapSize = "8g"
jvmArgs = listOf("-Xss128m", "--enable-preview")
//jvmArgs = listOf("-Xss128m", "--enable-preview")
jvmArgs = listOf("-Xss128m")

// Make tests run in parallel
// More info: https://www.jvt.me/posts/2021/03/11/gradle-speed-parallel/
systemProperties["junit.jupiter.execution.parallel.enabled"] = "true"
systemProperties["junit.jupiter.execution.parallel.mode.default"] = "concurrent"
systemProperties["junit.jupiter.execution.parallel.mode.classes.default"] = "concurrent"
}
withType<JavaExec>().all {
jvmArgs("--enable-preview")
}
//withType<JavaExec>().all {
// jvmArgs("--enable-preview")
//}
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "17"
}
Expand Down
20 changes: 10 additions & 10 deletions docs/CommandLineInterface.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ last update 04/16/2024

<img src="./images/Workflow.svg" alt="Workflow" width="1200"/>

1. **Create a Manifest record**
1. Generating a real Manifest by election officials is outside the scope of this library. That is to say,
1. **Create an Election Manifest record**
1. Generating a real Election Manifest by election officials is outside the scope of this library. That is to say,
you must figure out what that looks like yourself, and use it as input to the library.
2. Create a manifest in code with the _org.cryptobiotic.eg.election.Manifest_ classes, and write it out
2. Create an election manifest in code with the _org.cryptobiotic.eg.election.Manifest_ classes, and write it out
with a Publisher.
3. Create a fake manifest for testing with [_RunCreateTestManifest_ CLI](#create-a-fake-election-manifest).
4. Use an existing fake manifest for testing in _src/commonTest/data/startManifest/manifest.json_.
3. Create a fake election manifest for testing with [_RunCreateTestManifest_ CLI](#create-a-fake-election-manifest).
4. Use an existing fake election manifest for testing in _src/commonTest/data/startManifest/manifest.json_.

2. **Create an ElectionConfig record**
1. Create an ElectionConfig record from a Manifest and configuration values using [_RunCreateElectionConfig_ CLI](#create-an-election-configuration)
1. Create an ElectionConfig record from an Election Manifest and configuration values using [_RunCreateElectionConfig_ CLI](#create-an-election-configuration)

3. **Run the KeyCeremony**
1. Create an ElectionInitialized record and decrypting trustees from an ElectionConfig by running a KeyCeremony with
Expand Down Expand Up @@ -99,7 +99,7 @@ Options:
--ncontests, -ncontests -> number of contests (always required) { Int }
--nselections, -nselections -> number of selections per contest (always required) { Int }
--outputType, -type [JSON] -> JSON or PROTO { String }
--outputDir, -out -> Directory to write test manifest file (always required) { String }
--outputDir, -out -> Directory to write test election manifest file (always required) { String }
--help, -h -> Usage info
````

Expand All @@ -118,7 +118,7 @@ java -classpath build/libs/egk-ec-2.1-SNAPSHOT-uber.jar \
````
Usage: RunCreateElectionConfig options_list
Options:
--electionManifest, -manifest -> Manifest file or directory (always required) { String }
--electionManifest, -manifest -> Election manifest file or directory (always required) { String }
--groupName, -group -> Group name ('P-256' or 'Integer4096') (always required) { String }
--nguardians, -nguardians -> number of guardians (always required) { Int }
--quorum, -quorum -> quorum size (always required) { Int }
Expand Down Expand Up @@ -176,10 +176,10 @@ java -classpath build/libs/egk-ec-2.1-SNAPSHOT-uber.jar \
````
Usage: RunCreateInputBallots options_list
Options:
--manifestDirOrFile, -manifest -> Manifest file or directory (always required) { String }
--manifestDirOrFile, -manifest -> Election manifest file or directory (always required) { String }
--outputDir, -out -> Directory to write plaintext ballots (always required) { String }
--nballots, -n [11] -> Number of ballots to generate { Int }
--isJson, -json -> Generate Json ballots (default to manifest type)
--isJson, -json -> Generate Json ballots (default to election manifest type)
--help, -h -> Usage info
````

Expand Down
2 changes: 1 addition & 1 deletion docs/InputValidation.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A specific validation is referenced as for example: Manifest.B.5, Ballot.A.2.1,

## Manifest

Manifest Validation can be run to catch problems while developing the Manifest.
Manifest Validation can be run to catch problems while developing the Election manifest.

Manifest Validation must be run when accepting Input Ballots to be encrypted.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class RunCreateElectionConfig {
val electionManifest by parser.option(
ArgType.String,
shortName = "manifest",
description = "Manifest file or directory"
description = "Election manifest file or directory"
).required()
val groupName by parser.option(
ArgType.String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class RunCreateInputBallots {
val manifestDirOrFile by parser.option(
ArgType.String,
shortName = "manifest",
description = "Manifest file or directory"
description = "Election manifest file or directory"
).required()
val outputDir by parser.option(
ArgType.String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class RunCreateTestManifest {
val outputDir by parser.option(
ArgType.String,
shortName = "out",
description = "Directory to write test manifest file"
description = "Directory to write test election manifest file"
).required()
val noexit by parser.option(
ArgType.Boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class RunShowElectionRecord {

fun show(manifest: Manifest, details: Boolean, wantBallotStyle: String?=null): String {
return buildString {
appendLine("\nManifest scopeId=${manifest.electionScopeId} type=${manifest.electionType} spec=${manifest.specVersion}")
appendLine("\nElection Manifest scopeId=${manifest.electionScopeId} type=${manifest.electionType} spec=${manifest.specVersion}")
appendLine(" gpus: ${manifest.geopoliticalUnits}")
if (wantBallotStyle == null) {
appendLine(" styles: [")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ data class ElectionConfig(
val parameterBaseHash : UInt256, // Hp
val manifestHash : UInt256, // Hm
val electionBaseHash : UInt256, // Hb
// the raw bytes of the manifest. You must regenerate the manifest from this.
// the raw bytes of the election manifest. You must regenerate the manifest from this.
val manifestBytes: ByteArray,

val chainConfirmationCodes: Boolean = false,
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/org/cryptobiotic/eg/encrypt/Encryptor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.cryptobiotic.util.ErrorMessages

/**
* Encrypt Plaintext Ballots into PendingEncryptedBallot.
* The manifest is expected to have passed manifest validation (see ManifestInputValidation).
* The election manifest is expected to have passed manifest validation (see ManifestInputValidation).
* The input ballots are expected to have passed ballot validation
* See RunExampleEncryption and BallotInputValidation to validate ballots before passing them to this class.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class DecryptPreencryptWithNonce(
val results : List<Result<PlaintextBallot.Contest, String>> = this.contests.map {
val pcontest = preEncryptedBallot.contests.find { tcontest -> it.contestId == tcontest.contestId}
if (pcontest == null) {
Err("Cant find contest ${it.contestId} in manifest")
Err("Cant find contest ${it.contestId} in election manifest")
} else {
decryptContest(ballotNonce, it, pcontest)
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/org/cryptobiotic/eg/publish/Consumer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fun makeConsumer(
}

/**
* Read the manifest and check that the file parses and validates.
* Read the election manifest and check that the file parses and validates.
* @param manifestDirOrFile manifest filename, or the directory that its in. May be JSON or proto. If JSON, may be zipped
* @return isJson, manifest, manifestBytes
*/
Expand Down

0 comments on commit b5e1eef

Please sign in to comment.