@@ -741,7 +741,7 @@ JNIEXPORT jbyteArray JNICALL Java_fr_acinq_secp256k1_Secp256k1CFunctions_secp256
741741 CHECKRESULT ((* penv )-> GetArrayLength (penv , jauxrand32 ) != 32 , "auxiliary random data must be 32 bytes" );
742742 }
743743 seckey = (* penv )-> GetByteArrayElements (penv , jseckey , 0 );
744- result = secp256k1_keypair_create (ctx , & keypair , seckey );
744+ result = secp256k1_keypair_create (ctx , & keypair , ( const unsigned char * ) seckey );
745745 (* penv )-> ReleaseByteArrayElements (penv , jseckey , seckey , 0 );
746746 CHECKRESULT (!result , "secp256k1_keypair_create failed" );
747747
@@ -751,7 +751,7 @@ JNIEXPORT jbyteArray JNICALL Java_fr_acinq_secp256k1_Secp256k1CFunctions_secp256
751751 auxrand32 = (* penv )-> GetByteArrayElements (penv , jauxrand32 , 0 );
752752 }
753753
754- result = secp256k1_schnorrsig_sign32 (ctx , signature , (unsigned char * )msg , & keypair , auxrand32 );
754+ result = secp256k1_schnorrsig_sign32 (ctx , signature , (unsigned char * )msg , & keypair , ( const unsigned char * ) auxrand32 );
755755 (* penv )-> ReleaseByteArrayElements (penv , jmsg , msg , 0 );
756756 if (auxrand32 != 0 )
757757 {
@@ -930,13 +930,13 @@ JNIEXPORT jbyteArray JNICALL Java_fr_acinq_secp256k1_Secp256k1CFunctions_secp256
930930 return NULL ;
931931
932932 seckey = (* penv )-> GetByteArrayElements (penv , jseckey , 0 );
933- result = secp256k1_keypair_create (ctx , & keypair , seckey );
933+ result = secp256k1_keypair_create (ctx , & keypair , ( const unsigned char * ) seckey );
934934 (* penv )-> ReleaseByteArrayElements (penv , jseckey , seckey , 0 );
935935 CHECKRESULT (!result , "secp256k1_keypair_create failed" );
936936
937937 size = (* penv )-> GetArrayLength (penv , jseckey );
938938 CHECKRESULT (size != 32 , "invalid private key size" );
939- copy_bytes_from_java (penv , jseckey , size , seckey );
939+ copy_bytes_from_java (penv , jseckey , size , ( unsigned char * ) seckey );
940940
941941 if (jmsg32 != NULL )
942942 {
@@ -1125,14 +1125,14 @@ JNIEXPORT jbyteArray JNICALL Java_fr_acinq_secp256k1_Secp256k1CFunctions_secp256
11251125 CHECKRESULT ((* penv )-> GetArrayLength (penv , jtweak32 ) != 32 , "tweak must be 32 bytes" );
11261126 tweak32 = (* penv )-> GetByteArrayElements (penv , jtweak32 , 0 );
11271127
1128- result = secp256k1_musig_pubkey_ec_tweak_add (ctx , & pubkey , & keyaggcache , tweak32 );
1128+ result = secp256k1_musig_pubkey_ec_tweak_add (ctx , & pubkey , & keyaggcache , ( const unsigned char * ) tweak32 );
11291129 (* penv )-> ReleaseByteArrayElements (penv , jtweak32 , tweak32 , 0 );
11301130 CHECKRESULT (!result , "secp256k1_musig_pubkey_ec_tweak_add failed" );
11311131
11321132 jpubkey = (* penv )-> NewByteArray (penv , 65 );
11331133 pub = (* penv )-> GetByteArrayElements (penv , jpubkey , 0 );
11341134 size = 65 ;
1135- result = secp256k1_ec_pubkey_serialize (ctx , pub , & size , & pubkey , SECP256K1_EC_UNCOMPRESSED );
1135+ result = secp256k1_ec_pubkey_serialize (ctx , ( unsigned char * ) pub , & size , & pubkey , SECP256K1_EC_UNCOMPRESSED );
11361136 (* penv )-> ReleaseByteArrayElements (penv , jpubkey , pub , 0 );
11371137 CHECKRESULT (!result , "secp256k1_ec_pubkey_serialize failed" );
11381138
@@ -1170,14 +1170,14 @@ JNIEXPORT jbyteArray JNICALL Java_fr_acinq_secp256k1_Secp256k1CFunctions_secp256
11701170 CHECKRESULT ((* penv )-> GetArrayLength (penv , jtweak32 ) != 32 , "tweak must be 32 bytes" );
11711171 tweak32 = (* penv )-> GetByteArrayElements (penv , jtweak32 , 0 );
11721172
1173- result = secp256k1_musig_pubkey_xonly_tweak_add (ctx , & pubkey , & keyaggcache , tweak32 );
1173+ result = secp256k1_musig_pubkey_xonly_tweak_add (ctx , & pubkey , & keyaggcache , ( const unsigned char * ) tweak32 );
11741174 (* penv )-> ReleaseByteArrayElements (penv , jtweak32 , tweak32 , 0 );
11751175 CHECKRESULT (!result , "secp256k1_musig_pubkey_xonly_tweak_add failed" );
11761176
11771177 jpubkey = (* penv )-> NewByteArray (penv , 65 );
11781178 pub = (* penv )-> GetByteArrayElements (penv , jpubkey , 0 );
11791179 size = 65 ;
1180- result = secp256k1_ec_pubkey_serialize (ctx , pub , & size , & pubkey , SECP256K1_EC_UNCOMPRESSED );
1180+ result = secp256k1_ec_pubkey_serialize (ctx , ( unsigned char * ) pub , & size , & pubkey , SECP256K1_EC_UNCOMPRESSED );
11811181 (* penv )-> ReleaseByteArrayElements (penv , jpubkey , pub , 0 );
11821182 CHECKRESULT (!result , "secp256k1_ec_pubkey_serialize failed" );
11831183
@@ -1218,7 +1218,7 @@ JNIEXPORT jbyteArray JNICALL Java_fr_acinq_secp256k1_Secp256k1CFunctions_secp256
12181218 CHECKRESULT ((* penv )-> GetArrayLength (penv , jkeyaggcache ) != fr_acinq_secp256k1_Secp256k1CFunctions_SECP256K1_MUSIG_KEYAGG_CACHE_SIZE , "invalid keyagg cache size" );
12191219
12201220 ptr = (* penv )-> GetByteArrayElements (penv , jaggnonce , 0 );
1221- result = secp256k1_musig_aggnonce_parse (ctx , & aggnonce , ptr );
1221+ result = secp256k1_musig_aggnonce_parse (ctx , & aggnonce , ( const unsigned char * ) ptr );
12221222 (* penv )-> ReleaseByteArrayElements (penv , jaggnonce , ptr , 0 );
12231223 CHECKRESULT (!result , "secp256k1_musig_aggnonce_parse failed" );
12241224
@@ -1321,17 +1321,17 @@ JNIEXPORT jint JNICALL Java_fr_acinq_secp256k1_Secp256k1CFunctions_secp256k1_1mu
13211321 CHECKRESULT ((* penv )-> GetArrayLength (penv , jsession ) != fr_acinq_secp256k1_Secp256k1CFunctions_SECP256K1_MUSIG_SESSION_SIZE , "invalid session size" );
13221322
13231323 ptr = (* penv )-> GetByteArrayElements (penv , jpsig , 0 );
1324- result = secp256k1_musig_partial_sig_parse (ctx , & psig , ptr );
1324+ result = secp256k1_musig_partial_sig_parse (ctx , & psig , ( const unsigned char * ) ptr );
13251325 (* penv )-> ReleaseByteArrayElements (penv , jpsig , ptr , 0 );
13261326 CHECKRESULT (!result , "secp256k1_musig_partial_sig_parse failed" );
13271327
13281328 ptr = (* penv )-> GetByteArrayElements (penv , jpubnonce , 0 );
1329- result = secp256k1_musig_pubnonce_parse (ctx , & pubnonce , ptr );
1329+ result = secp256k1_musig_pubnonce_parse (ctx , & pubnonce , ( const unsigned char * ) ptr );
13301330 (* penv )-> ReleaseByteArrayElements (penv , jpubnonce , ptr , 0 );
13311331 CHECKRESULT (!result , "secp256k1_musig_pubnonce_parse failed" );
13321332
13331333 ptr = (* penv )-> GetByteArrayElements (penv , jpubkey , 0 );
1334- result = secp256k1_ec_pubkey_parse (ctx , & pubkey , ptr , (* penv )-> GetArrayLength (penv , jpubkey ));
1334+ result = secp256k1_ec_pubkey_parse (ctx , & pubkey , ( const unsigned char * ) ptr , (* penv )-> GetArrayLength (penv , jpubkey ));
13351335 (* penv )-> ReleaseByteArrayElements (penv , jpubkey , ptr , 0 );
13361336 CHECKRESULT (!result , "secp256k1_musig_pubkey_parse failed" );
13371337
0 commit comments