Improve JNI handling of frost share gen

This commit is contained in:
kngako
2024-08-20 01:39:22 +02:00
parent 08f0304d4c
commit f5ab7fdeb7
2 changed files with 22 additions and 12 deletions

View File

@@ -145,18 +145,22 @@ public object NativeSecp256k1 : Secp256k1 {
totalSigners,
ids33
)
println(Hex.encode(result))
val shares = Array(totalSigners) { index ->
val startIndex = 0 + (index*32);
val endIndex = 32 + (index*32);
val endIndex = 31 + (index*32);
result.sliceArray(
startIndex..endIndex
)
}
val vssCommitment = Array(totalSigners) { index ->
val startIndex = 0 + (index*65);
val endIndex = 65 + (index*65);
val sharesOffset = totalSigners*32;
val vssCommitment = Array(threshold) { index ->
val startIndex = sharesOffset + (index*65);
val endIndex = sharesOffset + 64 + (index*65);
result.sliceArray(
startIndex..endIndex