// Locally refresh: new_share = old_share + random_share - random_share_from_prev val newShares = parties.indices.map i -> add(oldShares[i], randoms[i])
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"))
The library typically consists of several layers: abric-language-kotlin
val proactiveRefresh = protocol val parties = listOf(p1, p2, p3) val oldShares = inputShares(parties) // Each party generates a random blinding share val randoms = parties.map randomShare()
// Send random contributions to the next party parties.indices.forEach i -> val next = (i + 1) % parties.size send(randoms[i] to parties[next]) // Locally refresh: new_share = old_share + random_share
val protocol = protocol val x = input(alice) val y = input(bob) val z = add(x, y) output(z, charlie)
The name "Abricot" often appears in academic contexts related to , secret sharing , and verifiable secret sharing (VSS). The abricot-language-kotlin repository specifically provides a Kotlin-based frontend for writing cryptographic protocols that can later be compiled or interpreted for different backends (e.g., arithmetic circuits, Boolean circuits, or actual networking code). 42) val b = secretInput(party("Bob")
// 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) // ...