MCPcopy Create free account
hub / github.com/defold/defold / HashMbedTLS

Function HashMbedTLS

engine/dlib/src/dlib/crypt_mbedtls.cpp:24–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22namespace dmCrypt
23{
24 static void HashMbedTLS(mbedtls_md_type_t type, const uint8_t* buf, uint32_t buflen, uint8_t* digest, uint32_t digest_len)
25 {
26 const mbedtls_md_info_t* md_info = mbedtls_md_info_from_type(type);
27 int ret = md_info ? mbedtls_md(md_info, (const unsigned char*)buf, (size_t)buflen, (unsigned char*)digest) : -1;
28 if (ret != 0)
29 {
30 memset(digest, 0, digest_len);
31 }
32 }
33
34 void HashSha1(const uint8_t* buf, uint32_t buflen, uint8_t* digest)
35 {

Callers 4

HashSha1Function · 0.85
HashSha256Function · 0.85
HashSha512Function · 0.85
HashMd5Function · 0.85

Calls 2

mbedtls_mdFunction · 0.85

Tested by

no test coverage detected