PRCYCoin  2.0.0.7rc1
P2P Digital Currency
org_bitcoin_NativeSecp256k1.c
Go to the documentation of this file.
2 #include "include/secp256k1.h"
3 
5  (JNIEnv* env, jclass classObject, jobject byteBufferObject)
6 {
7  unsigned char* data = (unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject);
8  int sigLen = *((int*)(data + 32));
9  int pubLen = *((int*)(data + 32 + 4));
10 
11  return secp256k1_ecdsa_verify(data, 32, data+32+8, sigLen, data+32+8+sigLen, pubLen);
12 }
13 
14 static void __javasecp256k1_attach(void) __attribute__((constructor));
15 static void __javasecp256k1_detach(void) __attribute__((destructor));
16 
17 static void __javasecp256k1_attach(void) {
19 }
20 
21 static void __javasecp256k1_detach(void) {
23 }
secp256k1_start
void secp256k1_start(unsigned int flags)
Initialize the library.
Definition: secp256k1.c:21
org_bitcoin_NativeSecp256k1.h
Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1verify
JNIEXPORT jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1verify(JNIEnv *env, jclass classObject, jobject byteBufferObject)
Definition: org_bitcoin_NativeSecp256k1.c:5
SECP256K1_START_VERIFY
#define SECP256K1_START_VERIFY
Flags to pass to secp256k1_start.
Definition: secp256k1.h:45
__attribute__
void __attribute__((sysv_abi)) secp256k1_fe_mul_inner(const uint64_t *a
secp256k1.h
secp256k1_ecdsa_verify
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdsa_verify(const unsigned char *msg, int msglen, const unsigned char *sig, int siglen, const unsigned char *pubkey, int pubkeylen) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(5)
Verify an ECDSA signature.
Definition: secp256k1.c:43
secp256k1_stop
void secp256k1_stop(void)
Free all memory associated with this library.
Definition: secp256k1.c:34