EVP_KDF-X963(7SSL)
π EVP_KDF-X963 β the X9.63-2001 EVP_KDF implementation π
okay bestie, this is EVP_KDF-X963(7SSL), straight out of the OpenSSL man pages. yes it's a section 7 page for SSL. yes it's iconic. let's go π«Ά
β¨ NAME β¨
EVP_KDF-X963 β the X9.63-2001 EVP_KDF implementation, fr fr.
πΈ DESCRIPTION πΈ
So the EVP_KDF-X963 algorithm implements the key derivation function, aka X963KDF. X963KDF is what Cryptographic Message Syntax (CMS) uses for EC KeyAgreement, deriving a key from input like a shared secret key and shared info. It's also the moment for SM2 encryption and decryption operations. π
The output is considered to be keying material. that's the whole point bestie.
π Identity π
"X963KDF" is THE name for this implementation β that's the glow-up it goes by. You can use it with the EVP_KDF_fetch() function. iykyk β¨
π¦ Supported parameters π¦
The supported parameters are, in order, no skips:
"properties"(OSSL_KDF_PARAM_PROPERTIES) <UTF8 string>"digest"(OSSL_KDF_PARAM_DIGEST) <UTF8 string>
These two parameters work exactly as described in "PARAMETERS" in EVP_KDF(3). go read that one too, bestie.
"key"(OSSL_KDF_PARAM_KEY) <octet string> β the shared secret used for key derivation. This parameter sets the secret. π"info"(OSSL_KDF_PARAM_INFO) <octet string> β this parameter specifies an optional value for shared info.
The OpenSSL FIPS provider also supports the following parameters (yes, there's extra lore):
"fips-indicator"(OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR) <integer> β a getter that returns1if the operation is FIPS approved, or0otherwise. This may be used after callingEVP_KDF_derive. It returns0if any"***-check"related parameter is set to0and the check fails."digest-check"(OSSL_KDF_PARAM_FIPS_DIGEST_CHECK) <int> β the default value of1causes an error duringEVP_KDF_CTX_set_params()if the used digest is not approved. Setting this to zero will ignore the error and set the approved"fips-indicator"to0. This option breaks FIPS compliance if it causes the approved"fips-indicator"to return0. π
According to ANSI X9.63-2001, the following are approved digest algorithms: SHA2-224, SHA2-256, SHA2-384, SHA2-512, SHA2-512/224, SHA2-512/256, SHA3-224, SHA3-256, SHA3-384, SHA3-512. periodt.
"key-check"(OSSL_KDF_PARAM_FIPS_KEY_CHECK) <integer> β the default value of1causes an error duringEVP_KDF_CTX_set_params()if the length of the used key-derivation key (OSSL_KDF_PARAM_KEY) is shorter than 112 bits. Setting this to zero will ignore the error and set the approved"fips-indicator"to0. This option breaks FIPS compliance if it causes the approved"fips-indicator"to return0. π«
π NOTES π
X963KDF is very similar to the SSKDF that uses a digest as the auxiliary function β the tea is that X963KDF appends the counter to the secret, whereas SSKDF prepends the counter. that's the whole difference, bestie, write it down π
A context for X963KDF can be obtained by calling:
EVP_KDF *kdf = EVP_KDF_fetch(NULL, "X963KDF", NULL);
EVP_KDF_CTX *kctx = EVP_KDF_CTX_new(kdf);
The output length of an X963KDF is specified via the keylen parameter to the EVP_KDF_derive(3) function. slay.
π₯ EXAMPLES π₯
This example derives 10 bytes, with the secret key "secret" and sharedinfo value "label":
EVP_KDF *kdf;
EVP_KDF_CTX *kctx;
unsigned char out[10];
OSSL_PARAM params[4], *p = params;
kdf = EVP_KDF_fetch(NULL, "X963KDF", NULL);
kctx = EVP_KDF_CTX_new(kdf);
EVP_KDF_free(kdf);
*p++ = OSSL_PARAM_construct_utf8_string(OSSL_KDF_PARAM_DIGEST,
SN_sha256, strlen(SN_sha256));
*p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_SECRET,
"secret", (size_t)6);
*p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_INFO,
"label", (size_t)5);
*p = OSSL_PARAM_construct_end();
if (EVP_KDF_derive(kctx, out, sizeof(out), params) <= 0) {
error("EVP_KDF_derive");
}
EVP_KDF_CTX_free(kctx);
look at her go π β¨
π CONFORMING TO π
"SEC 1: Elliptic Curve Cryptography"
π SEE ALSO π
EVP_KDF(3), EVP_KDF_CTX_new(3), EVP_KDF_CTX_free(3), EVP_KDF_CTX_set_params(3), EVP_KDF_CTX_get_kdf_size(3), EVP_KDF_derive(3), "PARAMETERS" in EVP_KDF(3)
go read all of those too, bestie, they're the supporting cast π«Ά
π§ HISTORY π§
This functionality was added in OpenSSL 3.0. she's not new new but she ATE.
π COPYRIGHT π
Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
and that's the whole page, bestie! πβ¨ππ¦πΈπ π«Ά
this was EVP_KDF-X963(7SSL) from the OpenSSL docs β version 4.0.3, dated 2026-09-29. no cap, that's a wrap. ππ
π¦ where this page comes from
- ubuntu stonking: openssl 4.0.3-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms