Created
August 2, 2019 10:11
-
-
Save cyborch/9ea746a33b0d238248f89d0af8c6758e to your computer and use it in GitHub Desktop.
Prover service for cryptographic accumulator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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