EVP_MD_CTX *EVP_MD_CTX_new(void);
int EVP_MD_CTX_reset(EVP_MD_CTX *ctx);
void EVP_MD_CTX_free(EVP_MD_CTX *ctx);
void EVP_MD_CTX_ctrl(EVP_MD_CTX *ctx, int cmd, int p1, void* p2);
void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags);
void EVP_MD_CTX_clear_flags(EVP_MD_CTX *ctx, int flags);
int EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx, int flags);
int EVP_Digest(const void *data, size_t count, unsigned char *md,
unsigned int *size, const EVP_MD *type, ENGINE *impl);
int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl);
int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d, size_t cnt);
int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s);
int EVP_DigestFinalXOF(EVP_MD_CTX *ctx, unsigned char *md, size_t len);
int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in);
int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type);
int EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s);
int EVP_MD_CTX_copy(EVP_MD_CTX *out, EVP_MD_CTX *in);
int EVP_MD_type(const EVP_MD *md);
int EVP_MD_pkey_type(const EVP_MD *md);
int EVP_MD_size(const EVP_MD *md);
int EVP_MD_block_size(const EVP_MD *md);
unsigned long EVP_MD_flags(const EVP_MD *md);
const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx);
int EVP_MD_CTX_size(const EVP_MD_CTX *ctx);
int EVP_MD_CTX_block_size(const EVP_MD_CTX *ctx);
int EVP_MD_CTX_type(const EVP_MD_CTX *ctx);
void *EVP_MD_CTX_md_data(const EVP_MD_CTX *ctx);
int (*EVP_MD_CTX_update_fn(EVP_MD_CTX *ctx))(EVP_MD_CTX *ctx,
const void *data, size_t count);
void EVP_MD_CTX_set_update_fn(EVP_MD_CTX *ctx,
int (*update)(EVP_MD_CTX *ctx,
const void *data, size_t count));
Performs digest-specific control actions on context ctx. The control command
is indicated in cmd and any additional arguments in p1 and p2.
EVP_MD_CTX_ctrl() must be called after EVP_DigestInit_ex(). Other restrictions
may apply depending on the control type and digest implementation.
See CONTROLS below for more information.
A wrapper around the Digest Init_ex, Update and Final_ex functions.
Hashes count bytes of data at data using a digest type from ENGINE
impl. The digest value is placed in md and its length is written at size
if the pointer is not NULL. At most EVP_MAX_MD_SIZE bytes will be written.
If impl is NULL the default implementation of digest type is used.
Sets up digest context ctx to use a digest type from ENGINE impl.
type will typically be supplied by a function such as EVP_sha1(). If
impl is NULL then the default implementation of digest type is used.
Retrieves the digest value from ctx and places it in md. If the s
parameter is not NULL then the number of bytes of data written (i.e. the
length of the digest) will be written to the integer at s, at most
EVP_MAX_MD_SIZE bytes will be written. After calling EVP_DigestFinal_ex()
no additional calls to EVP_DigestUpdate() can be made, but
EVP_DigestInit_ex() can be called to initialize a new digest operation.
Interfaces to extendable-output functions, XOFs, such as SHAKE128 and SHAKE256.
It retrieves the digest value from ctx and places it in len-sized <B>md.
After calling this function no additional calls to EVP_DigestUpdate() can be
made, but EVP_DigestInit_ex() can be called to initialize a new operation.
Can be used to copy the message digest state from in to out. This is
useful if large amounts of data are to be hashed which only differ in the last
few bytes.
Return the NID of the OBJECT IDENTIFIER representing the given message digest
when passed an EVP_MD structure. For example, EVP_MD_type(EVP_sha1())
returns NID_sha1. This function is normally used when setting ASN1 OIDs.
Return the digest method private data for the passed EVP_MD_CTX.
The space is allocated by OpenSSL and has the size originally set with
EVP_MD_meth_set_app_datasize().
Sets the update function for ctx to update.
This is the function that is called by EVP_DigestUpdate. If not set, the
update function from the EVP_MD type specified at initialization is used.
Returns the NID of the public key signing algorithm associated with this
digest. For example EVP_sha1() is associated with RSA so this will return
NID_sha1WithRSAEncryption. Since digests and signature algorithms are no
longer linked this function is only retained for compatibility reasons.
Assigns an EVP_PKEY_CTX to EVP_MD_CTX. This is usually used to provide
a customized EVP_PKEY_CTX to EVP_DigestSignInit(3) or
EVP_DigestVerifyInit(3). The pctx passed to this function should be freed
by the caller. A NULL pctx pointer is also allowed to clear the EVP_PKEY_CTX
assigned to ctx. In such case, freeing the cleared EVP_PKEY_CTX or not
depends on how the EVP_PKEY_CTX is created.
Gets the digest Message Integrity Check algorithm string. This is used when
creating S/MIME multipart/signed messages, as specified in RFC 3851.
The string value is written to p2.
This control sets the digest length for extendable output functions to p1.
Sending this control directly should not be necessary, the use of
EVP_DigestFinalXOF() is preferred.
Currently used by SHAKE.
Some functions such as EVP_DigestSign only finalise copies of internal
contexts so additional data can be included after the finalisation call.
This is inefficient if this functionality is not required, and can be
disabled with this flag.
The EVP interface to message digests should almost always be used in
preference to the low-level interfaces. This is because the code then becomes
transparent to the digest used and much more flexible.
New applications should use the SHA-2 (such as EVP_sha256(3)) or the SHA-3
digest algorithms (such as EVP_sha3_512(3)). The other digest algorithms
are still in common use.
For most applications the impl parameter to EVP_DigestInit_ex() will be
set to NULL to use the default digest implementation.
Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the OpenSSL license (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.