Files
wolfssl/doc/dox_comments/header_files-ja/hash.h

172 lines
6.2 KiB
C
Raw Normal View History

/*!
\ingroup wolfCrypt
\brief wc_hashtypeのOIDを返します
\return OID 0
\return HASH_TYPE_E
\return BAD_FUNC_ARG 1
_Example_
\code
enum wc_HashType hash_type = WC_HASH_TYPE_SHA256;
int oid = wc_HashGetOID(hash_type);
if (oid > 0) {
// Success
}
\endcode
\sa wc_HashGetDigestSize
\sa wc_Hash
*/
int wc_HashGetOID(enum wc_HashType hash_type);
/*!
\ingroup wolfCrypt
\brief hash_typeのダイジェストWC_HASHに提供される出力バッファが十分に大きいことを確認するために使用されます
\return Success
\return Error hash_typeがサポートされていない場合はhash_type_eを返します
\return Failure hash_typeが使用された場合bad_func_argを返します
_Example_
\code
int hash_len = wc_HashGetDigestSize(hash_type);
if (hash_len <= 0) {
WOLFSSL_MSG("Invalid hash type/len");
return BAD_FUNC_ARG;
}
\endcode
\sa wc_Hash
*/
int wc_HashGetDigestSize(enum wc_HashType hash_type);
/*!
\ingroup wolfCrypt
\brief
\return 0 bad_func_argやbuffer_eなど
\param hash_type "wc_hash_type_sha256" "enum wc_hashtype"
\param data
\param data_len
\param hash 使
_Example_
\code
enum wc_HashType hash_type = WC_HASH_TYPE_SHA256;
int hash_len = wc_HashGetDigestSize(hash_type);
if (hash_len > 0) {
int ret = wc_Hash(hash_type, data, data_len, hash_data, hash_len);
if(ret == 0) {
// Success
}
}
\endcode
\sa wc_HashGetDigestSize
*/
int wc_Hash(enum wc_HashType hash_type,
const byte* data, word32 data_len,
byte* hash, word32 hash_len);
/*!
\ingroup MD5
\brief 便
\return 0
\return Memory_E
\param data
\param len
_Example_
\code
const byte* data;
word32 data_len;
byte* hash;
int ret;
...
ret = wc_Md5Hash(data, data_len, hash);
if (ret != 0) {
// Md5 Hash Failure Case.
}
\endcode
\sa wc_Md5Hash
\sa wc_Md5Final
\sa wc_InitMd5
*/
int wc_Md5Hash(const byte* data, word32 len, byte* hash);
/*!
\ingroup SHA
\brief 便
\return 0 ...
\return Memory_E
\param data
\param len
_Example_
\code
none
\endcode
\sa wc_ShaHash
\sa wc_ShaFinal
\sa wc_InitSha
*/
int wc_ShaHash(const byte* data, word32 len, byte* hash);
/*!
\ingroup SHA
\brief 便
\return 0 ...
\return Memory_E
\param data
\param len
_Example_
\code
none
\endcode
\sa wc_Sha256Hash
\sa wc_Sha256Final
\sa wc_InitSha256
*/
int wc_Sha256Hash(const byte* data, word32 len, byte* hash);
/*!
\ingroup SHA
\brief 便
\return 0
\return <0
\param data
\param len
_Example_
\code
none
\endcode
\sa wc_InitSha224
\sa wc_Sha224Update
\sa wc_Sha224Final
*/
int wc_Sha224Hash(const byte* data, word32 len, byte* hash);
/*!
\ingroup SHA
\brief 便
\return 0
\return Memory_E
\param data
\param len
_Example_
\code
none
\endcode
\sa wc_Sha512Hash
\sa wc_Sha512Final
\sa wc_InitSha512
*/
int wc_Sha512Hash(const byte* data, word32 len, byte* hash);
/*!
\ingroup SHA
\brief 便
\return 0
\return Memory_E
\param data
\param len
_Example_
\code
none
\endcode
\sa wc_Sha384Hash
\sa wc_Sha384Final
\sa wc_InitSha384
*/
int wc_Sha384Hash(const byte* data, word32 len, byte* hash);