ctx->meth->reset(ctx->data);
}
-size_t EVP_KDF_size(EVP_KDF_CTX *ctx)
+size_t EVP_KDF_CTX_get_kdf_size(EVP_KDF_CTX *ctx)
{
OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
size_t s;
EVP_KDF, EVP_KDF_fetch, EVP_KDF_free, EVP_KDF_up_ref,
EVP_KDF_CTX, EVP_KDF_CTX_new, EVP_KDF_CTX_free, EVP_KDF_CTX_dup,
-EVP_KDF_reset, EVP_KDF_derive,
-EVP_KDF_size, EVP_KDF_provider, EVP_KDF_CTX_kdf, EVP_KDF_is_a,
+EVP_KDF_CTX_reset, EVP_KDF_derive,
+EVP_KDF_CTX_get_kdf_size, EVP_KDF_provider, EVP_KDF_CTX_kdf, EVP_KDF_is_a,
EVP_KDF_number, EVP_KDF_name, EVP_KDF_names_do_all,
EVP_KDF_CTX_get_params, EVP_KDF_CTX_set_params, EVP_KDF_do_all_provided,
EVP_KDF_get_params, EVP_KDF_gettable_ctx_params, EVP_KDF_settable_ctx_params,
const EVP_KDF *EVP_KDF_CTX_kdf(EVP_KDF_CTX *ctx);
void EVP_KDF_CTX_free(EVP_KDF_CTX *ctx);
EVP_KDF_CTX *EVP_KDF_CTX_dup(const EVP_KDF_CTX *src);
- void EVP_KDF_reset(EVP_KDF_CTX *ctx);
- size_t EVP_KDF_size(EVP_KDF_CTX *ctx);
+ void EVP_KDF_CTX_reset(EVP_KDF_CTX *ctx);
+ size_t EVP_KDF_CTX_get_kdf_size(EVP_KDF_CTX *ctx);
int EVP_KDF_derive(EVP_KDF_CTX *ctx, unsigned char *key, size_t keylen);
int EVP_KDF_up_ref(EVP_KDF *kdf);
void EVP_KDF_free(EVP_KDF *kdf);
EVP_KDF_derive() derives I<keylen> bytes of key material and places it in the
I<key> buffer. If the algorithm produces a fixed amount of output then an
error will occur unless the I<keylen> parameter is equal to that output size,
-as returned by EVP_KDF_size().
+as returned by EVP_KDF_CTX_get_kdf_size().
EVP_KDF_get_params() retrieves details about the implementation
I<kdf>.
=head2 Information functions
-EVP_KDF_size() returns the output size if the algorithm produces a fixed amount
+EVP_KDF_CTX_get_kdf_size() returns the output size if the algorithm produces a fixed amount
of output and B<SIZE_MAX> otherwise. If an error occurs then 0 is returned.
For some algorithms an error may result if input parameters necessary to
calculate a fixed output size have not yet been supplied.
EVP_KDF_CTX_free() and EVP_KDF_reset() do not return a value.
-EVP_KDF_size() returns the output size. B<SIZE_MAX> is returned to indicate
+EVP_KDF_CTX_get_kdf_size() returns the output size. B<SIZE_MAX> is returned to indicate
that the algorithm produces a variable amount of output; 0 to indicate failure.
EVP_KDF_name() returns the name of the KDF, or NULL on error.
In this mode calling L<EVP_KDF_derive(3)> will just perform the extract
operation. The value returned will be the intermediate fixed-length pseudorandom
key K. The I<keylen> parameter must match the size of K, which can be looked
-up by calling EVP_KDF_size() after setting the mode and digest.
+up by calling EVP_KDF_CTX_get_kdf_size() after setting the mode and digest.
The digest, key and salt values must be set before a key is derived otherwise
an error will occur.
parameter to the L<EVP_KDF_derive(3)> function. When using
EVP_KDF_HKDF_MODE_EXTRACT_ONLY the I<keylen> parameter must equal the size of
the intermediate fixed-length pseudorandom key otherwise an error will occur.
-For that mode, the fixed output size can be looked up by calling EVP_KDF_size()
+For that mode, the fixed output size can be looked up by calling EVP_KDF_CTX_get_kdf_size()
after setting the mode and digest on the B<EVP_KDF_CTX>.
=head1 EXAMPLES
L<EVP_KDF(3)>,
L<EVP_KDF_CTX_new(3)>,
L<EVP_KDF_CTX_free(3)>,
-L<EVP_KDF_size(3)>,
+L<EVP_KDF_CTX_get_kdf_size(3)>,
L<EVP_KDF_CTX_set_params(3)>,
L<EVP_KDF_derive(3)>,
L<EVP_KDF(3)/PARAMETERS>
L<EVP_KDF(3)>,
L<EVP_KDF_CTX_free(3)>,
-L<EVP_KDF_size(3)>,
+L<EVP_KDF_CTX_get_kdf_size(3)>,
L<EVP_KDF_derive(3)>,
L<EVP_KDF(3)/PARAMETERS>
length for the chosen cipher or an error is returned. Moreover, the
constant's length must not exceed the block size of the cipher.
Since the KRB5KDF output length depends on the chosen cipher, calling
-L<EVP_KDF_size(3)> to obtain the requisite length returns the correct length
+L<EVP_KDF_CTX_get_kdf_size(3)> to obtain the requisite length returns the correct length
only after the cipher is set. Prior to that B<EVP_MAX_KEY_LENGTH> is returned.
The caller must allocate a buffer of the correct length for the chosen
cipher, and pass that buffer to the L<EVP_KDF_derive(3)> function along
L<EVP_KDF(3)>,
L<EVP_KDF_CTX_free(3)>,
L<EVP_KDF_ctrl(3)>,
-L<EVP_KDF_size(3)>,
+L<EVP_KDF_CTX_get_kdf_size(3)>,
L<EVP_KDF_derive(3)>,
L<EVP_KDF(3)/PARAMETERS>
L<EVP_KDF_CTX_new(3)>,
L<EVP_KDF_CTX_free(3)>,
L<EVP_KDF_CTX_set_params(3)>,
-L<EVP_KDF_size(3)>,
+L<EVP_KDF_CTX_get_kdf_size(3)>,
L<EVP_KDF_derive(3)>,
L<EVP_KDF(3)/PARAMETERS>
The output length of the SSHKDF derivation is specified via the I<keylen>
parameter to the L<EVP_KDF_derive(3)> function.
-Since the SSHKDF output length is variable, calling L<EVP_KDF_size(3)>
+Since the SSHKDF output length is variable, calling L<EVP_KDF_CTX_get_kdf_size(3)>
to obtain the requisite length is not meaningful. The caller must
allocate a buffer of the desired length, and pass that buffer to the
L<EVP_KDF_derive(3)> function along with the desired length.
L<EVP_KDF_CTX_new(3)>,
L<EVP_KDF_CTX_free(3)>,
L<EVP_KDF_CTX_set_params(3)>,
-L<EVP_KDF_size(3)>,
+L<EVP_KDF_CTX_get_kdf_size(3)>,
L<EVP_KDF_derive(3)>,
L<EVP_KDF(3)/PARAMETERS>
L<EVP_KDF_CTX_new(3)>,
L<EVP_KDF_CTX_free(3)>,
L<EVP_KDF_CTX_set_params(3)>,
-L<EVP_KDF_size(3)>,
+L<EVP_KDF_CTX_get_kdf_size(3)>,
L<EVP_KDF_derive(3)>,
L<EVP_KDF(3)/PARAMETERS>
L<EVP_KDF_CTX_new(3)>,
L<EVP_KDF_CTX_free(3)>,
L<EVP_KDF_CTX_set_params(3)>,
-L<EVP_KDF_size(3)>,
+L<EVP_KDF_CTX_get_kdf_size(3)>,
L<EVP_KDF_derive(3)>,
L<EVP_KDF(3)/PARAMETERS>
const OSSL_PROVIDER *EVP_KDF_provider(const EVP_KDF *kdf);
const EVP_KDF *EVP_KDF_CTX_kdf(EVP_KDF_CTX *ctx);
-void EVP_KDF_reset(EVP_KDF_CTX *ctx);
-size_t EVP_KDF_size(EVP_KDF_CTX *ctx);
+void EVP_KDF_CTX_reset(EVP_KDF_CTX *ctx);
+size_t EVP_KDF_CTX_get_kdf_size(EVP_KDF_CTX *ctx);
int EVP_KDF_derive(EVP_KDF_CTX *ctx, unsigned char *key, size_t keylen);
int EVP_KDF_get_params(EVP_KDF *kdf, OSSL_PARAM params[]);
int EVP_KDF_CTX_get_params(EVP_KDF_CTX *ctx, OSSL_PARAM params[]);