Skip to content

Commit 72fedf8

Browse files
docs: Improve docs for static context
1 parent 316ac76 commit 72fedf8

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

include/secp256k1.h

+9-5
Original file line numberDiff line numberDiff line change
@@ -214,18 +214,22 @@ typedef int (*secp256k1_nonce_function)(
214214
#define SECP256K1_TAG_PUBKEY_HYBRID_EVEN 0x06
215215
#define SECP256K1_TAG_PUBKEY_HYBRID_ODD 0x07
216216

217-
/** A simple secp256k1 context object with no precomputed tables. These are useful for
218-
* type serialization/parsing functions which require a context object to maintain
219-
* API consistency, but currently do not require expensive precomputations or dynamic
220-
* allocations.
217+
/** A built-in constant secp256k1 context object with static storage duration.
218+
*
219+
* This context object offers *only limited functionality* , i.e., it cannot be used
220+
* for API functions that perform computations involving secret keys, e.g., signing
221+
* and public key generation. If this restriction applies to a specific API function,
222+
* it is mentioned in its documentation. See secp256k1_context_create if you need a
223+
* full context object that supports all functionality offered by the library.
221224
*/
222225
SECP256K1_API extern const secp256k1_context *secp256k1_context_no_precomp;
223226

224227
/** Create a secp256k1 context object (in dynamically allocated memory).
225228
*
226229
* This function uses malloc to allocate memory. It is guaranteed that malloc is
227230
* called at most once for every call of this function. If you need to avoid dynamic
228-
* memory allocation entirely, see the functions in secp256k1_preallocated.h.
231+
* memory allocation entirely, see secp256k1_context_no_precomp and the functions in
232+
* secp256k1_preallocated.h.
229233
*
230234
* Returns: a newly created context object.
231235
* In: flags: Always set to SECP256K1_CONTEXT_NONE (see below).

0 commit comments

Comments
 (0)