From b5e1eefdcf9fa49458823b442b908217eb957d72 Mon Sep 17 00:00:00 2001 From: JohnLCaron Date: Wed, 28 Aug 2024 06:44:10 -0600 Subject: [PATCH] remove preview from compiler options. change manifest to election manifest in comments. --- build.gradle.kts | 15 +++++++------- docs/CommandLineInterface.md | 20 +++++++++---------- docs/InputValidation.md | 2 +- .../eg/cli/RunCreateElectionConfig.kt | 2 +- .../eg/cli/RunCreateInputBallots.kt | 2 +- .../eg/cli/RunCreateTestManifest.kt | 2 +- .../eg/cli/RunShowElectionRecord.kt | 2 +- .../eg/election/ElectionConfig.kt | 2 +- .../org/cryptobiotic/eg/encrypt/Encryptor.kt | 2 +- .../preencrypt/DecryptPreencryptWithNonce.kt | 2 +- .../org/cryptobiotic/eg/publish/Consumer.kt | 2 +- 11 files changed, 27 insertions(+), 26 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 60e0556..f07a426 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -32,11 +32,11 @@ kotlin { //////////////// tasks { - val ENABLE_PREVIEW = "--enable-preview" + //val ENABLE_PREVIEW = "--enable-preview" withType() { - 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 @@ -48,7 +48,8 @@ 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/ @@ -56,9 +57,9 @@ tasks { systemProperties["junit.jupiter.execution.parallel.mode.default"] = "concurrent" systemProperties["junit.jupiter.execution.parallel.mode.classes.default"] = "concurrent" } - withType().all { - jvmArgs("--enable-preview") - } + //withType().all { + // jvmArgs("--enable-preview") + //} withType { kotlinOptions.jvmTarget = "17" } diff --git a/docs/CommandLineInterface.md b/docs/CommandLineInterface.md index b101272..253e229 100644 --- a/docs/CommandLineInterface.md +++ b/docs/CommandLineInterface.md @@ -32,16 +32,16 @@ last update 04/16/2024 Workflow -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 @@ -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 ```` @@ -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 } @@ -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 ```` diff --git a/docs/InputValidation.md b/docs/InputValidation.md index e1d0cf5..369989d 100644 --- a/docs/InputValidation.md +++ b/docs/InputValidation.md @@ -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. diff --git a/src/main/kotlin/org/cryptobiotic/eg/cli/RunCreateElectionConfig.kt b/src/main/kotlin/org/cryptobiotic/eg/cli/RunCreateElectionConfig.kt index df12688..281c818 100644 --- a/src/main/kotlin/org/cryptobiotic/eg/cli/RunCreateElectionConfig.kt +++ b/src/main/kotlin/org/cryptobiotic/eg/cli/RunCreateElectionConfig.kt @@ -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, diff --git a/src/main/kotlin/org/cryptobiotic/eg/cli/RunCreateInputBallots.kt b/src/main/kotlin/org/cryptobiotic/eg/cli/RunCreateInputBallots.kt index 47a6030..6b7d785 100644 --- a/src/main/kotlin/org/cryptobiotic/eg/cli/RunCreateInputBallots.kt +++ b/src/main/kotlin/org/cryptobiotic/eg/cli/RunCreateInputBallots.kt @@ -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, diff --git a/src/main/kotlin/org/cryptobiotic/eg/cli/RunCreateTestManifest.kt b/src/main/kotlin/org/cryptobiotic/eg/cli/RunCreateTestManifest.kt index 368f5a3..fed546f 100644 --- a/src/main/kotlin/org/cryptobiotic/eg/cli/RunCreateTestManifest.kt +++ b/src/main/kotlin/org/cryptobiotic/eg/cli/RunCreateTestManifest.kt @@ -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, diff --git a/src/main/kotlin/org/cryptobiotic/eg/cli/RunShowElectionRecord.kt b/src/main/kotlin/org/cryptobiotic/eg/cli/RunShowElectionRecord.kt index 6af6f58..d77d279 100644 --- a/src/main/kotlin/org/cryptobiotic/eg/cli/RunShowElectionRecord.kt +++ b/src/main/kotlin/org/cryptobiotic/eg/cli/RunShowElectionRecord.kt @@ -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: [") diff --git a/src/main/kotlin/org/cryptobiotic/eg/election/ElectionConfig.kt b/src/main/kotlin/org/cryptobiotic/eg/election/ElectionConfig.kt index 9844817..3be9017 100644 --- a/src/main/kotlin/org/cryptobiotic/eg/election/ElectionConfig.kt +++ b/src/main/kotlin/org/cryptobiotic/eg/election/ElectionConfig.kt @@ -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, diff --git a/src/main/kotlin/org/cryptobiotic/eg/encrypt/Encryptor.kt b/src/main/kotlin/org/cryptobiotic/eg/encrypt/Encryptor.kt index 10b4733..6ef0942 100644 --- a/src/main/kotlin/org/cryptobiotic/eg/encrypt/Encryptor.kt +++ b/src/main/kotlin/org/cryptobiotic/eg/encrypt/Encryptor.kt @@ -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. */ diff --git a/src/main/kotlin/org/cryptobiotic/eg/preencrypt/DecryptPreencryptWithNonce.kt b/src/main/kotlin/org/cryptobiotic/eg/preencrypt/DecryptPreencryptWithNonce.kt index 887022c..eef81dd 100644 --- a/src/main/kotlin/org/cryptobiotic/eg/preencrypt/DecryptPreencryptWithNonce.kt +++ b/src/main/kotlin/org/cryptobiotic/eg/preencrypt/DecryptPreencryptWithNonce.kt @@ -27,7 +27,7 @@ class DecryptPreencryptWithNonce( val results : List> = 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) } diff --git a/src/main/kotlin/org/cryptobiotic/eg/publish/Consumer.kt b/src/main/kotlin/org/cryptobiotic/eg/publish/Consumer.kt index 60f6fe5..5791b4d 100644 --- a/src/main/kotlin/org/cryptobiotic/eg/publish/Consumer.kt +++ b/src/main/kotlin/org/cryptobiotic/eg/publish/Consumer.kt @@ -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 */