Skip to content

Instantly share code, notes, and snippets.

@cyborch
Created August 2, 2019 10:11
Show Gist options
  • Save cyborch/9ea746a33b0d238248f89d0af8c6758e to your computer and use it in GitHub Desktop.
Save cyborch/9ea746a33b0d238248f89d0af8c6758e to your computer and use it in GitHub Desktop.
Prover service for cryptographic accumulator
fun main() {
val acc = RSAAccumulator()
val app = Javalin.create().start(7000)
app.get("/commitment") { ctx ->
ctx.result(acc.commitment.toString(10))
}
app.put("/add/:member") { ctx ->
val member = ctx.pathParam("member")
acc.add(member)
ctx.json(ProofResponse(acc.proveMembership(member)))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment