Abric-language-kotlin 🎁 ⭐
// Not actual syntax but representative of Abricot style val secretSharing = protocol val s = secretInput(dealer, "secret") val shares = split(s, 3, 5) // 3-out-of-5 sharing send(shares[0] to alice) send(shares[1] to bob) // ...
import fr.ens.abricot.* fun main() val protocol = protocol val a = secretInput(party("Alice"), 42) val b = secretInput(party("Bob"), 117) val c = add(a, b) val result = reveal(c) output(result, party("Charlie")) abric-language-kotlin
// After receiving, subtract the incoming random receiveAll() val finalShares = parties.indices.map i -> val prev = (i - 1 + parties.size) % parties.size sub(newShares[i], randoms[prev]) // Not actual syntax but representative of Abricot
val protocol = protocol val x = input(alice) val y = input(bob) val z = add(x, y) output(z, charlie) Abricot (not to be confused with the fruit
val multiply = protocol val x = input(alice) val y = input(bob) val product = mul(x, y) // This might generate Beaver triple multiplication output(product, alice, bob)
// Send random contributions to the next party parties.indices.forEach i -> val next = (i + 1) % parties.size send(randoms[i] to parties[next])
1. What is Abricot? Abricot (not to be confused with the fruit "abricot" meaning apricot in French) is a research-oriented embedded DSL written in Kotlin. Its primary goal is to allow cryptographers and protocol designers to describe, analyze, and generate implementations of secure multiparty computation (MPC) protocols and zero-knowledge proofs (ZKPs) at a high level of abstraction.