OpenBSD manual page server

Manual Page Search Parameters

EVP_MD_NID(3) Library Functions Manual EVP_MD_NID(3)

EVP_MD_nid, EVP_MD_type, EVP_MD_CTX_type, EVP_MD_name, EVP_MD_size, EVP_MD_CTX_size, EVP_MD_block_size, EVP_MD_CTX_block_size, EVP_MD_flags, EVP_MD_pkey_typeinspect EVP_MD objects

#include <openssl/evp.h>

EVP_MD_nid(const EVP_MD *md);

EVP_MD_type(const EVP_MD *md);

EVP_MD_CTX_type(const EVP_MD_CTX *ctx);

const char *
EVP_MD_name(const EVP_MD *md);

EVP_MD_size(const EVP_MD *md);

EVP_MD_CTX_size(const EVP_MD_CTX *ctx);

EVP_MD_block_size(const EVP_MD *md);

EVP_MD_CTX_block_size(const EVP_MD_CTX *ctx);

unsigned long
EVP_MD_flags(const EVP_MD *md);

EVP_MD_pkey_type(const EVP_MD *md);

() and () are identical and return the numerical identifier (NID) of md. The NID is an internal value which may or may not have a corresponding ASN.1 OBJECT IDENTIFIER; see OBJ_nid2obj(3) for details. For example , EVP_MD_type(EVP_sha512()) returns NID_sha512. EVP_MD_CTX_type() returns the NID of the message digest algorithm that ctx is configured to use. These functions are normally used when setting ASN.1 OIDs.

() converts the NID of md to its short name with OBJ_nid2sn(3).

() returns the size in bytes of the message digests (hashes) produced by md. () return the size of the hashes produced by the message digest algorithm that ctx is configured to use.

() returns the block size in bytes of md. () returns the block size of the message digest algorithm that ctx is configured to use.

() returns the message digest flags used by md. The meaning of the flags is described in the EVP_MD_meth_set_flags(3) manual page. Be careful to not confuse these flags with the unrelated message digest context flags that can be inspected with EVP_MD_CTX_test_flags(3).

() returns the NID of the public key signing algorithm associated with this digest. For example, EVP_sha512(3) is associated with RSA, so this returns NID_sha512WithRSAEncryption. Since digests and signature algorithms are no longer linked, this function is only retained for compatibility reasons.

(), (), EVP_MD_name(), EVP_MD_CTX_size(), and EVP_MD_CTX_block_size() are implemented as macros.

EVP_MD_nid(), EVP_MD_type(), EVP_MD_CTX_type(), and EVP_MD_pkey_type() return the NID of the corresponding OBJECT IDENTIFIER or NID_undef if none exists.

EVP_MD_name() returns a pointer to a string that is owned by an internal library object or NULL if the NID is neither built into the library nor added to the global object table by one of the functions documented in the manual page OBJ_create(3), or if the object does not contain a short name.

EVP_MD_size(), EVP_MD_CTX_size(), EVP_MD_block_size(), and EVP_MD_CTX_block_size() return the digest or block size in bytes.

evp(3), EVP_DigestInit(3), EVP_MD_CTX_ctrl(3), OBJ_nid2obj(3)

EVP_MD_size() first appeared in SSLeay 0.6.6, EVP_MD_CTX_size() and EVP_MD_CTX_type() in SSLeay 0.8.0, EVP_MD_type() and EVP_MD_pkey_type() in SSLeay 0.8.1, and EVP_MD_block_size() and EVP_MD_CTX_block_size() in SSLeay 0.9.0. All these functions have been available since OpenBSD 2.4.

EVP_MD_nid() and EVP_MD_name() first appeared in OpenSSL 0.9.7 and have been available since OpenBSD 3.2.

EVP_MD_flags() first appeared in OpenSSL 1.0.0 and has been available since OpenBSD 4.9.

The behaviour of the functions taking an EVP_MD_CTX argument is undefined if they are called on a ctx that has no message digest configured yet, for example one freshly returned from EVP_MD_CTX_new(3). In that case, the program may for example be terminated by a NULL pointer access.

September 7, 2023 OpenBSD-current