Merge #583: JNI: fix use sig array
74e2dbd
JNI: fix use sig array (liuyujun) Pull request description: ACKs for commit 74e2db: sipa: ACK74e2dbd68e
. This is clearly an improvement. real-or-random: ACK74e2dbd68e
I've read the code but haven't tested it Tree-SHA512: 850b32e893463be4be28185dcc127d429afe4b6076036a078b7c61d590e0f4ea89127e448760b71c087cf70ffbefc52d87db77a5131bee81f3e4f95cfbd3bd3e
This commit is contained in:
commit
786dfb49f5
|
@ -81,15 +81,15 @@ SECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1e
|
||||||
jbyteArray sigArray, intsByteArray;
|
jbyteArray sigArray, intsByteArray;
|
||||||
unsigned char intsarray[2];
|
unsigned char intsarray[2];
|
||||||
|
|
||||||
secp256k1_ecdsa_signature sig[72];
|
secp256k1_ecdsa_signature sig;
|
||||||
|
|
||||||
int ret = secp256k1_ecdsa_sign(ctx, sig, data, secKey, NULL, NULL);
|
int ret = secp256k1_ecdsa_sign(ctx, &sig, data, secKey, NULL, NULL);
|
||||||
|
|
||||||
unsigned char outputSer[72];
|
unsigned char outputSer[72];
|
||||||
size_t outputLen = 72;
|
size_t outputLen = 72;
|
||||||
|
|
||||||
if( ret ) {
|
if( ret ) {
|
||||||
int ret2 = secp256k1_ecdsa_signature_serialize_der(ctx,outputSer, &outputLen, sig ); (void)ret2;
|
int ret2 = secp256k1_ecdsa_signature_serialize_der(ctx,outputSer, &outputLen, &sig ); (void)ret2;
|
||||||
}
|
}
|
||||||
|
|
||||||
intsarray[0] = outputLen;
|
intsarray[0] = outputLen;
|
||||||
|
|
Loading…
Reference in New Issue