| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482 |
- .\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
- .\"
- .\" Standard preamble:
- .\" ========================================================================
- .de Sp \" Vertical space (when we can't use .PP)
- .if t .sp .5v
- .if n .sp
- ..
- .de Vb \" Begin verbatim text
- .ft CW
- .nf
- .ne \\$1
- ..
- .de Ve \" End verbatim text
- .ft R
- .fi
- ..
- .\" 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 C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
- .ie n \{\
- . 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\}
- .el\{\
- . 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.
- .ie \n(.g .ds Aq \(aq
- .el .ds Aq '
- .\"
- .\" 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'.
- .de IX
- ..
- .nr rF 0
- .if \n(.g .if rF .nr rF 1
- .if (\n(rF:(\n(.g==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
- .if n \{\
- . ds #H 0
- . ds #V .8m
- . ds #F .3m
- . ds #[ \f1
- . ds #] \fP
- .\}
- .if t \{\
- . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
- . ds #V .6m
- . ds #F 0
- . ds #[ \&
- . ds #] \&
- .\}
- . \" simple accents for nroff and troff
- .if n \{\
- . ds ' \&
- . ds ` \&
- . ds ^ \&
- . ds , \&
- . ds ~ ~
- . ds /
- .\}
- .if t \{\
- . 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
- .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
- .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
- .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
- .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
- .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
- .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
- .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
- .ds ae a\h'-(\w'a'u*4/10)'e
- .ds Ae A\h'-(\w'A'u*4/10)'E
- . \" corrections for vroff
- .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
- .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
- . \" for low resolution devices (crt and lpr)
- .if \n(.H>23 .if \n(.V>19 \
- \{\
- . 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
- .\}
- .rm #[ #] #H #V #F C
- .\" ========================================================================
- .\"
- .IX Title "PROVIDER-KDF 7ossl"
- .TH PROVIDER-KDF 7ossl "2024-09-03" "3.3.2" "OpenSSL"
- .\" For nroff, turn off justification. Always turn off hyphenation; it makes
- .\" way too many mistakes in technical documents.
- .if n .ad l
- .nh
- .SH "NAME"
- provider\-kdf \- The KDF library <\-> provider functions
- .SH "SYNOPSIS"
- .IX Header "SYNOPSIS"
- .Vb 2
- \& #include <openssl/core_dispatch.h>
- \& #include <openssl/core_names.h>
- \&
- \& /*
- \& * None of these are actual functions, but are displayed like this for
- \& * the function signatures for functions that are offered as function
- \& * pointers in OSSL_DISPATCH arrays.
- \& */
- \&
- \& /* Context management */
- \& void *OSSL_FUNC_kdf_newctx(void *provctx);
- \& void OSSL_FUNC_kdf_freectx(void *kctx);
- \& void *OSSL_FUNC_kdf_dupctx(void *src);
- \&
- \& /* Encryption/decryption */
- \& int OSSL_FUNC_kdf_reset(void *kctx);
- \& int OSSL_FUNC_kdf_derive(void *kctx, unsigned char *key, size_t keylen,
- \& const OSSL_PARAM params[]);
- \&
- \& /* KDF parameter descriptors */
- \& const OSSL_PARAM *OSSL_FUNC_kdf_gettable_params(void *provctx);
- \& const OSSL_PARAM *OSSL_FUNC_kdf_gettable_ctx_params(void *kcxt, void *provctx);
- \& const OSSL_PARAM *OSSL_FUNC_kdf_settable_ctx_params(void *kcxt, void *provctx);
- \&
- \& /* KDF parameters */
- \& int OSSL_FUNC_kdf_get_params(OSSL_PARAM params[]);
- \& int OSSL_FUNC_kdf_get_ctx_params(void *kctx, OSSL_PARAM params[]);
- \& int OSSL_FUNC_kdf_set_ctx_params(void *kctx, const OSSL_PARAM params[]);
- .Ve
- .SH "DESCRIPTION"
- .IX Header "DESCRIPTION"
- This documentation is primarily aimed at provider authors. See \fBprovider\fR\|(7)
- for further information.
- .PP
- The \s-1KDF\s0 operation enables providers to implement \s-1KDF\s0 algorithms and make
- them available to applications via the \s-1API\s0 functions \fBEVP_KDF_CTX_reset\fR\|(3),
- and \fBEVP_KDF_derive\fR\|(3).
- .PP
- All \*(L"functions\*(R" mentioned here are passed as function pointers between
- \&\fIlibcrypto\fR and the provider in \s-1\fBOSSL_DISPATCH\s0\fR\|(3) arrays via
- \&\s-1\fBOSSL_ALGORITHM\s0\fR\|(3) arrays that are returned by the provider's
- \&\fBprovider_query_operation()\fR function
- (see \*(L"Provider Functions\*(R" in \fBprovider\-base\fR\|(7)).
- .PP
- All these \*(L"functions\*(R" have a corresponding function type definition
- named \fBOSSL_FUNC_{name}_fn\fR, and a helper function to retrieve the
- function pointer from an \s-1\fBOSSL_DISPATCH\s0\fR\|(3) element named
- \&\fBOSSL_FUNC_{name}\fR.
- For example, the \*(L"function\*(R" \fBOSSL_FUNC_kdf_newctx()\fR has these:
- .PP
- .Vb 3
- \& typedef void *(OSSL_FUNC_kdf_newctx_fn)(void *provctx);
- \& static ossl_inline OSSL_FUNC_kdf_newctx_fn
- \& OSSL_FUNC_kdf_newctx(const OSSL_DISPATCH *opf);
- .Ve
- .PP
- \&\s-1\fBOSSL_DISPATCH\s0\fR\|(3) array entries are identified by numbers that are provided as
- macros in \fBopenssl\-core_dispatch.h\fR\|(7), as follows:
- .PP
- .Vb 3
- \& OSSL_FUNC_kdf_newctx OSSL_FUNC_KDF_NEWCTX
- \& OSSL_FUNC_kdf_freectx OSSL_FUNC_KDF_FREECTX
- \& OSSL_FUNC_kdf_dupctx OSSL_FUNC_KDF_DUPCTX
- \&
- \& OSSL_FUNC_kdf_reset OSSL_FUNC_KDF_RESET
- \& OSSL_FUNC_kdf_derive OSSL_FUNC_KDF_DERIVE
- \&
- \& OSSL_FUNC_kdf_get_params OSSL_FUNC_KDF_GET_PARAMS
- \& OSSL_FUNC_kdf_get_ctx_params OSSL_FUNC_KDF_GET_CTX_PARAMS
- \& OSSL_FUNC_kdf_set_ctx_params OSSL_FUNC_KDF_SET_CTX_PARAMS
- \&
- \& OSSL_FUNC_kdf_gettable_params OSSL_FUNC_KDF_GETTABLE_PARAMS
- \& OSSL_FUNC_kdf_gettable_ctx_params OSSL_FUNC_KDF_GETTABLE_CTX_PARAMS
- \& OSSL_FUNC_kdf_settable_ctx_params OSSL_FUNC_KDF_SETTABLE_CTX_PARAMS
- .Ve
- .PP
- A \s-1KDF\s0 algorithm implementation may not implement all of these functions.
- In order to be a consistent set of functions, at least the following functions
- must be implemented: \fBOSSL_FUNC_kdf_newctx()\fR, \fBOSSL_FUNC_kdf_freectx()\fR,
- \&\fBOSSL_FUNC_kdf_set_ctx_params()\fR, \fBOSSL_FUNC_kdf_derive()\fR.
- All other functions are optional.
- .SS "Context Management Functions"
- .IX Subsection "Context Management Functions"
- \&\fBOSSL_FUNC_kdf_newctx()\fR should create and return a pointer to a provider side
- structure for holding context information during a \s-1KDF\s0 operation.
- A pointer to this context will be passed back in a number of the other \s-1KDF\s0
- operation function calls.
- The parameter \fIprovctx\fR is the provider context generated during provider
- initialisation (see \fBprovider\fR\|(7)).
- .PP
- \&\fBOSSL_FUNC_kdf_freectx()\fR is passed a pointer to the provider side \s-1KDF\s0 context in
- the \fIkctx\fR parameter.
- If it receives \s-1NULL\s0 as \fIkctx\fR value, it should not do anything other than
- return.
- This function should free any resources associated with that context.
- .PP
- \&\fBOSSL_FUNC_kdf_dupctx()\fR should duplicate the provider side \s-1KDF\s0 context in the
- \&\fIkctx\fR parameter and return the duplicate copy.
- .SS "Encryption/Decryption Functions"
- .IX Subsection "Encryption/Decryption Functions"
- \&\fBOSSL_FUNC_kdf_reset()\fR initialises a \s-1KDF\s0 operation given a provider
- side \s-1KDF\s0 context in the \fIkctx\fR parameter.
- .PP
- \&\fBOSSL_FUNC_kdf_derive()\fR performs the \s-1KDF\s0 operation after processing the
- \&\fIparams\fR as per \fBOSSL_FUNC_kdf_set_ctx_params()\fR.
- The \fIkctx\fR parameter contains a pointer to the provider side context.
- The resulting key of the desired \fIkeylen\fR should be written to \fIkey\fR.
- If the algorithm does not support the requested \fIkeylen\fR the function must
- return error.
- .SS "\s-1KDF\s0 Parameters"
- .IX Subsection "KDF Parameters"
- See \s-1\fBOSSL_PARAM\s0\fR\|(3) for further details on the parameters structure used by
- these functions.
- .PP
- \&\fBOSSL_FUNC_kdf_get_params()\fR gets details of parameter values associated with the
- provider algorithm and stores them in \fIparams\fR.
- .PP
- \&\fBOSSL_FUNC_kdf_set_ctx_params()\fR sets \s-1KDF\s0 parameters associated with the given
- provider side \s-1KDF\s0 context \fIkctx\fR to \fIparams\fR.
- Any parameter settings are additional to any that were previously set.
- Passing \s-1NULL\s0 for \fIparams\fR should return true.
- .PP
- \&\fBOSSL_FUNC_kdf_get_ctx_params()\fR retrieves gettable parameter values associated
- with the given provider side \s-1KDF\s0 context \fIkctx\fR and stores them in \fIparams\fR.
- Passing \s-1NULL\s0 for \fIparams\fR should return true.
- .PP
- \&\fBOSSL_FUNC_kdf_gettable_params()\fR, \fBOSSL_FUNC_kdf_gettable_ctx_params()\fR,
- and \fBOSSL_FUNC_kdf_settable_ctx_params()\fR all return constant \s-1\fBOSSL_PARAM\s0\fR\|(3)
- arrays as descriptors of the parameters that \fBOSSL_FUNC_kdf_get_params()\fR,
- \&\fBOSSL_FUNC_kdf_get_ctx_params()\fR, and \fBOSSL_FUNC_kdf_set_ctx_params()\fR
- can handle, respectively. \fBOSSL_FUNC_kdf_gettable_ctx_params()\fR and
- \&\fBOSSL_FUNC_kdf_settable_ctx_params()\fR will return the parameters associated
- with the provider side context \fIkctx\fR in its current state if it is
- not \s-1NULL.\s0 Otherwise, they return the parameters associated with the
- provider side algorithm \fIprovctx\fR.
- .PP
- Parameters currently recognised by built-in KDFs are as follows. Not all
- parameters are relevant to, or are understood by all KDFs:
- .ie n .IP """size"" (\fB\s-1OSSL_KDF_PARAM_SIZE\s0\fR) <unsigned integer>" 4
- .el .IP "``size'' (\fB\s-1OSSL_KDF_PARAM_SIZE\s0\fR) <unsigned integer>" 4
- .IX Item "size (OSSL_KDF_PARAM_SIZE) <unsigned integer>"
- Gets the output size from the associated \s-1KDF\s0 ctx.
- If the algorithm produces a variable amount of output, \s-1SIZE_MAX\s0 should be
- returned.
- If the input parameters required to calculate the fixed output size have not yet
- been supplied, 0 should be returned indicating an error.
- .ie n .IP """key"" (\fB\s-1OSSL_KDF_PARAM_KEY\s0\fR) <octet string>" 4
- .el .IP "``key'' (\fB\s-1OSSL_KDF_PARAM_KEY\s0\fR) <octet string>" 4
- .IX Item "key (OSSL_KDF_PARAM_KEY) <octet string>"
- Sets the key in the associated \s-1KDF\s0 ctx.
- .ie n .IP """secret"" (\fB\s-1OSSL_KDF_PARAM_SECRET\s0\fR) <octet string>" 4
- .el .IP "``secret'' (\fB\s-1OSSL_KDF_PARAM_SECRET\s0\fR) <octet string>" 4
- .IX Item "secret (OSSL_KDF_PARAM_SECRET) <octet string>"
- Sets the secret in the associated \s-1KDF\s0 ctx.
- .ie n .IP """pass"" (\fB\s-1OSSL_KDF_PARAM_PASSWORD\s0\fR) <octet string>" 4
- .el .IP "``pass'' (\fB\s-1OSSL_KDF_PARAM_PASSWORD\s0\fR) <octet string>" 4
- .IX Item "pass (OSSL_KDF_PARAM_PASSWORD) <octet string>"
- Sets the password in the associated \s-1KDF\s0 ctx.
- .ie n .IP """cipher"" (\fB\s-1OSSL_KDF_PARAM_CIPHER\s0\fR) <\s-1UTF8\s0 string>" 4
- .el .IP "``cipher'' (\fB\s-1OSSL_KDF_PARAM_CIPHER\s0\fR) <\s-1UTF8\s0 string>" 4
- .IX Item "cipher (OSSL_KDF_PARAM_CIPHER) <UTF8 string>"
- .PD 0
- .ie n .IP """digest"" (\fB\s-1OSSL_KDF_PARAM_DIGEST\s0\fR) <\s-1UTF8\s0 string>" 4
- .el .IP "``digest'' (\fB\s-1OSSL_KDF_PARAM_DIGEST\s0\fR) <\s-1UTF8\s0 string>" 4
- .IX Item "digest (OSSL_KDF_PARAM_DIGEST) <UTF8 string>"
- .ie n .IP """mac"" (\fB\s-1OSSL_KDF_PARAM_MAC\s0\fR) <\s-1UTF8\s0 string>" 4
- .el .IP "``mac'' (\fB\s-1OSSL_KDF_PARAM_MAC\s0\fR) <\s-1UTF8\s0 string>" 4
- .IX Item "mac (OSSL_KDF_PARAM_MAC) <UTF8 string>"
- .PD
- Sets the name of the underlying cipher, digest or \s-1MAC\s0 to be used.
- It must name a suitable algorithm for the \s-1KDF\s0 that's being used.
- .ie n .IP """maclen"" (\fB\s-1OSSL_KDF_PARAM_MAC_SIZE\s0\fR) <octet string>" 4
- .el .IP "``maclen'' (\fB\s-1OSSL_KDF_PARAM_MAC_SIZE\s0\fR) <octet string>" 4
- .IX Item "maclen (OSSL_KDF_PARAM_MAC_SIZE) <octet string>"
- Sets the length of the \s-1MAC\s0 in the associated \s-1KDF\s0 ctx.
- .ie n .IP """properties"" (\fB\s-1OSSL_KDF_PARAM_PROPERTIES\s0\fR) <\s-1UTF8\s0 string>" 4
- .el .IP "``properties'' (\fB\s-1OSSL_KDF_PARAM_PROPERTIES\s0\fR) <\s-1UTF8\s0 string>" 4
- .IX Item "properties (OSSL_KDF_PARAM_PROPERTIES) <UTF8 string>"
- Sets the properties to be queried when trying to fetch the underlying algorithm.
- This must be given together with the algorithm naming parameter to be
- considered valid.
- .ie n .IP """iter"" (\fB\s-1OSSL_KDF_PARAM_ITER\s0\fR) <unsigned integer>" 4
- .el .IP "``iter'' (\fB\s-1OSSL_KDF_PARAM_ITER\s0\fR) <unsigned integer>" 4
- .IX Item "iter (OSSL_KDF_PARAM_ITER) <unsigned integer>"
- Sets the number of iterations in the associated \s-1KDF\s0 ctx.
- .ie n .IP """mode"" (\fB\s-1OSSL_KDF_PARAM_MODE\s0\fR) <\s-1UTF8\s0 string>" 4
- .el .IP "``mode'' (\fB\s-1OSSL_KDF_PARAM_MODE\s0\fR) <\s-1UTF8\s0 string>" 4
- .IX Item "mode (OSSL_KDF_PARAM_MODE) <UTF8 string>"
- Sets the mode in the associated \s-1KDF\s0 ctx.
- .ie n .IP """pkcs5"" (\fB\s-1OSSL_KDF_PARAM_PKCS5\s0\fR) <integer>" 4
- .el .IP "``pkcs5'' (\fB\s-1OSSL_KDF_PARAM_PKCS5\s0\fR) <integer>" 4
- .IX Item "pkcs5 (OSSL_KDF_PARAM_PKCS5) <integer>"
- Enables or disables the \s-1SP800\-132\s0 compliance checks.
- A mode of 0 enables the compliance checks.
- .Sp
- The checks performed are:
- .RS 4
- .IP "\- the iteration count is at least 1000." 4
- .IX Item "- the iteration count is at least 1000."
- .PD 0
- .IP "\- the salt length is at least 128 bits." 4
- .IX Item "- the salt length is at least 128 bits."
- .IP "\- the derived key length is at least 112 bits." 4
- .IX Item "- the derived key length is at least 112 bits."
- .RE
- .RS 4
- .RE
- .ie n .IP """ukm"" (\fB\s-1OSSL_KDF_PARAM_UKM\s0\fR) <octet string>" 4
- .el .IP "``ukm'' (\fB\s-1OSSL_KDF_PARAM_UKM\s0\fR) <octet string>" 4
- .IX Item "ukm (OSSL_KDF_PARAM_UKM) <octet string>"
- .PD
- Sets an optional random string that is provided by the sender called
- \&\*(L"partyAInfo\*(R". In \s-1CMS\s0 this is the user keying material.
- .ie n .IP """cekalg"" (\fB\s-1OSSL_KDF_PARAM_CEK_ALG\s0\fR) <\s-1UTF8\s0 string>" 4
- .el .IP "``cekalg'' (\fB\s-1OSSL_KDF_PARAM_CEK_ALG\s0\fR) <\s-1UTF8\s0 string>" 4
- .IX Item "cekalg (OSSL_KDF_PARAM_CEK_ALG) <UTF8 string>"
- Sets the \s-1CEK\s0 wrapping algorithm name in the associated \s-1KDF\s0 ctx.
- .ie n .IP """n"" (\fB\s-1OSSL_KDF_PARAM_SCRYPT_N\s0\fR) <unsigned integer>" 4
- .el .IP "``n'' (\fB\s-1OSSL_KDF_PARAM_SCRYPT_N\s0\fR) <unsigned integer>" 4
- .IX Item "n (OSSL_KDF_PARAM_SCRYPT_N) <unsigned integer>"
- Sets the scrypt work factor parameter N in the associated \s-1KDF\s0 ctx.
- .ie n .IP """r"" (\fB\s-1OSSL_KDF_PARAM_SCRYPT_R\s0\fR) <unsigned integer>" 4
- .el .IP "``r'' (\fB\s-1OSSL_KDF_PARAM_SCRYPT_R\s0\fR) <unsigned integer>" 4
- .IX Item "r (OSSL_KDF_PARAM_SCRYPT_R) <unsigned integer>"
- Sets the scrypt work factor parameter r in the associated \s-1KDF\s0 ctx.
- .ie n .IP """p"" (\fB\s-1OSSL_KDF_PARAM_SCRYPT_P\s0\fR) <unsigned integer>" 4
- .el .IP "``p'' (\fB\s-1OSSL_KDF_PARAM_SCRYPT_P\s0\fR) <unsigned integer>" 4
- .IX Item "p (OSSL_KDF_PARAM_SCRYPT_P) <unsigned integer>"
- Sets the scrypt work factor parameter p in the associated \s-1KDF\s0 ctx.
- .ie n .IP """maxmem_bytes"" (\fB\s-1OSSL_KDF_PARAM_SCRYPT_MAXMEM\s0\fR) <unsigned integer>" 4
- .el .IP "``maxmem_bytes'' (\fB\s-1OSSL_KDF_PARAM_SCRYPT_MAXMEM\s0\fR) <unsigned integer>" 4
- .IX Item "maxmem_bytes (OSSL_KDF_PARAM_SCRYPT_MAXMEM) <unsigned integer>"
- Sets the scrypt work factor parameter maxmem in the associated \s-1KDF\s0 ctx.
- .ie n .IP """prefix"" (\fB\s-1OSSL_KDF_PARAM_PREFIX\s0\fR) <octet string>" 4
- .el .IP "``prefix'' (\fB\s-1OSSL_KDF_PARAM_PREFIX\s0\fR) <octet string>" 4
- .IX Item "prefix (OSSL_KDF_PARAM_PREFIX) <octet string>"
- Sets the prefix string using by the \s-1TLS 1.3\s0 version of \s-1HKDF\s0 in the
- associated \s-1KDF\s0 ctx.
- .ie n .IP """label"" (\fB\s-1OSSL_KDF_PARAM_LABEL\s0\fR) <octet string>" 4
- .el .IP "``label'' (\fB\s-1OSSL_KDF_PARAM_LABEL\s0\fR) <octet string>" 4
- .IX Item "label (OSSL_KDF_PARAM_LABEL) <octet string>"
- Sets the label string using by the \s-1TLS 1.3\s0 version of \s-1HKDF\s0 in the
- associated \s-1KDF\s0 ctx.
- .ie n .IP """data"" (\fB\s-1OSSL_KDF_PARAM_DATA\s0\fR) <octet string>" 4
- .el .IP "``data'' (\fB\s-1OSSL_KDF_PARAM_DATA\s0\fR) <octet string>" 4
- .IX Item "data (OSSL_KDF_PARAM_DATA) <octet string>"
- Sets the context string using by the \s-1TLS 1.3\s0 version of \s-1HKDF\s0 in the
- associated \s-1KDF\s0 ctx.
- .ie n .IP """info"" (\fB\s-1OSSL_KDF_PARAM_INFO\s0\fR) <octet string>" 4
- .el .IP "``info'' (\fB\s-1OSSL_KDF_PARAM_INFO\s0\fR) <octet string>" 4
- .IX Item "info (OSSL_KDF_PARAM_INFO) <octet string>"
- Sets the optional shared info in the associated \s-1KDF\s0 ctx.
- .ie n .IP """seed"" (\fB\s-1OSSL_KDF_PARAM_SEED\s0\fR) <octet string>" 4
- .el .IP "``seed'' (\fB\s-1OSSL_KDF_PARAM_SEED\s0\fR) <octet string>" 4
- .IX Item "seed (OSSL_KDF_PARAM_SEED) <octet string>"
- Sets the \s-1IV\s0 in the associated \s-1KDF\s0 ctx.
- .ie n .IP """xcghash"" (\fB\s-1OSSL_KDF_PARAM_SSHKDF_XCGHASH\s0\fR) <octet string>" 4
- .el .IP "``xcghash'' (\fB\s-1OSSL_KDF_PARAM_SSHKDF_XCGHASH\s0\fR) <octet string>" 4
- .IX Item "xcghash (OSSL_KDF_PARAM_SSHKDF_XCGHASH) <octet string>"
- Sets the xcghash in the associated \s-1KDF\s0 ctx.
- .ie n .IP """session_id"" (\fB\s-1OSSL_KDF_PARAM_SSHKDF_SESSION_ID\s0\fR) <octet string>" 4
- .el .IP "``session_id'' (\fB\s-1OSSL_KDF_PARAM_SSHKDF_SESSION_ID\s0\fR) <octet string>" 4
- .IX Item "session_id (OSSL_KDF_PARAM_SSHKDF_SESSION_ID) <octet string>"
- Sets the session \s-1ID\s0 in the associated \s-1KDF\s0 ctx.
- .ie n .IP """type"" (\fB\s-1OSSL_KDF_PARAM_SSHKDF_TYPE\s0\fR) <\s-1UTF8\s0 string>" 4
- .el .IP "``type'' (\fB\s-1OSSL_KDF_PARAM_SSHKDF_TYPE\s0\fR) <\s-1UTF8\s0 string>" 4
- .IX Item "type (OSSL_KDF_PARAM_SSHKDF_TYPE) <UTF8 string>"
- Sets the \s-1SSH KDF\s0 type parameter in the associated \s-1KDF\s0 ctx.
- There are six supported types:
- .RS 4
- .IP "\s-1EVP_KDF_SSHKDF_TYPE_INITIAL_IV_CLI_TO_SRV\s0" 4
- .IX Item "EVP_KDF_SSHKDF_TYPE_INITIAL_IV_CLI_TO_SRV"
- The Initial \s-1IV\s0 from client to server.
- A single char of value 65 (\s-1ASCII\s0 char 'A').
- .IP "\s-1EVP_KDF_SSHKDF_TYPE_INITIAL_IV_SRV_TO_CLI\s0" 4
- .IX Item "EVP_KDF_SSHKDF_TYPE_INITIAL_IV_SRV_TO_CLI"
- The Initial \s-1IV\s0 from server to client
- A single char of value 66 (\s-1ASCII\s0 char 'B').
- .IP "\s-1EVP_KDF_SSHKDF_TYPE_ENCRYPTION_KEY_CLI_TO_SRV\s0" 4
- .IX Item "EVP_KDF_SSHKDF_TYPE_ENCRYPTION_KEY_CLI_TO_SRV"
- The Encryption Key from client to server
- A single char of value 67 (\s-1ASCII\s0 char 'C').
- .IP "\s-1EVP_KDF_SSHKDF_TYPE_ENCRYPTION_KEY_SRV_TO_CLI\s0" 4
- .IX Item "EVP_KDF_SSHKDF_TYPE_ENCRYPTION_KEY_SRV_TO_CLI"
- The Encryption Key from server to client
- A single char of value 68 (\s-1ASCII\s0 char 'D').
- .IP "\s-1EVP_KDF_SSHKDF_TYPE_INTEGRITY_KEY_CLI_TO_SRV\s0" 4
- .IX Item "EVP_KDF_SSHKDF_TYPE_INTEGRITY_KEY_CLI_TO_SRV"
- The Integrity Key from client to server
- A single char of value 69 (\s-1ASCII\s0 char 'E').
- .IP "\s-1EVP_KDF_SSHKDF_TYPE_INTEGRITY_KEY_SRV_TO_CLI\s0" 4
- .IX Item "EVP_KDF_SSHKDF_TYPE_INTEGRITY_KEY_SRV_TO_CLI"
- The Integrity Key from client to server
- A single char of value 70 (\s-1ASCII\s0 char 'F').
- .RE
- .RS 4
- .RE
- .ie n .IP """constant"" (\fB\s-1OSSL_KDF_PARAM_CONSTANT\s0\fR) <octet string>" 4
- .el .IP "``constant'' (\fB\s-1OSSL_KDF_PARAM_CONSTANT\s0\fR) <octet string>" 4
- .IX Item "constant (OSSL_KDF_PARAM_CONSTANT) <octet string>"
- Sets the constant value in the associated \s-1KDF\s0 ctx.
- .ie n .IP """id"" (\fB\s-1OSSL_KDF_PARAM_PKCS12_ID\s0\fR) <integer>" 4
- .el .IP "``id'' (\fB\s-1OSSL_KDF_PARAM_PKCS12_ID\s0\fR) <integer>" 4
- .IX Item "id (OSSL_KDF_PARAM_PKCS12_ID) <integer>"
- Sets the intended usage of the output bits in the associated \s-1KDF\s0 ctx.
- It is defined as per \s-1RFC 7292\s0 section B.3.
- .SH "RETURN VALUES"
- .IX Header "RETURN VALUES"
- \&\fBOSSL_FUNC_kdf_newctx()\fR and \fBOSSL_FUNC_kdf_dupctx()\fR should return the newly created
- provider side \s-1KDF\s0 context, or \s-1NULL\s0 on failure.
- .PP
- \&\fBOSSL_FUNC_kdf_derive()\fR, \fBOSSL_FUNC_kdf_get_params()\fR,
- \&\fBOSSL_FUNC_kdf_get_ctx_params()\fR and \fBOSSL_FUNC_kdf_set_ctx_params()\fR should return 1 for
- success or 0 on error.
- .PP
- \&\fBOSSL_FUNC_kdf_gettable_params()\fR, \fBOSSL_FUNC_kdf_gettable_ctx_params()\fR and
- \&\fBOSSL_FUNC_kdf_settable_ctx_params()\fR should return a constant \s-1\fBOSSL_PARAM\s0\fR\|(3)
- array, or \s-1NULL\s0 if none is offered.
- .SH "NOTES"
- .IX Header "NOTES"
- The \s-1KDF\s0 life-cycle is described in \fBlife_cycle\-kdf\fR\|(7). Providers should
- ensure that the various transitions listed there are supported. At some point
- the \s-1EVP\s0 layer will begin enforcing the listed transitions.
- .SH "SEE ALSO"
- .IX Header "SEE ALSO"
- \&\fBprovider\fR\|(7), \fBlife_cycle\-kdf\fR\|(7), \s-1\fBEVP_KDF\s0\fR\|(3).
- .SH "HISTORY"
- .IX Header "HISTORY"
- The provider \s-1KDF\s0 interface was introduced in OpenSSL 3.0.
- .SH "COPYRIGHT"
- .IX Header "COPYRIGHT"
- Copyright 2020\-2022 The OpenSSL Project Authors. All Rights Reserved.
- .PP
- 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>.
|