From be7f11d6571663620556697a605f88c258228407 Mon Sep 17 00:00:00 2001 From: kngako Date: Mon, 19 Aug 2024 23:58:15 +0200 Subject: [PATCH] Return outputs of frost_shares_gen on jni --- .../fr/acinq/secp256k1/NativeSecp256k1.kt | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/jni/src/main/kotlin/fr/acinq/secp256k1/NativeSecp256k1.kt b/jni/src/main/kotlin/fr/acinq/secp256k1/NativeSecp256k1.kt index b0d3a95..5c704d8 100644 --- a/jni/src/main/kotlin/fr/acinq/secp256k1/NativeSecp256k1.kt +++ b/jni/src/main/kotlin/fr/acinq/secp256k1/NativeSecp256k1.kt @@ -145,10 +145,27 @@ public object NativeSecp256k1 : Secp256k1 { totalSigners, ids33 ) + val shares = Array(totalSigners) { index -> + val startIndex = 0 + (index*32); + val endIndex = 32 + (index*32); + + result.sliceArray( + startIndex..endIndex + ) + } + + val vssCommitment = Array(totalSigners) { index -> + val startIndex = 0 + (index*65); + val endIndex = 65 + (index*65); + + result.sliceArray( + startIndex..endIndex + ) + } return Triple( - emptyArray(), - emptyArray(), + shares, + vssCommitment, pok64 ) }