28 const unsigned char* seed = (
unsigned char*) (*env)->GetDirectBufferAddress(env,
byteBufferObject);
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) };
77 unsigned char* data = (
unsigned char*) (*env)->GetDirectBufferAddress(env,
byteBufferObject);
78 unsigned char*
secKey = (
unsigned char*) (data + 32);
98 retArray = (*env)->NewObjectArray(env, 2,
99 (*env)->FindClass(env,
"[B"),
100 (*env)->NewByteArray(env, 1));
150 retArray = (*env)->NewObjectArray(env, 2,
151 (*env)->FindClass(env,
"[B"),
152 (*env)->NewByteArray(env, 1));
173 const unsigned char*
tweak = (
unsigned char*) (
privkey + 32);
186 retArray = (*env)->NewObjectArray(env, 2,
187 (*env)->FindClass(env,
"[B"),
188 (*env)->NewByteArray(env, 1));
208 const unsigned char*
tweak = (
unsigned char*) (
privkey + 32);
221 retArray = (*env)->NewObjectArray(env, 2,
222 (*env)->FindClass(env,
"[B"),
223 (*env)->NewByteArray(env, 1));
266 retArray = (*env)->NewObjectArray(env, 2,
267 (*env)->FindClass(env,
"[B"),
268 (*env)->NewByteArray(env, 1));
310 retArray = (*env)->NewObjectArray(env, 2,
311 (*env)->FindClass(env,
"[B"),
312 (*env)->NewByteArray(env, 1));
340 unsigned char* data = (
unsigned char*) (*env)->GetDirectBufferAddress(env,
byteBufferObject);
341 const unsigned char* sigdata = { (
unsigned char*) (data + 32) };
342 const unsigned char*
pubdata = { (
unsigned char*) (data + 32 + 64) };
360 unsigned char* data = (
unsigned char*) (*env)->GetDirectBufferAddress(env,
byteBufferObject);
361 unsigned char*
secKey = (
unsigned char*) (data + 32);
366 unsigned char sig[64];
370 retArray = (*env)->NewObjectArray(env, 2,
371 (*env)->FindClass(env,
"[B"),
372 (*env)->NewByteArray(env, 1));
374 sigArray = (*env)->NewByteArray(env, 64);
392 const unsigned char*
pubdata = (
const unsigned char*) (
secdata + 32);
416 retArray = (*env)->NewObjectArray(env, 2,
417 (*env)->FindClass(env,
"[B"),
418 (*env)->NewByteArray(env, 1));
SECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1sign(JNIEnv *env, jclass classObject, jobject byteBufferObject, jlong ctx_l)
SECP256K1_API jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1verify(JNIEnv *env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint siglen, jint publen)
SECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1privkey_1tweak_1mul(JNIEnv *env, jclass classObject, jobject byteBufferObject, jlong ctx_l)
SECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ec_1pubkey_1create(JNIEnv *env, jclass classObject, jobject byteBufferObject, jlong ctx_l)
SECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1privkey_1tweak_1add(JNIEnv *env, jclass classObject, jobject byteBufferObject, jlong ctx_l)
SECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1pubkey_1tweak_1mul(JNIEnv *env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint publen)
SECP256K1_API jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1schnorr_1verify(JNIEnv *env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint publen)
SECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdh(JNIEnv *env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint publen)
SECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1schnorr_1sign(JNIEnv *env, jclass classObject, jobject byteBufferObject, jlong ctx_l)
SECP256K1_API jlong JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1pubkey_1combine(JNIEnv *env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint numkeys)
SECP256K1_API jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ec_1seckey_1verify(JNIEnv *env, jclass classObject, jobject byteBufferObject, jlong ctx_l)
SECP256K1_API jlong JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ctx_1clone(JNIEnv *env, jclass classObject, jlong ctx_l)
SECP256K1_API jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1context_1randomize(JNIEnv *env, jclass classObject, jobject byteBufferObject, jlong ctx_l)
SECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1pubkey_1tweak_1add(JNIEnv *env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint publen)
SECP256K1_API void JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1destroy_1context(JNIEnv *env, jclass classObject, jlong ctx_l)
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
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 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 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 *msghash32, 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_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.
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 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.
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdsa_verify(const secp256k1_context *ctx, const secp256k1_ecdsa_signature *sig, const unsigned char *msghash32, const secp256k1_pubkey *pubkey) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4)
Verify an ECDSA signature.
SECP256K1_API secp256k1_context * secp256k1_context_clone(const secp256k1_context *ctx) SECP256K1_ARG_NONNULL(1) SECP256K1_WARN_UNUSED_RESULT
Copy a secp256k1 context object (into dynamically allocated memory).
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_tweak_add(const secp256k1_context *ctx, secp256k1_pubkey *pubkey, const unsigned char *tweak32) 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_add(const secp256k1_context *ctx, unsigned char *seckey, const unsigned char *tweak32) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Same as secp256k1_ec_seckey_tweak_add, but DEPRECATED.
#define SECP256K1_EC_UNCOMPRESSED
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_tweak_mul(const secp256k1_context *ctx, unsigned char *seckey, const unsigned char *tweak32) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Same as secp256k1_ec_seckey_tweak_mul, but DEPRECATED.
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 SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_tweak_mul(const secp256k1_context *ctx, secp256k1_pubkey *pubkey, const unsigned char *tweak32) 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 void secp256k1_context_destroy(secp256k1_context *ctx)
Destroy a secp256k1 context object (created in dynamically allocated memory).
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdh(const secp256k1_context *ctx, unsigned char *output, const secp256k1_pubkey *pubkey, const unsigned char *seckey, secp256k1_ecdh_hash_function hashfp, void *data) 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.
SECP256K1_API int secp256k1_schnorr_sign(const secp256k1_context *ctx, unsigned char *sig64, const unsigned char *msghash32, 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 a signature using a custom EC-Schnorr-SHA256 construction.
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_schnorr_verify(const secp256k1_context *ctx, const unsigned char *sig64, const unsigned char *msghash32, const secp256k1_pubkey *pubkey) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4)
Verify a signature created by secp256k1_schnorr_sign.
Opaque data structured that holds a parsed ECDSA signature.
Opaque data structure that holds a parsed and valid public key.