 |
PRCYCoin
2.0.0.7rc1
P2P Digital Currency
|
Go to the documentation of this file.
8 # if !defined(SECP256K1_GNUC_PREREQ)
9 # if defined(__GNUC__)&&defined(__GNUC_MINOR__)
10 # define SECP256K1_GNUC_PREREQ(_maj,_min) \
11 ((__GNUC__<<16)+__GNUC_MINOR__>=((_maj)<<16)+(_min))
13 # define SECP256K1_GNUC_PREREQ(_maj,_min) 0
17 # if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) )
18 # if SECP256K1_GNUC_PREREQ(2,7)
19 # define SECP256K1_INLINE __inline__
20 # elif (defined(_MSC_VER))
21 # define SECP256K1_INLINE __inline
23 # define SECP256K1_INLINE
26 # define SECP256K1_INLINE inline
32 # if defined(__GNUC__) && SECP256K1_GNUC_PREREQ(3, 4)
33 # define SECP256K1_WARN_UNUSED_RESULT __attribute__ ((__warn_unused_result__))
35 # define SECP256K1_WARN_UNUSED_RESULT
37 # if !defined(SECP256K1_BUILD) && defined(__GNUC__) && SECP256K1_GNUC_PREREQ(3, 4)
38 # define SECP256K1_ARG_NONNULL(_x) __attribute__ ((__nonnull__(_x)))
40 # define SECP256K1_ARG_NONNULL(_x)
45 # define SECP256K1_START_VERIFY (1 << 0)
46 # define SECP256K1_START_SIGN (1 << 1)
74 const unsigned char *msg,
76 const unsigned char *sig,
78 const unsigned char *pubkey,
95 const
unsigned char *msg,
99 const
unsigned char *seckey,
100 const
unsigned char *nonce
115 const
unsigned char *msg,
117 unsigned char *sig64,
118 const
unsigned char *seckey,
119 const
unsigned char *nonce,
136 const
unsigned char *msg,
138 const
unsigned char *sig64,
139 unsigned char *pubkey,
172 unsigned char *pubkey,
174 const
unsigned char *seckey,
187 unsigned char *pubkey,
193 const
unsigned char *seckey,
194 unsigned char *privkey,
201 unsigned char *seckey,
202 const
unsigned char *privkey,
208 unsigned char *seckey,
209 const
unsigned char *tweak
216 unsigned char *pubkey,
218 const
unsigned char *tweak
223 unsigned char *seckey,
224 const
unsigned char *tweak
231 unsigned char *pubkey,
233 const
unsigned char *tweak
void secp256k1_start(unsigned int flags)
Initialize the library.
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_verify(const unsigned char *pubkey, int pubkeylen) SECP256K1_ARG_NONNULL(1)
Just validate a public key.
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_seckey_verify(const unsigned char *seckey) SECP256K1_ARG_NONNULL(1)
Verify an ECDSA secret key.
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_tweak_mul(unsigned char *seckey, const unsigned char *tweak) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2)
Tweak a private key by multiplying it with tweak.
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdsa_recover_compact(const unsigned char *msg, int msglen, const unsigned char *sig64, unsigned char *pubkey, int *pubkeylen, int compressed, int recid) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4) SECP256K1_ARG_NONNULL(5)
Recover an ECDSA public key from a compact signature.
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdsa_sign_compact(const unsigned char *msg, int msglen, unsigned char *sig64, const unsigned char *seckey, const unsigned char *nonce, int *recid) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4) SECP256K1_ARG_NONNULL(5)
Create a compact ECDSA signature (64 byte + recovery id).
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_create(unsigned char *pubkey, int *pubkeylen, const unsigned char *seckey, int compressed) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Compute the public key for a secret key.
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdsa_sign(const unsigned char *msg, int msglen, unsigned char *sig, int *siglen, const unsigned char *seckey, const unsigned char *nonce) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4) SECP256K1_ARG_NONNULL(5) SECP256K1_ARG_NONNULL(6)
Create an ECDSA signature.
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_tweak_mul(unsigned char *pubkey, int pubkeylen, const unsigned char *tweak) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(3)
Tweak a public key by multiplying it with tweak.
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_decompress(unsigned char *pubkey, int *pubkeylen) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2)
Decompress a public key.
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_import(unsigned char *seckey, const unsigned char *privkey, int privkeylen) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2)
Import a private key in DER format.
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.
#define SECP256K1_WARN_UNUSED_RESULT
Warning attributes NONNULL is not used if SECP256K1_BUILD is set to avoid the compiler optimizing out...
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_tweak_add(unsigned char *seckey, const unsigned char *tweak) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2)
Tweak a private key by adding tweak to it.
#define SECP256K1_ARG_NONNULL(_x)
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_tweak_add(unsigned char *pubkey, int pubkeylen, const unsigned char *tweak) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(3)
Tweak a public key by adding tweak times the generator to it.
void secp256k1_stop(void)
Free all memory associated with this library.
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_export(const unsigned char *seckey, unsigned char *privkey, int *privkeylen, int compressed) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Export a private key in DER format.