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

184 lines
4.2 KiB
C
Raw Normal View History

/*!
\ingroup SHA
2018-06-27 16:22:12 -06:00
\brief This function initializes SHA512. This is automatically called
by wc_Sha512Hash.
2018-06-27 16:22:12 -06:00
\return 0 Returned upon successfully initializing
2018-06-27 16:22:12 -06:00
\param sha512 pointer to the sha512 structure to use for encryption
2018-06-27 16:22:12 -06:00
_Example_
\code
Sha512 sha512[1];
if ((ret = wc_InitSha512(sha512)) != 0) {
WOLFSSL_MSG("wc_InitSha512 failed");
}
else {
wc_Sha512Update(sha512, data, len);
wc_Sha512Final(sha512, hash);
}
\endcode
2018-06-27 16:22:12 -06:00
\sa wc_Sha512Hash
\sa wc_Sha512Update
\sa wc_Sha512Final
*/
WOLFSSL_API int wc_InitSha512(wc_Sha512*);
/*!
\ingroup SHA
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 sha512 pointer to the sha512 structure to use for encryption
\param data the data to be hashed
\param len length of data to be hashed
2018-06-27 16:22:12 -06:00
_Example_
\code
Sha512 sha512[1];
byte data[] = { Data to be hashed };
word32 len = sizeof(data);
if ((ret = wc_InitSha512(sha512)) != 0) {
WOLFSSL_MSG("wc_InitSha512 failed");
}
else {
wc_Sha512Update(sha512, data, len);
wc_Sha512Final(sha512, hash);
}
2018-06-27 16:22:12 -06:00
\endcode
\sa wc_Sha512Hash
\sa wc_Sha512Final
\sa wc_InitSha512
*/
WOLFSSL_API int wc_Sha512Update(wc_Sha512*, const byte*, word32);
/*!
\ingroup SHA
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 the hash.
2018-06-27 16:22:12 -06:00
\param sha512 pointer to the sha512 structure to use for encryption
\param hash Byte array to hold hash value.
2018-06-27 16:22:12 -06:00
_Example_
\code
Sha512 sha512[1];
byte data[] = { Data to be hashed };
word32 len = sizeof(data);
if ((ret = wc_InitSha512(sha512)) != 0) {
WOLFSSL_MSG("wc_InitSha512 failed");
}
else {
wc_Sha512Update(sha512, data, len);
wc_Sha512Final(sha512, hash);
}
\endcode
2018-06-27 16:22:12 -06:00
\sa wc_Sha512Hash
\sa wc_Sha512Final
\sa wc_InitSha512
*/
WOLFSSL_API int wc_Sha512Final(wc_Sha512*, byte*);
/*!
\ingroup SHA
2018-06-27 16:22:12 -06:00
\brief This function initializes SHA384. This is automatically called
by wc_Sha384Hash.
2018-06-27 16:22:12 -06:00
\return 0 Returned upon successfully initializing
2018-06-27 16:22:12 -06:00
\param sha384 pointer to the sha384 structure to use for encryption
2018-06-27 16:22:12 -06:00
_Example_
\code
Sha384 sha384[1];
if ((ret = wc_InitSha384(sha384)) != 0) {
WOLFSSL_MSG("wc_InitSha384 failed");
}
else {
wc_Sha384Update(sha384, data, len);
wc_Sha384Final(sha384, hash);
}
\endcode
2018-06-27 16:22:12 -06:00
\sa wc_Sha384Hash
\sa wc_Sha384Update
\sa wc_Sha384Final
*/
WOLFSSL_API int wc_InitSha384(wc_Sha384*);
/*!
\ingroup SHA
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 sha384 pointer to the sha384 structure to use for encryption
\param data the data to be hashed
\param len length of data to be hashed
_Example_
\code
Sha384 sha384[1];
byte data[] = { Data to be hashed };
word32 len = sizeof(data);
if ((ret = wc_InitSha384(sha384)) != 0) {
WOLFSSL_MSG("wc_InitSha384 failed");
}
else {
wc_Sha384Update(sha384, data, len);
wc_Sha384Final(sha384, hash);
}
\endcode
2018-06-27 16:22:12 -06:00
\sa wc_Sha384Hash
\sa wc_Sha384Final
\sa wc_InitSha384
*/
WOLFSSL_API int wc_Sha384Update(wc_Sha384*, const byte*, word32);
/*!
\ingroup SHA
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.
2018-06-27 16:22:12 -06:00
\param sha384 pointer to the sha384 structure to use for encryption
\param hash Byte array to hold hash value.
2018-06-27 16:22:12 -06:00
_Example_
\code
Sha384 sha384[1];
byte data[] = { Data to be hashed };
word32 len = sizeof(data);
if ((ret = wc_InitSha384(sha384)) != 0) {
WOLFSSL_MSG("wc_InitSha384 failed");
}
else {
wc_Sha384Update(sha384, data, len);
wc_Sha384Final(sha384, hash);
}
\endcode
2018-06-27 16:22:12 -06:00
\sa wc_Sha384Hash
\sa wc_Sha384Final
\sa wc_InitSha384
*/
WOLFSSL_API int wc_Sha384Final(wc_Sha384*, byte*);