Functions
Algorithms - MD2

Functions

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

Detailed Description

Function Documentation

◆ wc_InitMd2()

WOLFSSL_API 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()

WOLFSSL_API void wc_Md2Final ( Md2 ,
byte *   
)

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()

WOLFSSL_API int wc_Md2Hash ( const byte *  ,
word32  ,
byte *   
)

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()

WOLFSSL_API void wc_Md2Update ( Md2 ,
const byte *  ,
word32   
)

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