Standard preamble:
========================================================================
..
.... Set up some character translations and predefined strings. \*(-- will
give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
double quote, and \*(R" will give a right double quote. \*(C+ will
give a nicer C++. Capital omega is used to do unbreakable dashes and
therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
nothing in troff, for use with C<>.
.tr \(*W- . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\}
Escape single quotes in literal strings from groff's Unicode transform.
If the F register is >0, we'll generate index entries on stderr for
titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
entries marked with X<> in POD. Of course, you'll have to process the
output yourself in some meaningful fashion.
Avoid warning from groff about undefined register 'F'.
.. .nr rF 0 . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF
Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] .\} . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents . \" corrections for vroff . \" for low resolution devices (crt and lpr) \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} ========================================================================
Title "EVP_KDF 3ossl"
way too many mistakes in technical documents.
After creating a \s-1EVP_KDF_CTX\s0 for the required algorithm using \fBEVP_KDF_CTX_new(), inputs to the algorithm are supplied either by passing them as part of the EVP_KDF_derive() call or using calls to EVP_KDF_CTX_set_params() before calling EVP_KDF_derive() to derive the key.
\fB\s-1EVP_KDF_CTX\s0 is a context type that holds the algorithm inputs.
See \*(L"Key Derivation Function (\s-1KDF\s0)\*(R" in OSSL_PROVIDER-default\|(7) for the lists of algorithms supported by the default provider.
The returned value must eventually be freed with \fBEVP_KDF_free\|(3).
\fBEVP_KDF_up_ref() increments the reference count of an already fetched \s-1KDF.\s0
\fBEVP_KDF_free() frees a fetched algorithm. \s-1NULL\s0 is a valid parameter, for which this function is a no-op.
\fBEVP_KDF_CTX_free() frees up the context ctx. If ctx is \s-1NULL,\s0 nothing is done.
\fBEVP_KDF_CTX_kdf() returns the \s-1EVP_KDF\s0 associated with the context \fIctx.
\fBEVP_KDF_derive() processes any parameters in Params and then derives \fIkeylen bytes of key material and places it in the key buffer. If the algorithm produces a fixed amount of output then an error will occur unless the keylen parameter is equal to that output size, as returned by EVP_KDF_CTX_get_kdf_size().
\fBEVP_KDF_get_params() retrieves details about the implementation \fIkdf. The set of parameters given with params determine exactly what parameters should be retrieved. Note that a parameter that is unknown in the underlying context is simply ignored.
\fBEVP_KDF_CTX_get_params() retrieves chosen parameters, given the context ctx and its underlying context. The set of parameters given with params determine exactly what parameters should be retrieved. Note that a parameter that is unknown in the underlying context is simply ignored.
\fBEVP_KDF_CTX_set_params() passes chosen parameters to the underlying context, given a context ctx. The set of parameters given with params determine exactly what parameters are passed down. Note that a parameter that is unknown in the underlying context is simply ignored. Also, what happens when a needed parameter isn't passed down is defined by the implementation.
\fBEVP_KDF_gettable_params() returns an \s-1OSSL_PARAM\s0\|(3) array that describes the retrievable and settable parameters. EVP_KDF_gettable_params() returns parameters that can be used with EVP_KDF_get_params().
\fBEVP_KDF_gettable_ctx_params() and EVP_KDF_CTX_gettable_params() return constant \s-1OSSL_PARAM\s0\|(3) arrays that describe the retrievable parameters that can be used with EVP_KDF_CTX_get_params(). \fBEVP_KDF_gettable_ctx_params() returns the parameters that can be retrieved from the algorithm, whereas EVP_KDF_CTX_gettable_params() returns the parameters that can be retrieved in the context's current state.
\fBEVP_KDF_settable_ctx_params() and EVP_KDF_CTX_settable_params() return constant \s-1OSSL_PARAM\s0\|(3) arrays that describe the settable parameters that can be used with EVP_KDF_CTX_set_params(). EVP_KDF_settable_ctx_params() returns the parameters that can be retrieved from the algorithm, whereas EVP_KDF_CTX_settable_params() returns the parameters that can be retrieved in the context's current state.
\fBEVP_KDF_is_a() returns 1 if kdf is an implementation of an algorithm that's identifiable with name, otherwise 0.
\fBEVP_KDF_get0_provider() returns the provider that holds the implementation of the given kdf.
\fBEVP_KDF_do_all_provided() traverses all \s-1KDF\s0 implemented by all activated providers in the given library context libctx, and for each of the implementations, calls the given function fn with the implementation method and the given arg as argument.
\fBEVP_KDF_get0_name() return the name of the given \s-1KDF.\s0 For fetched KDFs with multiple names, only one of them is returned; it's recommended to use EVP_KDF_names_do_all() instead.
\fBEVP_KDF_names_do_all() traverses all names for kdf, and calls \fIfn with each name and data.
\fBEVP_KDF_get0_description() returns a description of the kdf, meant for display and human consumption. The description is at the discretion of the kdf implementation.
0 Item "mac (OSSL_KDF_PARAM_MAC) <UTF8 string>" Item "digest (OSSL_KDF_PARAM_DIGEST) <UTF8 string>" Item "cipher (OSSL_KDF_PARAM_CIPHER) <UTF8 string>"
For \s-1KDF\s0 implementations that use an underlying computation \s-1MAC,\s0 digest or cipher, these parameters set what the algorithm should be. .Sp The value is always the name of the intended algorithm, or the properties. .Sp Note that not all algorithms may support all possible underlying implementations. Item "key (OSSL_KDF_PARAM_KEY) <octet string>" Some \s-1KDF\s0 implementations require a key. For those \s-1KDF\s0 implementations that support it, this octet string parameter sets the key. Item "info (OSSL_KDF_PARAM_INFO) <octet string>" Some \s-1KDF\s0 implementations, such as \s-1EVP_KDF-HKDF\s0\|(7), take an 'info' parameter for binding the derived key material to application- and context-specific information. This parameter sets the info, fixed info, other info or shared info argument. You can specify this parameter multiple times, and each instance will be concatenated to form the final value. Item "maclen (OSSL_KDF_PARAM_MAC_SIZE) <unsigned integer>" Used by implementations that use a \s-1MAC\s0 with a variable output size (\s-1KMAC\s0). For those \s-1KDF\s0 implementations that support it, this parameter sets the \s-1MAC\s0 output size. .Sp The default value, if any, is implementation dependent. The length must never exceed what can be given with a size_t. Item "maxmem_bytes (OSSL_KDF_PARAM_SCRYPT_MAXMEM) <unsigned integer>" Memory-hard password-based \s-1KDF\s0 algorithms, such as scrypt, use an amount of memory that depends on the load factors provided as input. For those \s-1KDF\s0 implementations that support it, this uint64_t parameter sets an upper limit on the amount of memory that may be consumed while performing a key derivation. If this memory usage limit is exceeded because the load factors are chosen too high, the key derivation will fail. .Sp The default value is implementation dependent. The memory size must never exceed what can be given with a size_t.
\fBEVP_KDF_get0_provider() returns a pointer to the provider for the \s-1KDF,\s0 or \s-1NULL\s0 on error.
\fBEVP_KDF_up_ref() returns 1 on success, 0 on error.
\fBEVP_KDF_CTX_new() returns either the newly allocated \fB\s-1EVP_KDF_CTX\s0 structure or \s-1NULL\s0 if an error occurred.
\fBEVP_KDF_CTX_free() and EVP_KDF_CTX_reset() do not return a value.
\fBEVP_KDF_CTX_get_kdf_size() returns the output size. \s-1SIZE_MAX\s0 is returned to indicate that the algorithm produces a variable amount of output; 0 to indicate failure.
\fBEVP_KDF_get0_name() returns the name of the \s-1KDF,\s0 or \s-1NULL\s0 on error.
\fBEVP_KDF_names_do_all() returns 1 if the callback was called for all names. A return value of 0 means that the callback was not called for any names.
The remaining functions return 1 for success and 0 or a negative value for failure. In particular, a return value of -2 indicates the operation is not supported by the \s-1KDF\s0 algorithm.
Licensed under the Apache License 2.0 (the \*(L"License\*(R"). You may not use this file except in compliance with the License. You can obtain a copy in the file \s-1LICENSE\s0 in the source distribution or at <https://www.openssl.org/source/license.html>.