Getting frost share verify to work
This commit is contained in:
parent
9541124a4a
commit
9a06440277
@ -603,27 +603,22 @@ public object Secp256k1Native : Secp256k1 {
|
|||||||
|
|
||||||
memScoped {
|
memScoped {
|
||||||
val nFrostShare = allocFrostShare(share)
|
val nFrostShare = allocFrostShare(share)
|
||||||
// val nVssCommitment = vssCommitment.map { allocPublicKey(it).ptr }
|
val nVssCommitments = allocArray<CPointerVar<secp256k1_pubkey>>(1)
|
||||||
|
|
||||||
val nVssCommitment = allocArray<CPointerVar<secp256k1_pubkey>>(vssCommitment.size)
|
val pubkeyArray = allocArray<secp256k1_pubkey>(vssCommitment.size)
|
||||||
vssCommitment.forEachIndexed { index, bytes ->
|
vssCommitment.forEachIndexed { commitmentIndex, pubkeyData ->
|
||||||
memcpy(nVssCommitment[index], bytes.refTo(0).getPointer(memScope), bytes.size.convert())
|
if (secp256k1_ec_pubkey_parse(ctx, pubkeyArray[commitmentIndex].ptr, toNat(pubkeyData), pubkeyData.size.convert()) == 0) {
|
||||||
|
error("Failed to parse public key")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// val nVssCommitment = allocArray<CPointerVar<secp256k1_pubkey>>(vssCommitment.size)
|
nVssCommitments[0] = pubkeyArray
|
||||||
// vssCommitment.forEachIndexed { index, pubkeyData ->
|
|
||||||
// pubkeyData.usePinned { pinned ->
|
|
||||||
// if (secp256k1_ec_pubkey_parse(ctx, nVssCommitment[index], toNat(pinned.get()), pubkeyData.size.convert()) == 0) {
|
|
||||||
// error("Failed to parse public key")
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
return secp256k1_frost_share_verify(
|
return secp256k1_frost_share_verify(
|
||||||
ctx = ctx,
|
ctx = ctx,
|
||||||
threshold = threshold.convert(),
|
threshold = threshold.convert(),
|
||||||
id33 = toNat(id33),
|
id33 = toNat(id33),
|
||||||
share = nFrostShare.ptr,
|
share = nFrostShare.ptr,
|
||||||
vss_commitment = nVssCommitment
|
vss_commitment = nVssCommitments
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user