Files
wolfssl/doc/dox_comments/header_files/md2.h

117 lines
2.5 KiB
C
Raw Normal View History

/*!
\ingroup MD2
2018-06-27 16:22:12 -06:00
\brief This function initializes md2. This is automatically
called by wc_Md2Hash.
2018-06-27 16:22:12 -06:00
\return 0 Returned upon successfully initializing
2018-06-27 16:22:12 -06:00
\param md2 pointer to the md2 structure to use for encryption
2018-06-27 16:22:12 -06:00
_Example_
\code
md2 md2[1];
if ((ret = wc_InitMd2(md2)) != 0) {
WOLFSSL_MSG("wc_Initmd2 failed");
}
else {
wc_Md2Update(md2, data, len);
wc_Md2Final(md2, hash);
}
\endcode
2018-06-27 16:22:12 -06:00
\sa wc_Md2Hash
\sa wc_Md2Update
\sa wc_Md2Final
*/
void wc_InitMd2(Md2*);
/*!
\ingroup MD2
2018-06-27 16:22:12 -06:00
\brief Can be called to continually hash the provided byte
array of length len.
2018-06-27 16:22:12 -06:00
\return 0 Returned upon successfully adding the data to the digest.
2018-06-27 16:22:12 -06:00
\param md2 pointer to the md2 structure to use for encryption
\param data the data to be hashed
\param len length of data to be hashed
_Example_
\code
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);
}
\endcode
2018-06-27 16:22:12 -06:00
\sa wc_Md2Hash
\sa wc_Md2Final
\sa wc_InitMd2
*/
void wc_Md2Update(Md2* md2, const byte* data, word32 len);
/*!
\ingroup MD2
2018-06-27 16:22:12 -06:00
\brief Finalizes hashing of data. Result is placed into hash.
2018-06-27 16:22:12 -06:00
\return 0 Returned upon successfully finalizing.
\param md2 pointer to the md2 structure to use for encryption
\param hash Byte array to hold hash value.
_Example_
\code
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);
}
\endcode
2018-06-27 16:22:12 -06:00
\sa wc_Md2Hash
\sa wc_Md2Final
\sa wc_InitMd2
*/
void wc_Md2Final(Md2* md2, byte* hash);
/*!
\ingroup MD2
2018-06-27 16:22:12 -06:00
\brief Convenience function, handles all the hashing and places
the result into hash.
2018-06-27 16:22:12 -06:00
\return 0 Returned upon successfully hashing the data.
2018-06-27 16:22:12 -06:00
\return Memory_E memory error, unable to allocate memory. This is only
possible with the small stack option enabled.
2018-06-27 16:22:12 -06:00
\param data the data to hash
\param len the length of data
\param hash Byte array to hold hash value.
_Example_
\code
none
\endcode
2018-06-27 16:22:12 -06:00
\sa wc_Md2Hash
\sa wc_Md2Final
\sa wc_InitMd2
*/
int wc_Md2Hash(const byte* data, word32 len, byte* hash);