Skip to content

md4.h

Functions

Name
void wc_InitMd4(Md4 * )
This function initializes md4. This is automatically called by wc_Md4Hash.
void wc_Md4Update(Md4 * md4, const byte * data, word32 len)
Can be called to continually hash the provided byte array of length len.
void wc_Md4Final(Md4 * md4, byte * hash)
Finalizes hashing of data. Result is placed into hash.

Functions Documentation

function wc_InitMd4

void wc_InitMd4(
    Md4 * 
)

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

Parameters:

  • md4 pointer to the md4 structure to use for encryption

See:

Return: 0 Returned upon successfully initializing

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);
}

function wc_Md4Update

void wc_Md4Update(
    Md4 * md4,
    const byte * data,
    word32 len
)

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

Parameters:

  • md4 pointer to the md4 structure to use for encryption
  • data the data to be hashed
  • len length of data to be hashed

See:

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

Example

md4 md4[1];
byte data[] = { }; // Data to be hashed
word32 len = sizeof(data);

if ((ret = wc_InitMd4(md4)) != 0) {
   WOLFSSL_MSG("wc_Initmd4 failed");
}
else {
   wc_Md4Update(md4, data, len);
   wc_Md4Final(md4, hash);
}

function wc_Md4Final

void wc_Md4Final(
    Md4 * md4,
    byte * hash
)

Finalizes hashing of data. Result is placed into hash.

Parameters:

  • md4 pointer to the md4 structure to use for encryption
  • hash Byte array to hold hash value.

See:

Return: 0 Returned upon successfully finalizing.

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);
}

Source code


void wc_InitMd4(Md4*);

void wc_Md4Update(Md4* md4, const byte* data, word32 len);

void wc_Md4Final(Md4* md4, byte* hash);

Updated on 2024-03-19 at 01:20:40 +0000