summaryrefslogtreecommitdiffstats
path: root/doc/man7/provider-rand.pod
diff options
context:
space:
mode:
authorDr. Matthias St. Pierre <matthias.st.pierre@ncp-e.com>2020-06-21 01:19:16 +0200
committerDr. Matthias St. Pierre <matthias.st.pierre@ncp-e.com>2020-06-24 22:01:22 +0200
commit363b1e5daea4a01889e6ff27148018be63d33b9b (patch)
tree9e6f5fe3be912b433fa848c44df11a15d0aa2921 /doc/man7/provider-rand.pod
parentRename <openssl/core_numbers.h> -> <openssl/core_dispatch.h> (diff)
downloadopenssl-363b1e5daea4a01889e6ff27148018be63d33b9b.tar.xz
openssl-363b1e5daea4a01889e6ff27148018be63d33b9b.zip
Make the naming scheme for dispatched functions more consistent
The new naming scheme consistently usese the `OSSL_FUNC_` prefix for all functions which are dispatched between the core and providers. This change includes in particular all up- and downcalls, i.e., the dispatched functions passed from core to provider and vice versa. - OSSL_core_ -> OSSL_FUNC_core_ - OSSL_provider_ -> OSSL_FUNC_core_ For operations and their function dispatch tables, the following convention is used: Type | Name (evp_generic_fetch(3)) | ---------------------|-----------------------------------| operation | OSSL_OP_FOO | function id | OSSL_FUNC_FOO_FUNCTION_NAME | function "name" | OSSL_FUNC_foo_function_name | function typedef | OSSL_FUNC_foo_function_name_fn | function ptr getter | OSSL_FUNC_foo_function_name | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12222)
Diffstat (limited to 'doc/man7/provider-rand.pod')
-rw-r--r--doc/man7/provider-rand.pod106
1 files changed, 53 insertions, 53 deletions
diff --git a/doc/man7/provider-rand.pod b/doc/man7/provider-rand.pod
index 891b824561..fb6f436b7c 100644
--- a/doc/man7/provider-rand.pod
+++ b/doc/man7/provider-rand.pod
@@ -9,7 +9,7 @@ functions
=for openssl multiple includes
- #include <openssl/core_numbers.h>
+ #include <openssl/core_dispatch.h>
#include <openssl/core_names.h>
/*
@@ -19,45 +19,45 @@ functions
*/
/* Context management */
- void *OP_rand_newctx(void *provctx, void *parent,
- const OSSL_DISPATCH *parent_calls);
- void OP_rand_freectx(void *ctx);
+ void *OSSL_FUNC_rand_newctx(void *provctx, void *parent,
+ const OSSL_DISPATCH *parent_calls);
+ void OSSL_FUNC_rand_freectx(void *ctx);
/* Random number generator functions: NIST */
- int OP_rand_instantiate(void *ctx, unsigned int strength,
- int prediction_resistance,
- const unsigned char *pstr, size_t pstr_len);
- int OP_rand_uninstantiate(void *ctx);
- int OP_rand_generate(void *ctx, unsigned char *out, size_t outlen,
- unsigned int strength, int prediction_resistance,
- const unsigned char *addin, size_t addin_len);
- int OP_rand_reseed(void *ctx, int prediction_resistance,
- const unsigned char *ent, size_t ent_len,
- const unsigned char *addin, size_t addin_len);
+ int OSSL_FUNC_rand_instantiate(void *ctx, unsigned int strength,
+ int prediction_resistance,
+ const unsigned char *pstr, size_t pstr_len);
+ int OSSL_FUNC_rand_uninstantiate(void *ctx);
+ int OSSL_FUNC_rand_generate(void *ctx, unsigned char *out, size_t outlen,
+ unsigned int strength, int prediction_resistance,
+ const unsigned char *addin, size_t addin_len);
+ int OSSL_FUNC_rand_reseed(void *ctx, int prediction_resistance,
+ const unsigned char *ent, size_t ent_len,
+ const unsigned char *addin, size_t addin_len);
/* Random number generator functions: additional */
- size_t OP_rand_nonce(void *ctx, unsigned char *out, size_t outlen,
- int strength, size_t min_noncelen, size_t max_noncelen);
- void OP_rand_set_callbacks(void *ctx, OSSL_CALLBACK *get_entropy,
- OSSL_CALLBACK *cleanup_entropy,
- OSSL_CALLBACK *get_nonce,
- OSSL_CALLBACK *cleanup_nonce, void *arg);
- int OP_rand_verify_zeroization(void *ctx);
+ size_t OSSL_FUNC_rand_nonce(void *ctx, unsigned char *out, size_t outlen,
+ int strength, size_t min_noncelen, size_t max_noncelen);
+ void OSSL_FUNC_rand_set_callbacks(void *ctx, OSSL_CALLBACK *get_entropy,
+ OSSL_CALLBACK *cleanup_entropy,
+ OSSL_CALLBACK *get_nonce,
+ OSSL_CALLBACK *cleanup_nonce, void *arg);
+ int OSSL_FUNC_rand_verify_zeroization(void *ctx);
/* Context Locking */
- int OP_rand_enable_locking(void *ctx);
- int OP_rand_lock(void *ctx);
- void OP_rand_unlock(void *ctx);
+ int OSSL_FUNC_rand_enable_locking(void *ctx);
+ int OSSL_FUNC_rand_lock(void *ctx);
+ void OSSL_FUNC_rand_unlock(void *ctx);
/* RAND parameter descriptors */
- const OSSL_PARAM *OP_rand_gettable_params(void);
- const OSSL_PARAM *OP_rand_gettable_ctx_params(void);
- const OSSL_PARAM *OP_rand_settable_ctx_params(void);
+ const OSSL_PARAM *OSSL_FUNC_rand_gettable_params(void);
+ const OSSL_PARAM *OSSL_FUNC_rand_gettable_ctx_params(void);
+ const OSSL_PARAM *OSSL_FUNC_rand_settable_ctx_params(void);
/* RAND parameters */
- int OP_rand_get_params(OSSL_PARAM params[]);
- int OP_rand_get_ctx_params(void *ctx, OSSL_PARAM params[]);
- int OP_rand_set_ctx_params(void *ctx, const OSSL_PARAM params[]);
+ int OSSL_FUNC_rand_get_params(OSSL_PARAM params[]);
+ int OSSL_FUNC_rand_get_ctx_params(void *ctx, OSSL_PARAM params[]);
+ int OSSL_FUNC_rand_set_ctx_params(void *ctx, const OSSL_PARAM params[]);
=head1 DESCRIPTION
@@ -70,7 +70,7 @@ them available to applications via the API function L<EVP_RAND(3)>.
=head2 Context Management Functions
-OP_rand_newctx() should create and return a pointer to a provider side
+OSSL_FUNC_rand_newctx() should create and return a pointer to a provider side
structure for holding context information during a rand operation.
A pointer to this context will be passed back in a number of the other rand
operation function calls.
@@ -82,7 +82,7 @@ operating system will be used for seeding.
The parameter I<parent_calls> points to the dispatch table for I<parent>.
Thus, the parent need not be from the same provider as the new instance.
-OP_rand_freectx() is passed a pointer to the provider side rand context in
+OSSL_FUNC_rand_freectx() is passed a pointer to the provider side rand context in
the I<mctx> parameter.
If it receives NULL as I<ctx> value, it should not do anything other than
return.
@@ -92,16 +92,16 @@ This function should free any resources associated with that context.
These functions correspond to those defined in NIST SP 800-90A and SP 800-90C.
-OP_rand_instantiate() is used to instantiate the DRBG I<ctx> at a requested
+OSSL_FUNC_rand_instantiate() is used to instantiate the DRBG I<ctx> at a requested
security I<strength>. In addition, I<prediction_resistance> can be requested.
Additional input I<addin> of length I<addin_len> bytes can optionally
be provided.
-OP_rand_uninstantiate() is used to uninstantiate the DRBG I<ctx>. After being
+OSSL_FUNC_rand_uninstantiate() is used to uninstantiate the DRBG I<ctx>. After being
uninstantiated, a DRBG is unable to produce output until it is instantiated
anew.
-OP_rand_generate() is used to generate random bytes from the DRBG I<ctx>.
+OSSL_FUNC_rand_generate() is used to generate random bytes from the DRBG I<ctx>.
It will generate I<outlen> bytes placing them into the buffer pointed to by
I<out>. The generated bytes will meet the specified security I<strength> and,
if I<prediction_resistance> is true, the bytes will be produced after reseeding
@@ -110,11 +110,11 @@ bytes can optionally be provided.
=head2 Random Number Generator Functions: Additional
-OP_rand_nonce() is used to generate a nonce of the given I<strength> with a
+OSSL_FUNC_rand_nonce() is used to generate a nonce of the given I<strength> with a
length from I<min_noncelen> to I<max_noncelen>. If the output buffer I<out> is
NULL, the length of the nonce should be returned.
-OP_rand_set_callbacks() is used to supply custom entropy and nonce callbacks.
+OSSL_FUNC_rand_set_callbacks() is used to supply custom entropy and nonce callbacks.
Instead of gathering seed material from its usual sources, the DRBG I<ctx>
should call these functions.
The I<get_entropy> and I<cleanup_entropy> callbacks obtain and release bytes
@@ -122,7 +122,7 @@ of entropy.
The I<get_nonce> and I<cleanup_nonce> functions obtain and release nonce bytes.
In all cases, the additional argument I<arg> is passed to the callbacks.
-OP_rand_verify_zeroization() is used to determine if the internal state of the
+OSSL_FUNC_rand_verify_zeroization() is used to determine if the internal state of the
DRBG is zero. This capability is mandated by NIST as part of the self
tests, it is unlikely to be useful in other circumstances.
@@ -132,35 +132,35 @@ When DRBGs are used by multiple threads, there must be locking employed to
ensure their proper operation. Because locking introduces an overhead, it
is disabled by default.
-OP_rand_enable_locking() allows locking to be turned on for a DRBG and all of
+OSSL_FUNC_rand_enable_locking() allows locking to be turned on for a DRBG and all of
its parent DRBGs. From this call onwards, the DRBG can be used in a thread
safe manner.
-OP_rand_lock() is used to lock a DRBG. Once locked, exclusive access
+OSSL_FUNC_rand_lock() is used to lock a DRBG. Once locked, exclusive access
is guaranteed.
-OP_rand_unlock() is used to unlock a DRBG.
+OSSL_FUNC_rand_unlock() is used to unlock a DRBG.
=head2 Rand Parameters
See L<OSSL_PARAM(3)> for further details on the parameters structure used by
these functions.
-OP_rand_get_params() gets details of parameter values associated with the
+OSSL_FUNC_rand_get_params() gets details of parameter values associated with the
provider algorithm and stores them in I<params>.
-OP_rand_set_ctx_params() sets rand parameters associated with the given
+OSSL_FUNC_rand_set_ctx_params() sets rand parameters associated with the given
provider side rand context I<ctx> to I<params>.
Any parameter settings are additional to any that were previously set.
-OP_rand_get_ctx_params() gets details of currently set parameter values
+OSSL_FUNC_rand_get_ctx_params() gets details of currently set parameter values
associated with the given provider side rand context I<ctx> and stores them
in I<params>.
-OP_rand_gettable_params(), OP_rand_gettable_ctx_params(), and
-OP_rand_settable_ctx_params() all return constant B<OSSL_PARAM> arrays
-as descriptors of the parameters that OP_rand_get_params(),
-OP_rand_get_ctx_params(), and OP_rand_set_ctx_params() can handle,
+OSSL_FUNC_rand_gettable_params(), OSSL_FUNC_rand_gettable_ctx_params(), and
+OSSL_FUNC_rand_settable_ctx_params() all return constant B<OSSL_PARAM> arrays
+as descriptors of the parameters that OSSL_FUNC_rand_get_params(),
+OSSL_FUNC_rand_get_ctx_params(), and OSSL_FUNC_rand_set_ctx_params() can handle,
respectively.
Parameters currently recognised by built-in rands are as follows. Not all
@@ -197,7 +197,7 @@ associated RAND ctx.
=item "max_request" (B<OSSL_DRBG_PARAM_RESEED_REQUESTS>) <unsigned integer>
Specifies the maximum number of bytes that can be generated in a single
-call to OP_rand_generate.
+call to OSSL_FUNC_rand_generate.
=item "min_entropylen" (B<OSSL_DRBG_PARAM_MIN_ENTROPYLEN>) <unsigned integer>
@@ -243,14 +243,14 @@ considered valid.
=head1 RETURN VALUES
-OP_rand_newctx() should return the newly created
+OSSL_FUNC_rand_newctx() should return the newly created
provider side rand context, or NULL on failure.
-OP_rand_gettable_params(), OP_rand_gettable_ctx_params() and
-OP_rand_settable_ctx_params() should return a constant B<OSSL_PARAM>
+OSSL_FUNC_rand_gettable_params(), OSSL_FUNC_rand_gettable_ctx_params() and
+OSSL_FUNC_rand_settable_ctx_params() should return a constant B<OSSL_PARAM>
array, or NULL if none is offered.
-OP_rand_nonce() returns the size of the generated nonce, or 0 on error.
+OSSL_FUNC_rand_nonce() returns the size of the generated nonce, or 0 on error.
All of the remaining functions should return 1 for success or 0 on error.