Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.c
Show All 37 Lines | |||||
{ | { | ||||
secp256k1_context *ctx = (secp256k1_context*)(uintptr_t)ctx_l; | secp256k1_context *ctx = (secp256k1_context*)(uintptr_t)ctx_l; | ||||
secp256k1_context_destroy(ctx); | secp256k1_context_destroy(ctx); | ||||
(void)classObject;(void)env; | (void)classObject;(void)env; | ||||
} | } | ||||
SECP256K1_API jlong JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1init_1context | |||||
(JNIEnv* env, jclass classObject) | |||||
{ | |||||
secp256k1_context *ctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY); | |||||
(void)classObject; | |||||
(void)env; | |||||
return (uintptr_t)ctx; | |||||
} | |||||
SECP256K1_API jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1verify | SECP256K1_API jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1verify | ||||
(JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint siglen, jint publen) | (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint siglen, jint publen) | ||||
{ | { | ||||
secp256k1_context *ctx = (secp256k1_context*)(uintptr_t)ctx_l; | secp256k1_context *ctx = (secp256k1_context*)(uintptr_t)ctx_l; | ||||
unsigned char* data = (unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject); | unsigned char* data = (unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject); | ||||
const unsigned char* sigdata = { (unsigned char*) (data + 32) }; | const unsigned char* sigdata = { (unsigned char*) (data + 32) }; | ||||
const unsigned char* pubdata = { (unsigned char*) (data + siglen + 32) }; | const unsigned char* pubdata = { (unsigned char*) (data + siglen + 32) }; | ||||
▲ Show 20 Lines • Show All 378 Lines • Show Last 20 Lines |