NativeSecp256k1

<p>This class holds native methods to handle ECDSA verification.</p>

<p>You can find an example library that can be used for this at https://github.com/bitcoin/secp256k1</p>

<p>To build secp256k1 for use with bitcoinj, run ./configure --enable-jni --enable-experimental --enable-module-ecdh and make then copy .libs/libsecp256k1.so to your system library path or point the JVM to the folder containing it with -Djava.library.path </p>

Destructor

~this
~this()

libsecp256k1 Cleanup - This destroys the secp256k1 context object This should be called at the end of the program for proper cleanup of the context.

Members

Functions

createECDHSecret
immutable(ubyte[]) createECDHSecret(const(ubyte[]) seckey, const(ubyte[]) pubkey)

libsecp256k1 create ECDH secret - constant time ECDH calculation

getPubkey
immutable(ubyte[]) getPubkey(const(ubyte[]) keypair_seckey)

Takes both a seckey and keypair

privTweak
void privTweak(const(ubyte[]) keypair, const(ubyte[]) tweak, ubyte[] tweakked_keypair)

libsecp256k1 PubKey Tweak-Mul - Tweak pubkey by multiplying to it

randomizeContext
bool randomizeContext(const(ubyte)[] seed)

Updates the context randomization

sign
immutable(ubyte[]) sign(const(ubyte[]) msg, const(ubyte[]) keypair, const(ubyte[]) aux_random)
immutable(ubyte[]) sign(const(ubyte[]) msg, const(ubyte[]) keypair)

Create a Schnorr signature.

verify
bool verify(const(ubyte[]) msg, const(ubyte[]) signature, const(ubyte[]) pubkey)

Verifies a Schnorr signature