wolfSSL Manual

Docs -> wolfSSL Manual

Chapter 18: wolfCrypt API Reference


18.25  MD4


The functions in this section expose MD4 functionality to calling applications.






wc_Initmd4


Synopsis:

#include <wolfssl/wolfcrypt/md4.h>


int wc_InitMd4(md4* md4);


Description:

This function initializes md4. This is automatically called by wc_Md4Hash.


Return Values:

0: Returned upon successfully initializing


Parameters:

md4 - pointer to the md4 structure to use for encryption


Example:

md4 md4[1];

if ((ret = wc_InitMd4(md4)) != 0) {

  WOLFSSL_MSG("wc_Initmd4 failed");

}

else {

  wc_Md4Update(md4, data, len);

  wc_Md4Final(md4, hash);

}


See Also:

wc_Md4Hash

wc_Md4Update

wc_Md4Final





wc_Md4Update


Synopsis:

#include <wolfssl/wolfcrypt/md4.h>


int wc_Md4Update(md4* md4, const byte* data, word32 len)


Description:

Can be called to continually hash the provided byte array of length len.


Return Values:

0: Returned upon successfully adding the data to the digest.


Parameters:

md4 - pointer to the md4 structure to use for encryption

data - the data to be hashed

len - length of data to be hashed


Example:

md4 md4[1];

if ((ret = wc_InitMd4(md4)) != 0) {

  WOLFSSL_MSG("wc_Initmd4 failed");

}

else {

  wc_Md4Update(md4, data, len);

  wc_Md4Final(md4, hash);

}


See Also:

wc_Md4Hash

wc_Md4Final

wc_InitMd4





wc_Md4Final


Synopsis:

#include <wolfssl/wolfcrypt/md4.h>


int wc_Md4Final(md4* md4, byte* hash)


Description:

Finalizes hashing of data. Result is placed into hash.


Return Values:

0: Returned upon successfully finalizing.


Parameters:

md4 - pointer to the md4 structure to use for encryption

hash - Byte array to hold hash value.


Example:

md4 md4[1];

if ((ret = wc_InitMd4(md4)) != 0) {

  WOLFSSL_MSG("wc_Initmd4 failed");

}

else {

  wc_Md4Update(md4, data, len);

  wc_Md4Final(md4, hash);

}


See Also:

wc_Md4Hash

wc_Md4Final

wc_InitMd4



 

Questions? +1 (425) 245-8247