Dash Core  0.12.2.1
P2P Digital Currency
org.bitcoin.NativeSecp256k1 Class Reference

Static Public Member Functions

static boolean verify (byte[] data, byte[] signature, byte[] pub)
 

Static Public Attributes

static final boolean enabled
 

Static Private Member Functions

static native int secp256k1_ecdsa_verify (ByteBuffer byteBuff)
 

Static Private Attributes

static ThreadLocal< ByteBuffer > nativeECDSABuffer = new ThreadLocal<ByteBuffer>()
 

Detailed Description

This class holds native methods to handle ECDSA verification. You can find an example library that can be used for this at https://github.com/sipa/secp256k1

Definition at line 14 of file NativeSecp256k1.java.

Member Function Documentation

◆ secp256k1_ecdsa_verify()

static native int org.bitcoin.NativeSecp256k1.secp256k1_ecdsa_verify ( ByteBuffer  byteBuff)
staticprivate
Parameters
byteBuffsignature format is byte[32] data, native-endian int signatureLength, native-endian int pubkeyLength, byte[signatureLength] signature, byte[pubkeyLength] pub
Returns
1 for valid signature, anything else for invalid

Referenced by org.bitcoin.NativeSecp256k1.verify().

◆ verify()

static boolean org.bitcoin.NativeSecp256k1.verify ( byte []  data,
byte []  signature,
byte []  pub 
)
inlinestatic

Verifies the given secp256k1 signature in native code. Calling when enabled == false is undefined (probably library not loaded)

Parameters
dataThe data which was signed, must be exactly 32 bytes
signatureThe signature
pubThe public key which did the signing

Definition at line 35 of file NativeSecp256k1.java.

Member Data Documentation

◆ enabled

final boolean org.bitcoin.NativeSecp256k1.enabled
static

Definition at line 15 of file NativeSecp256k1.java.

◆ nativeECDSABuffer

ThreadLocal<ByteBuffer> org.bitcoin.NativeSecp256k1.nativeECDSABuffer = new ThreadLocal<ByteBuffer>()
staticprivate

Definition at line 26 of file NativeSecp256k1.java.

Referenced by org.bitcoin.NativeSecp256k1.verify().


The documentation for this class was generated from the following file: