Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/include/secp256k1.h
#ifndef SECP256K1_H | #ifndef SECP256K1_H | ||||
#define SECP256K1_H | #define SECP256K1_H | ||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
extern "C" { | extern "C" { | ||||
#endif | #endif | ||||
#include <stddef.h> | #include <stddef.h> | ||||
/* These rules specify the order of arguments in API calls: | /* These rules specify the order of arguments in API calls: | ||||
* | * | ||||
* 1. Context pointers go first, followed by output arguments, combined | * 1. Context pointers go first, followed by output arguments, combined | ||||
* output/input arguments, and finally input-only arguments. | * output/input arguments, and finally input-only arguments. | ||||
* 2. Array lengths always immediately the follow the argument whose length | * 2. Array lengths always immediately follow the argument whose length | ||||
* they describe, even if this violates rule 1. | * they describe, even if this violates rule 1. | ||||
* 3. Within the OUT/OUTIN/IN groups, pointers to data that is typically generated | * 3. Within the OUT/OUTIN/IN groups, pointers to data that is typically generated | ||||
* later go first. This means: signatures, public nonces, secret nonces, | * later go first. This means: signatures, public nonces, secret nonces, | ||||
* messages, public keys, secret keys, tweaks. | * messages, public keys, secret keys, tweaks. | ||||
* 4. Arguments that are not data pointers go last, from more complex to less | * 4. Arguments that are not data pointers go last, from more complex to less | ||||
* complex: function pointers, algorithm names, messages, void pointers, | * complex: function pointers, algorithm names, messages, void pointers, | ||||
* counts, flags, booleans. | * counts, flags, booleans. | ||||
* 5. Opaque data pointers follow the function pointer they are to be passed to. | * 5. Opaque data pointers follow the function pointer they are to be passed to. | ||||
▲ Show 20 Lines • Show All 742 Lines • Show Last 20 Lines |