Skip to content

Commit

Permalink
Fix some todos
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnLCaron committed Apr 12, 2024
1 parent 233c248 commit 9e46130
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 10 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
[![License](https://img.shields.io/github/license/JohnLCaron/egk-ec)](https://github.com/JohnLCaron/egk-ec-mixnet/blob/main/LICENSE.txt)
![GitHub branch checks state](https://img.shields.io/github/actions/workflow/status/JohnLCaron/egk-ec-mixnet/unit-tests.yml)
[![Coverage](https://img.shields.io/badge/coverage-88.7%25%20LOC%20(1345/1516)-blue)](https://github.com/JohnLCaron/egk-ec-mixnet/blob/main/htmlReport/index.html)
https://github.com/JohnLCaron/egk-ec-mixnet/blob/timingTest/htmlReport/index.html

# Egk Elliptic Curves Mixnet

_last update 04/07.2024_
_last update 04/10/2024_

(Work in Progress)

Expand Down
Binary file modified libs/egk-ec-2.1-SNAPSHOT.jar
Binary file not shown.
1 change: 0 additions & 1 deletion src/main/kotlin/org/cryptobiotic/maths/ProdColumnPow.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class ProdColumnPow(val group: GroupContext, val nthreads: Int, val alg: ProdCol
}

// always use PprodColumnPow, even when nthreads = 1, to divide into batches
// TODO is maxBatchSize optimal for ec ??
fun prodColumnPow(rows: List<VectorCiphertext>, exps: VectorQ): VectorCiphertext {
return PprodColumnPow(rows, exps, nthreads).calc()
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/org/cryptobiotic/mixnet/Challenge.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fun getBatchingVectorAndChallenge(
w: List<VectorCiphertext>,
wp: List<VectorCiphertext>,
): Pair<VectorQ, ElementModQ> {
// Generate a seed to the PRG for batching.
// Generate a seed to the PRG for batching. TODO cryptographer review.
val baseHash = parameterBaseHash(group.constants)
val ciphertexts = w.flatMap { it.elems }
val shuffled = wp.flatMap { it.elems }
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/org/cryptobiotic/mixnet/Generators.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fun getGeneratorsVmn(group: GroupContext, n: Int, mixName: String): VectorP {

// not sure if this is good enough, TODO cryptographer review.
val nonces = Nonces(prgSeed.toElementModQ(group), mixName).take(n)
val h0 = group.gPowP(nonces[0]).acceleratePow() // LOOK accelerated
val h0 = group.gPowP(nonces[0]).acceleratePow()
val generators = List(n) { if (it == 0) h0 else ( h0 powP nonces[it]) } // CE n acc

return VectorP(group, generators)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,7 @@ class RunPaperBallotDecrypt {
}
val ballotRow = foundBallot.shuffledRow

// TODO only open Shuffled ballots once?
// then open the Shuffled ballots and fetch that row
// TODO only open Shuffled ballots once? then open the Shuffled ballots and fetch that row
val reader = BallotReader(group, width)
val mixFile = "$mixDir/${RunMixnet.shuffledFilename}"
val shuffled = reader.readFromFile(mixFile)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ class RunVerifyDecryptions {
var allOk = true
val consumerIn = makeConsumer(egkMixnetDir)
consumerIn.iterateDecryptedBallots(decryptedBallotDir).forEach { decryptedBallot ->
val psn = decryptedBallot.id.toLong() // TODO err
val location = pballotMap[psn]!!.location
val psn = decryptedBallot.id.toLong()
val location = pballotMap[psn]!!.location // TODO handle error

val pballotFilename = "$originalBallotDir/$location"
val orgBallotResult = consumerIn.readPlaintextBallot(pballotFilename)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ data class PballotTable(

@Serializable
data class PballotEntry(
// val ballot_id: String, TODO allowed?
val sn: Long,
val location: String,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class ShuffleProofTest {
}

fun makeBallots(keypair: ElGamalKeypair, nrows: Int, width: Int) : List<VectorCiphertext> {
// TODO in parallel to save time
return List(nrows) {
val ciphertexts = List(width) {
val vote = if (Random.nextBoolean()) 0 else 1
Expand Down

0 comments on commit 9e46130

Please sign in to comment.