JVM Tests hacks

This commit is contained in:
kngako
2024-08-20 02:19:43 +02:00
parent f5ab7fdeb7
commit 83141916e8
3 changed files with 122 additions and 4 deletions

View File

@@ -1413,8 +1413,10 @@ JNIEXPORT jbyteArray JNICALL Java_fr_acinq_secp256k1_Secp256k1CFunctions_secp256
for (i = 0; i < jn_participants; i++)
{
jbyteArray id33 = (jbyteArray)(*penv)->GetObjectArrayElement(penv, jids33, i);
// TODO: Check id33 size is 33...
size = (*penv)->GetArrayLength(penv, id33);
CHECKRESULT(size != 32, "invalid id33 size");
ids33[i] = (*penv)->GetByteArrayElements(penv, id33, 0);
(*penv)->ReleaseByteArrayElements(penv, id33, ids33[i], 0);
}
int sharesLength = jn_participants * 32;
@@ -2089,8 +2091,9 @@ JNIEXPORT jbyteArray JNICALL Java_fr_acinq_secp256k1_Secp256k1CFunctions_secp256
for (i = 0; i < n_pubnonces; i++)
{
jbyteArray id33 = (jbyteArray)(*penv)->GetObjectArrayElement(penv, jids33, i);
// TODO: Check id33 size is 33...
CHECKRESULT(size != 32, "invalid id33 size");
ids33[i] = (*penv)->GetByteArrayElements(penv, id33, 0);
(*penv)->ReleaseByteArrayElements(penv, id33, ids33[i], 0);
}