11 (JNIEnv* env, jclass classObject, jlong ctx_l)
17 (void)classObject;(void)env;
24 (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l)
28 const unsigned char* seed = (
unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject);
37 (JNIEnv* env, jclass classObject, jlong ctx_l)
43 (void)classObject;(void)env;
47 (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint siglen, jint publen)
51 unsigned char*
data = (
unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject);
52 const unsigned char* sigdata = { (
unsigned char*) (data + 32) };
53 const unsigned char* pubdata = { (
unsigned char*) (data + siglen + 32) };
74 (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l)
77 unsigned char*
data = (
unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject);
78 unsigned char* secKey = (
unsigned char*) (data + 32);
80 jobjectArray retArray;
81 jbyteArray sigArray, intsByteArray;
82 unsigned char intsarray[2];
88 unsigned char outputSer[72];
89 size_t outputLen = 72;
95 intsarray[0] = outputLen;
98 retArray = (*env)->NewObjectArray(env, 2,
99 (*env)->FindClass(env,
"[B"),
100 (*env)->NewByteArray(env, 1));
102 sigArray = (*env)->NewByteArray(env, outputLen);
103 (*env)->SetByteArrayRegion(env, sigArray, 0, outputLen, (jbyte*)outputSer);
104 (*env)->SetObjectArrayElement(env, retArray, 0, sigArray);
106 intsByteArray = (*env)->NewByteArray(env, 2);
107 (*env)->SetByteArrayRegion(env, intsByteArray, 0, 2, (jbyte*)intsarray);
108 (*env)->SetObjectArrayElement(env, retArray, 1, intsByteArray);
116 (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l)
119 unsigned char* secKey = (
unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject);
127 (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l)
130 const unsigned char* secKey = (
unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject);
134 jobjectArray retArray;
135 jbyteArray pubkeyArray, intsByteArray;
136 unsigned char intsarray[2];
140 unsigned char outputSer[65];
141 size_t outputLen = 65;
147 intsarray[0] = outputLen;
150 retArray = (*env)->NewObjectArray(env, 2,
151 (*env)->FindClass(env,
"[B"),
152 (*env)->NewByteArray(env, 1));
154 pubkeyArray = (*env)->NewByteArray(env, outputLen);
155 (*env)->SetByteArrayRegion(env, pubkeyArray, 0, outputLen, (jbyte*)outputSer);
156 (*env)->SetObjectArrayElement(env, retArray, 0, pubkeyArray);
158 intsByteArray = (*env)->NewByteArray(env, 2);
159 (*env)->SetByteArrayRegion(env, intsByteArray, 0, 2, (jbyte*)intsarray);
160 (*env)->SetObjectArrayElement(env, retArray, 1, intsByteArray);
169 (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l)
172 unsigned char* privkey = (
unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject);
173 const unsigned char* tweak = (
unsigned char*) (privkey + 32);
175 jobjectArray retArray;
176 jbyteArray privArray, intsByteArray;
177 unsigned char intsarray[2];
183 intsarray[0] = privkeylen;
186 retArray = (*env)->NewObjectArray(env, 2,
187 (*env)->FindClass(env,
"[B"),
188 (*env)->NewByteArray(env, 1));
190 privArray = (*env)->NewByteArray(env, privkeylen);
191 (*env)->SetByteArrayRegion(env, privArray, 0, privkeylen, (jbyte*)privkey);
192 (*env)->SetObjectArrayElement(env, retArray, 0, privArray);
194 intsByteArray = (*env)->NewByteArray(env, 2);
195 (*env)->SetByteArrayRegion(env, intsByteArray, 0, 2, (jbyte*)intsarray);
196 (*env)->SetObjectArrayElement(env, retArray, 1, intsByteArray);
204 (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l)
207 unsigned char* privkey = (
unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject);
208 const unsigned char* tweak = (
unsigned char*) (privkey + 32);
210 jobjectArray retArray;
211 jbyteArray privArray, intsByteArray;
212 unsigned char intsarray[2];
218 intsarray[0] = privkeylen;
221 retArray = (*env)->NewObjectArray(env, 2,
222 (*env)->FindClass(env,
"[B"),
223 (*env)->NewByteArray(env, 1));
225 privArray = (*env)->NewByteArray(env, privkeylen);
226 (*env)->SetByteArrayRegion(env, privArray, 0, privkeylen, (jbyte*)privkey);
227 (*env)->SetObjectArrayElement(env, retArray, 0, privArray);
229 intsByteArray = (*env)->NewByteArray(env, 2);
230 (*env)->SetByteArrayRegion(env, intsByteArray, 0, 2, (jbyte*)intsarray);
231 (*env)->SetObjectArrayElement(env, retArray, 1, intsByteArray);
239 (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint publen)
243 unsigned char* pkey = (*env)->GetDirectBufferAddress(env, byteBufferObject);
244 const unsigned char* tweak = (
unsigned char*) (pkey + publen);
246 jobjectArray retArray;
247 jbyteArray pubArray, intsByteArray;
248 unsigned char intsarray[2];
249 unsigned char outputSer[65];
250 size_t outputLen = 65;
263 intsarray[0] = outputLen;
266 retArray = (*env)->NewObjectArray(env, 2,
267 (*env)->FindClass(env,
"[B"),
268 (*env)->NewByteArray(env, 1));
270 pubArray = (*env)->NewByteArray(env, outputLen);
271 (*env)->SetByteArrayRegion(env, pubArray, 0, outputLen, (jbyte*)outputSer);
272 (*env)->SetObjectArrayElement(env, retArray, 0, pubArray);
274 intsByteArray = (*env)->NewByteArray(env, 2);
275 (*env)->SetByteArrayRegion(env, intsByteArray, 0, 2, (jbyte*)intsarray);
276 (*env)->SetObjectArrayElement(env, retArray, 1, intsByteArray);
284 (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint publen)
287 unsigned char* pkey = (*env)->GetDirectBufferAddress(env, byteBufferObject);
288 const unsigned char* tweak = (
unsigned char*) (pkey + publen);
290 jobjectArray retArray;
291 jbyteArray pubArray, intsByteArray;
292 unsigned char intsarray[2];
293 unsigned char outputSer[65];
294 size_t outputLen = 65;
307 intsarray[0] = outputLen;
310 retArray = (*env)->NewObjectArray(env, 2,
311 (*env)->FindClass(env,
"[B"),
312 (*env)->NewByteArray(env, 1));
314 pubArray = (*env)->NewByteArray(env, outputLen);
315 (*env)->SetByteArrayRegion(env, pubArray, 0, outputLen, (jbyte*)outputSer);
316 (*env)->SetObjectArrayElement(env, retArray, 0, pubArray);
318 intsByteArray = (*env)->NewByteArray(env, 2);
319 (*env)->SetByteArrayRegion(env, intsByteArray, 0, 2, (jbyte*)intsarray);
320 (*env)->SetObjectArrayElement(env, retArray, 1, intsByteArray);
328 (JNIEnv * env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint numkeys)
330 (void)classObject;(void)env;(void)byteBufferObject;(void)ctx_l;(void)numkeys;
336 (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint publen)
339 const unsigned char* secdata = (*env)->GetDirectBufferAddress(env, byteBufferObject);
340 const unsigned char* pubdata = (
const unsigned char*) (secdata + 32);
342 jobjectArray retArray;
343 jbyteArray outArray, intsByteArray;
344 unsigned char intsarray[1];
346 unsigned char nonce_res[32];
347 size_t outputLen = 32;
362 retArray = (*env)->NewObjectArray(env, 2,
363 (*env)->FindClass(env,
"[B"),
364 (*env)->NewByteArray(env, 1));
366 outArray = (*env)->NewByteArray(env, outputLen);
367 (*env)->SetByteArrayRegion(env, outArray, 0, 32, (jbyte*)nonce_res);
368 (*env)->SetObjectArrayElement(env, retArray, 0, outArray);
370 intsByteArray = (*env)->NewByteArray(env, 1);
371 (*env)->SetByteArrayRegion(env, intsByteArray, 0, 1, (jbyte*)intsarray);
372 (*env)->SetObjectArrayElement(env, retArray, 1, intsByteArray);
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_tweak_add(const secp256k1_context *ctx, secp256k1_pubkey *pubkey, const unsigned char *tweak) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Tweak a public key by adding tweak times the generator to it.
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_tweak_mul(const secp256k1_context *ctx, unsigned char *seckey, const unsigned char *tweak) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Tweak a private key by multiplying it by a tweak.
SECP256K1_API jobjectArray JNICALL Java_org_fabcoin_NativeSecp256k1_secp256k1_1privkey_1tweak_1add(JNIEnv *env, jclass classObject, jobject byteBufferObject, jlong ctx_l)
SECP256K1_API jobjectArray JNICALL Java_org_fabcoin_NativeSecp256k1_secp256k1_1pubkey_1tweak_1add(JNIEnv *env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint publen)
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_context_randomize(secp256k1_context *ctx, const unsigned char *seed32) SECP256K1_ARG_NONNULL(1)
Updates the context randomization to protect against side-channel leakage.
SECP256K1_API jobjectArray JNICALL Java_org_fabcoin_NativeSecp256k1_secp256k1_1ec_1pubkey_1create(JNIEnv *env, jclass classObject, jobject byteBufferObject, jlong ctx_l)
SECP256K1_API void JNICALL Java_org_fabcoin_NativeSecp256k1_secp256k1_1destroy_1context(JNIEnv *env, jclass classObject, jlong ctx_l)
SECP256K1_API int secp256k1_ec_pubkey_serialize(const secp256k1_context *ctx, unsigned char *output, size_t *outputlen, const secp256k1_pubkey *pubkey, unsigned int flags) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4)
Serialize a pubkey object into a serialized byte sequence.
SECP256K1_API jlong JNICALL Java_org_fabcoin_NativeSecp256k1_secp256k1_1ctx_1clone(JNIEnv *env, jclass classObject, jlong ctx_l)
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_tweak_add(const secp256k1_context *ctx, unsigned char *seckey, const unsigned char *tweak) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Tweak a private key by adding tweak to it.
SECP256K1_API void secp256k1_context_destroy(secp256k1_context *ctx)
Destroy a secp256k1 context object.
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_create(const secp256k1_context *ctx, secp256k1_pubkey *pubkey, const unsigned char *seckey) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Compute the public key for a secret key.
#define SECP256K1_EC_UNCOMPRESSED
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_seckey_verify(const secp256k1_context *ctx, const unsigned char *seckey) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2)
Verify an ECDSA secret key.
SECP256K1_API int secp256k1_ecdsa_sign(const secp256k1_context *ctx, secp256k1_ecdsa_signature *sig, const unsigned char *msg32, const unsigned char *seckey, secp256k1_nonce_function noncefp, const void *ndata) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4)
Create an ECDSA signature.
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_tweak_mul(const secp256k1_context *ctx, secp256k1_pubkey *pubkey, const unsigned char *tweak) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Tweak a public key by multiplying it by a tweak value.
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_parse(const secp256k1_context *ctx, secp256k1_pubkey *pubkey, const unsigned char *input, size_t inputlen) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Parse a variable-length public key into the pubkey object.
Opaque data structured that holds a parsed ECDSA signature.
SECP256K1_API jint JNICALL Java_org_fabcoin_NativeSecp256k1_secp256k1_1context_1randomize(JNIEnv *env, jclass classObject, jobject byteBufferObject, jlong ctx_l)
SECP256K1_API int secp256k1_ecdsa_signature_parse_der(const secp256k1_context *ctx, secp256k1_ecdsa_signature *sig, const unsigned char *input, size_t inputlen) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Parse a DER ECDSA signature.
SECP256K1_API jint JNICALL Java_org_fabcoin_NativeSecp256k1_secp256k1_1ecdsa_1verify(JNIEnv *env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint siglen, jint publen)
SECP256K1_API secp256k1_context * secp256k1_context_clone(const secp256k1_context *ctx) SECP256K1_ARG_NONNULL(1) SECP256K1_WARN_UNUSED_RESULT
Copies a secp256k1 context object.
SECP256K1_API int secp256k1_ecdsa_signature_serialize_der(const secp256k1_context *ctx, unsigned char *output, size_t *outputlen, const secp256k1_ecdsa_signature *sig) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4)
Serialize an ECDSA signature in DER format.
SECP256K1_API jobjectArray JNICALL Java_org_fabcoin_NativeSecp256k1_secp256k1_1ecdh(JNIEnv *env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint publen)
SECP256K1_API jobjectArray JNICALL Java_org_fabcoin_NativeSecp256k1_secp256k1_1pubkey_1tweak_1mul(JNIEnv *env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint publen)
SECP256K1_API jlong JNICALL Java_org_fabcoin_NativeSecp256k1_secp256k1_1ecdsa_1pubkey_1combine(JNIEnv *env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint numkeys)
SECP256K1_API jint JNICALL Java_org_fabcoin_NativeSecp256k1_secp256k1_1ec_1seckey_1verify(JNIEnv *env, jclass classObject, jobject byteBufferObject, jlong ctx_l)
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdh(const secp256k1_context *ctx, unsigned char *result, const secp256k1_pubkey *pubkey, const unsigned char *privkey) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4)
Compute an EC Diffie-Hellman secret in constant time Returns: 1: exponentiation was successful 0: sca...
SECP256K1_API jobjectArray JNICALL Java_org_fabcoin_NativeSecp256k1_secp256k1_1privkey_1tweak_1mul(JNIEnv *env, jclass classObject, jobject byteBufferObject, jlong ctx_l)
SECP256K1_API jobjectArray JNICALL Java_org_fabcoin_NativeSecp256k1_secp256k1_1ecdsa_1sign(JNIEnv *env, jclass classObject, jobject byteBufferObject, jlong ctx_l)
Opaque data structure that holds a parsed and valid public key.
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdsa_verify(const secp256k1_context *ctx, const secp256k1_ecdsa_signature *sig, const unsigned char *msg32, const secp256k1_pubkey *pubkey) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4)
Verify an ECDSA signature.