Latest update (add quic)
This commit is contained in:
+16
-16
@@ -66,7 +66,7 @@ This parameter sets an optional value for fixedinfo, also known as otherinfo.
|
||||
A context for SSKDF can be obtained by calling:
|
||||
|
||||
EVP_KDF *kdf = EVP_KDF_fetch(NULL, "SSKDF", NULL);
|
||||
EVP_KDF_CTX *kctx = EVP_KDF_CTX_new(kdf);
|
||||
EVP_KDF_CTX *kctx = EVP_KDF_new_ctx(kdf);
|
||||
|
||||
The output length of an SSKDF is specified via the I<keylen>
|
||||
parameter to the L<EVP_KDF_derive(3)> function.
|
||||
@@ -82,7 +82,7 @@ and fixedinfo value "label":
|
||||
OSSL_PARAM params[4], *p = params;
|
||||
|
||||
kdf = EVP_KDF_fetch(NULL, "SSKDF", NULL);
|
||||
kctx = EVP_KDF_CTX_new(kdf);
|
||||
kctx = EVP_KDF_new_ctx(kdf);
|
||||
EVP_KDF_free(kdf);
|
||||
|
||||
*p++ = OSSL_PARAM_construct_utf8_string(OSSL_KDF_PARAM_DIGEST,
|
||||
@@ -92,14 +92,14 @@ and fixedinfo value "label":
|
||||
*p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_INFO,
|
||||
"label", (size_t)5);
|
||||
*p = OSSL_PARAM_construct_end();
|
||||
if (EVP_KDF_CTX_set_params(kctx, params) <= 0) {
|
||||
error("EVP_KDF_CTX_set_params");
|
||||
if (EVP_KDF_set_ctx_params(kctx, params) <= 0) {
|
||||
error("EVP_KDF_set_ctx_params");
|
||||
}
|
||||
if (EVP_KDF_derive(kctx, out, sizeof(out)) <= 0) {
|
||||
error("EVP_KDF_derive");
|
||||
}
|
||||
|
||||
EVP_KDF_CTX_free(kctx);
|
||||
EVP_KDF_free_ctx(kctx);
|
||||
|
||||
This example derives 10 bytes using H(x) = HMAC(SHA-256), with the secret key "secret",
|
||||
fixedinfo value "label" and salt "salt":
|
||||
@@ -110,7 +110,7 @@ fixedinfo value "label" and salt "salt":
|
||||
OSSL_PARAM params[6], *p = params;
|
||||
|
||||
kdf = EVP_KDF_fetch(NULL, "SSKDF", NULL);
|
||||
kctx = EVP_KDF_CTX_new(kdf);
|
||||
kctx = EVP_KDF_new_ctx(kdf);
|
||||
EVP_KDF_free(kdf);
|
||||
|
||||
*p++ = OSSL_PARAM_construct_utf8_string(OSSL_KDF_PARAM_MAC,
|
||||
@@ -124,14 +124,14 @@ fixedinfo value "label" and salt "salt":
|
||||
*p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_SALT,
|
||||
"salt", (size_t)4);
|
||||
*p = OSSL_PARAM_construct_end();
|
||||
if (EVP_KDF_CTX_set_params(kctx, params) <= 0) {
|
||||
error("EVP_KDF_CTX_set_params");
|
||||
if (EVP_KDF_set_ctx_params(kctx, params) <= 0) {
|
||||
error("EVP_KDF_set_ctx_params");
|
||||
}
|
||||
if (EVP_KDF_derive(kctx, out, sizeof(out)) <= 0) {
|
||||
error("EVP_KDF_derive");
|
||||
}
|
||||
|
||||
EVP_KDF_CTX_free(kctx);
|
||||
EVP_KDF_free_ctx(kctx);
|
||||
|
||||
This example derives 10 bytes using H(x) = KMAC128(x,salt,outlen), with the secret key "secret"
|
||||
fixedinfo value "label", salt of "salt" and KMAC outlen of 20:
|
||||
@@ -142,7 +142,7 @@ fixedinfo value "label", salt of "salt" and KMAC outlen of 20:
|
||||
OSSL_PARAM params[7], *p = params;
|
||||
|
||||
kdf = EVP_KDF_fetch(NULL, "SSKDF", NULL);
|
||||
kctx = EVP_KDF_CTX_new(kdf);
|
||||
kctx = EVP_KDF_new_ctx(kdf);
|
||||
EVP_KDF_free(kdf);
|
||||
|
||||
*p++ = OSSL_PARAM_construct_utf8_string(OSSL_KDF_PARAM_MAC,
|
||||
@@ -157,14 +157,14 @@ fixedinfo value "label", salt of "salt" and KMAC outlen of 20:
|
||||
"salt", (size_t)4);
|
||||
*p++ = OSSL_PARAM_construct_size_t(OSSL_KDF_PARAM_MAC_SIZE, (size_t)20);
|
||||
*p = OSSL_PARAM_construct_end();
|
||||
if (EVP_KDF_CTX_set_params(kctx, params) <= 0) {
|
||||
error("EVP_KDF_CTX_set_params");
|
||||
if (EVP_KDF_set_ctx_params(kctx, params) <= 0) {
|
||||
error("EVP_KDF_set_ctx_params");
|
||||
}
|
||||
if (EVP_KDF_derive(kctx, out, sizeof(out)) <= 0) {
|
||||
error("EVP_KDF_derive");
|
||||
}
|
||||
|
||||
EVP_KDF_CTX_free(kctx);
|
||||
EVP_KDF_free_ctx(kctx);
|
||||
|
||||
=head1 CONFORMING TO
|
||||
|
||||
@@ -173,9 +173,9 @@ NIST SP800-56Cr1.
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<EVP_KDF(3)>,
|
||||
L<EVP_KDF_CTX_new(3)>,
|
||||
L<EVP_KDF_CTX_free(3)>,
|
||||
L<EVP_KDF_CTX_set_params(3)>,
|
||||
L<EVP_KDF_new_ctx(3)>,
|
||||
L<EVP_KDF_free_ctx(3)>,
|
||||
L<EVP_KDF_set_ctx_params(3)>,
|
||||
L<EVP_KDF_size(3)>,
|
||||
L<EVP_KDF_derive(3)>,
|
||||
L<EVP_KDF(3)/PARAMETERS>
|
||||
|
||||
Reference in New Issue
Block a user