#include <openssl/evp.h>
void EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type);
- void EVP_DigestUpdate(EVP_MD_CTX *ctx,const void *d, unsigned int cnt);
- void EVP_DigestFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s);
+ void EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d, unsigned int cnt);
+ void EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md,
+ unsigned int *s);
#define EVP_MAX_MD_SIZE (16+20) /* The SSLv3 md5+sha1 type */
#define EVP_MD_size(e) ((e)->md_size)
#define EVP_MD_block_size(e) ((e)->block_size)
+ #define EVP_MD_CTX_md(e) (e)->digest)
#define EVP_MD_CTX_size(e) EVP_MD_size((e)->digest)
#define EVP_MD_CTX_block_size(e) EVP_MD_block_size((e)->digest)
- #define EVP_MD_CTX_type(e) ((e)->digest)
+ #define EVP_MD_CTX_type(e) EVP_MD_type((e)->digest)
EVP_MD *EVP_md_null(void);
EVP_MD *EVP_md2(void);
For example EVP_MD_type(EVP_sha1()) returns B<NID_sha1>. This function is
normally used when setting ASN1 OIDs.
-EVP_MD_CTX_type() returns the B<EVP_MD> structure corresponding to the passed
+EVP_MD_CTX_md() returns the B<EVP_MD> structure corresponding to the passed
B<EVP_MD_CTX>.
EVP_MD_pkey_type() returns the NID of the public key signing algorithm associated
EVP_get_digestbyname(), EVP_get_digestbynid() and EVP_get_digestbyobj()
return an B<EVP_MD> structure when passed a digest name, a digest NID or
-and ASN1_OBJECT structure respectively. The digest table must be initialised
+an ASN1_OBJECT structure respectively. The digest table must be initialised
using, for example, OpenSSL_add_all_digests() for these functions to work.
=head1 RETURN VALUES
EVP_MD_CTX_block_size() and EVP_MD_block_size() return the digest or block
size in bytes.
-EVP_md_null(), EVP_MD *EVP_md2(), EVP_MD *EVP_md5(), EVP_MD *EVP_sha(),
-EVP_sha1(), EVP_dss(), EVP_dss1(), EVP_mdc2() and EVP_ripemd160() return
-pointers to the corresponding EVP_MD structures.
+EVP_md_null(), EVP_md2(), EVP_md5(), EVP_sha(), EVP_sha1(), EVP_dss(),
+EVP_dss1(), EVP_mdc2() and EVP_ripemd160() return pointers to the
+corresponding EVP_MD structures.
-B<EVP_get_digestbyname>, B<EVP_get_digestbynid> and B<EVP_get_digestbyobj>
+EVP_get_digestbyname(), EVP_get_digestbynid() and EVP_get_digestbyobj()
return either an B<EVP_MD> structure or NULL if an error occurs.
=head1 NOTES
=head1 BUGS
-B<EVP_MD_CTX_type> is not a good name because its name wrongly implies it does
-the same as B<EVP_MD_type> but takes an B<EVP_MD_CTX> parameter instead.
-
Several of the functions do not return values: maybe they should. Although the
internal digest operations will never fail some future hardware based operations
might.
L<evp(3)|evp(3)>, L<hmac(3)|hmac(3)>, L<md2(3)|md2(3)>,
L<md5(3)|md5(3)>, L<mdc2(3)|mdc2(3)>, L<ripemd(3)|ripemd(3)>,
-L<sha(3)|sha(3)>
+L<sha(3)|sha(3)>, L<digest(1)|digest(1)>
=head1 HISTORY