Skip to content

MTY_CryptoHashFile

chrisd1100 edited this page Aug 25, 2022 · 1 revision

Run a hash algorithm on the contents of a file with optional HMAC key.

bool MTY_CryptoHashFile(
    MTY_Algorithm algo,
    const char *  path,
    const void *  key,
    size_t        keySize,
    void *        output,
    size_t        outputSize
);

Parameters

algo (MTY_Algorithm)

Hash algorithm to use.

path (const char *)

Path to the input file.

key (const void *)

HMAC key to use. May be NULL, in which case HMAC is not used.

keySize (size_t)

Size in bytes of key, or 0 if key is NULL.

output (void *)

Output buffer.

outputSize (size_t)

Size in bytes of output.

Return value

bool

Returns true on success, false on failure. Call MTY_GetLog for details.

Platform support

Windows   macOS   Android   Linux  

See also

Module: Crypto

Clone this wiki locally