My Project
Functions
Algorithms - MD2

Functions

void wc_InitMd2 (Md2 *)
 This function initializes md2. This is automatically called by wc_Md2Hash. More...
 
void wc_Md2Update (Md2 *md2, const byte *data, word32 len)
 Can be called to continually hash the provided byte array of length len. More...
 
void wc_Md2Final (Md2 *md2, byte *hash)
 Finalizes hashing of data. Result is placed into hash. More...
 
int wc_Md2Hash (const byte *data, word32 len, byte *hash)
 Convenience function, handles all the hashing and places the result into hash. More...
 

Detailed Description

Function Documentation

◆ wc_InitMd2()

void wc_InitMd2 ( Md2 *  )

This function initializes md2. This is automatically called by wc_Md2Hash.

Returns
0 Returned upon successfully initializing
Parameters
md2pointer to the md2 structure to use for encryption

Example

md2 md2[1];
if ((ret = wc_InitMd2(md2)) != 0) {
WOLFSSL_MSG("wc_Initmd2 failed");
}
else {
wc_Md2Update(md2, data, len);
wc_Md2Final(md2, hash);
}
See also
wc_Md2Hash
wc_Md2Update
wc_Md2Final

◆ wc_Md2Final()

void wc_Md2Final ( Md2 *  md2,
byte *  hash 
)

Finalizes hashing of data. Result is placed into hash.

Returns
0 Returned upon successfully finalizing.
Parameters
md2pointer to the md2 structure to use for encryption
hashByte array to hold hash value.

Example

md2 md2[1];
byte data[] = { }; // Data to be hashed
word32 len = sizeof(data);
if ((ret = wc_InitMd2(md2)) != 0) {
WOLFSSL_MSG("wc_Initmd2 failed");
}
else {
wc_Md2Update(md2, data, len);
wc_Md2Final(md2, hash);
}
See also
wc_Md2Hash
wc_Md2Final
wc_InitMd2

◆ wc_Md2Hash()

int wc_Md2Hash ( const byte *  data,
word32  len,
byte *  hash 
)

Convenience function, handles all the hashing and places the result into hash.

Returns
0 Returned upon successfully hashing the data.
Memory_E memory error, unable to allocate memory. This is only possible with the small stack option enabled.
Parameters
datathe data to hash
lenthe length of data
hashByte array to hold hash value.

Example

none
See also
wc_Md2Hash
wc_Md2Final
wc_InitMd2

◆ wc_Md2Update()

void wc_Md2Update ( Md2 *  md2,
const byte *  data,
word32  len 
)

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

Returns
0 Returned upon successfully adding the data to the digest.
Parameters
md2pointer to the md2 structure to use for encryption
datathe data to be hashed
lenlength of data to be hashed

Example

md2 md2[1];
byte data[] = { }; // Data to be hashed
word32 len = sizeof(data);
if ((ret = wc_InitMd2(md2)) != 0) {
WOLFSSL_MSG("wc_Initmd2 failed");
}
else {
wc_Md2Update(md2, data, len);
wc_Md2Final(md2, hash);
}
See also
wc_Md2Hash
wc_Md2Final
wc_InitMd2
wc_Md2Update
void wc_Md2Update(Md2 *md2, const byte *data, word32 len)
Can be called to continually hash the provided byte array of length len.
wc_Md2Final
void wc_Md2Final(Md2 *md2, byte *hash)
Finalizes hashing of data. Result is placed into hash.
wc_InitMd2
void wc_InitMd2(Md2 *)
This function initializes md2. This is automatically called by wc_Md2Hash.