![]() |
PRCYCoin
2.0.0.7rc1
P2P Digital Currency
|
#include "secp256k1_2.h"Go to the source code of this file.
Classes | |
| struct | secp256k1_whitelist_signature |
| Opaque data structure that holds a parsed whitelist proof. More... | |
Macros | |
| #define | SECP256K1_WHITELIST_MAX_N_KEYS 256 |
Functions | |
| SECP256K1_API int | secp256k1_whitelist_signature_parse (const secp256k1_context2 *ctx, secp256k1_whitelist_signature *sig, const unsigned char *input, size_t input_len) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) |
| Parse a whitelist signature. More... | |
| SECP256K1_API size_t | secp256k1_whitelist_signature_n_keys (const secp256k1_whitelist_signature *sig) SECP256K1_ARG_NONNULL(1) |
| Returns the number of keys a signature expects to have. More... | |
| SECP256K1_API int | secp256k1_whitelist_signature_serialize (const secp256k1_context2 *ctx, unsigned char *output, size_t *output_len, const secp256k1_whitelist_signature *sig) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4) |
| Serialize a whitelist signature. More... | |
| SECP256K1_API int | secp256k1_whitelist_sign (const secp256k1_context2 *ctx, secp256k1_whitelist_signature *sig, const secp256k1_pubkey2 *online_pubkeys, const secp256k1_pubkey2 *offline_pubkeys, const size_t n_keys, const secp256k1_pubkey2 *sub_pubkey, const unsigned char *online_seckey, const unsigned char *summed_seckey, const size_t index, secp256k1_nonce_function2 noncefp, const void *noncedata) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4) SECP256K1_ARG_NONNULL(6) SECP256K1_ARG_NONNULL(7) SECP256K1_ARG_NONNULL(8) |
| Compute a whitelist signature Returns 1: signature was successfully created 0: signature was not successfully created In: ctx: pointer to a context object, initialized for signing and verification online_pubkeys: list of all online pubkeys offline_pubkeys: list of all offline pubkeys n_keys: the number of entries in each of the above two arrays sub_pubkey: the key to be whitelisted online_seckey: the secret key to the signer's online pubkey summed_seckey: the secret key to the sum of (whitelisted key, signer's offline pubkey) index: the signer's index in the lists of keys noncefp:pointer to a nonce generation function. More... | |
| SECP256K1_API int | secp256k1_whitelist_verify (const secp256k1_context2 *ctx, const secp256k1_whitelist_signature *sig, const secp256k1_pubkey2 *online_pubkeys, const secp256k1_pubkey2 *offline_pubkeys, const size_t n_keys, const secp256k1_pubkey2 *sub_pubkey) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4) SECP256K1_ARG_NONNULL(6) |
| Verify a whitelist signature Returns 1: signature is valid 0: signature is not valid In: ctx: pointer to a context object, initialized for signing and verification sig: the signature to be verified online_pubkeys: list of all online pubkeys offline_pubkeys: list of all offline pubkeys n_keys: the number of entries in each of the above two arrays sub_pubkey: the key to be whitelisted. More... | |
| #define SECP256K1_WHITELIST_MAX_N_KEYS 256 |
Definition at line 16 of file secp256k1_whitelist.h.
| SECP256K1_API int secp256k1_whitelist_sign | ( | const secp256k1_context2 * | ctx, |
| secp256k1_whitelist_signature * | sig, | ||
| const secp256k1_pubkey2 * | online_pubkeys, | ||
| const secp256k1_pubkey2 * | offline_pubkeys, | ||
| const size_t | n_keys, | ||
| const secp256k1_pubkey2 * | sub_pubkey, | ||
| const unsigned char * | online_seckey, | ||
| const unsigned char * | summed_seckey, | ||
| const size_t | index, | ||
| secp256k1_nonce_function2 | noncefp, | ||
| const void * | noncedata | ||
| ) |
Compute a whitelist signature Returns 1: signature was successfully created 0: signature was not successfully created In: ctx: pointer to a context object, initialized for signing and verification online_pubkeys: list of all online pubkeys offline_pubkeys: list of all offline pubkeys n_keys: the number of entries in each of the above two arrays sub_pubkey: the key to be whitelisted online_seckey: the secret key to the signer's online pubkey summed_seckey: the secret key to the sum of (whitelisted key, signer's offline pubkey) index: the signer's index in the lists of keys noncefp:pointer to a nonce generation function.
If NULL, secp256k1_nonce_function_default is used ndata: pointer to arbitrary data used by the nonce generation function (can be NULL) Out: sig: The produced signature.
The signatures are of the list of all passed pubkeys in the order ( whitelist, online_1, offline_1, online_2, offline_2, ... ) The verification key list consists of online_i + H(offline_i + whitelist)(offline_i + whitelist) for each public key pair (offline_i, offline_i). Here H means sha256 of the compressed serialization of the key.
Definition at line 15 of file main_impl.h.
| SECP256K1_API size_t secp256k1_whitelist_signature_n_keys | ( | const secp256k1_whitelist_signature * | sig | ) |
Returns the number of keys a signature expects to have.
Returns: the number of keys for the given signature In: sig: a pointer to a signature object
Definition at line 135 of file main_impl.h.
| SECP256K1_API int secp256k1_whitelist_signature_parse | ( | const secp256k1_context2 * | ctx, |
| secp256k1_whitelist_signature * | sig, | ||
| const unsigned char * | input, | ||
| size_t | input_len | ||
| ) |
Parse a whitelist signature.
Returns: 1 when the signature could be parsed, 0 otherwise. Args: ctx: a secp256k1 context object Out: sig: a pointer to a signature object In: input: a pointer to the array to parse input_len: the length of the above array
The signature must consist of a 1-byte n_keys value, followed by a 32-byte big endian e0 value, followed by n_keys many 32-byte big endian s values. If n_keys falls outside of [0..SECP256K1_WHITELIST_MAX_N_KEYS] the encoding is invalid.
The total length of the input array must therefore be 33 + 32 * n_keys. If the length input_len does not match this value, parsing will fail.
After the call, sig will always be initialized. If parsing failed or any scalar values overflow or are zero, the resulting sig value is guaranteed to fail validation for any set of keys.
Definition at line 139 of file main_impl.h.
| SECP256K1_API int secp256k1_whitelist_signature_serialize | ( | const secp256k1_context2 * | ctx, |
| unsigned char * | output, | ||
| size_t * | output_len, | ||
| const secp256k1_whitelist_signature * | sig | ||
| ) |
Serialize a whitelist signature.
Returns: 1 Args: ctx: a secp256k1 context object Out: output64: a pointer to an array to store the serialization In/Out: output_len: length of the above array, updated with the actual serialized length In: sig: a pointer to an initialized signature object
See secp256k1_whitelist_signature_parse for details about the encoding.
Definition at line 157 of file main_impl.h.
| SECP256K1_API int secp256k1_whitelist_verify | ( | const secp256k1_context2 * | ctx, |
| const secp256k1_whitelist_signature * | sig, | ||
| const secp256k1_pubkey2 * | online_pubkeys, | ||
| const secp256k1_pubkey2 * | offline_pubkeys, | ||
| const size_t | n_keys, | ||
| const secp256k1_pubkey2 * | sub_pubkey | ||
| ) |
Verify a whitelist signature Returns 1: signature is valid 0: signature is not valid In: ctx: pointer to a context object, initialized for signing and verification sig: the signature to be verified online_pubkeys: list of all online pubkeys offline_pubkeys: list of all offline pubkeys n_keys: the number of entries in each of the above two arrays sub_pubkey: the key to be whitelisted.
Definition at line 103 of file main_impl.h.
1.8.17