14 #include <drift/rwops.h>
50 DSL_API
bool DSL_CC
hashdata(
const char * name,
const uint8 *data,
size_t datalen,
char * out,
size_t outlen,
bool raw_output =
false);
51 DSL_API
bool DSL_CC
hashfile(
const char * name,
const char * fn,
char * out,
size_t outlen,
bool raw_output =
false);
52 DSL_API
bool DSL_CC
hashfile_fp(
const char * name, FILE * fp,
char * out,
size_t outlen,
bool raw_output =
false);
53 DSL_API
bool DSL_CC
hashfile_rw(
const char * name,
DSL_FILE * fp,
char * out,
size_t outlen,
bool raw_output =
false);
61 const char *
const name;
62 HASH_CTX * (*hash_init)(
const char * name);
63 void(*hash_update)(
HASH_CTX *ctx,
const uint8 *input,
size_t length);
64 bool(*hash_finish)(
HASH_CTX *ctx, uint8 * out,
size_t outlen);
72 void(*update)(
HASH_CTX * ctx,
const uint8 *input,
size_t length);
73 bool(*finish)(
HASH_CTX * ctx, uint8 * out);
76 DSL_API
void DSL_CC dsl_add_hash_provider(
const HASH_PROVIDER * p);
77 DSL_API
void DSL_CC dsl_remove_hash_provider(
const HASH_PROVIDER * p);
78 DSL_API
void DSL_CC dsl_get_hash_providers(vector<const HASH_PROVIDER *>& p);
80 DSL_API
void DSL_CC dsl_add_native_hash(
const char * name,
const HASH_NATIVE * p);
DSL_API bool DSL_CC hashdata(const char *name, const uint8 *data, size_t datalen, char *out, size_t outlen, bool raw_output=false)
Wrapper around hash_init()/hash_update()/hash_finish(). If raw_output == true out will contain binary...
Definition: hash.cpp:83
DSL_API bool DSL_CC hashfile_rw(const char *name, DSL_FILE *fp, char *out, size_t outlen, bool raw_output=false)
Wrapper around hash_init()/hash_update()/hash_finish(). If raw_output == true out will contain binary...
Definition: hash.cpp:133
DSL_API void DSL_CC hash_update(HASH_CTX *ctx, const uint8 *input, size_t length)
Call with the data you want to hash, can be called multiple times to hash a large file in chunks for ...
Definition: hash.cpp:62
DSL_API bool DSL_CC hashfile(const char *name, const char *fn, char *out, size_t outlen, bool raw_output=false)
Wrapper around hash_init()/hash_update()/hash_finish(). If raw_output == true out will contain binary...
Definition: hash.cpp:111
DSL_API HASH_CTX *DSL_CC hash_init(const char *name)
Definition: hash.cpp:49
DSL_API bool DSL_CC hashfile_fp(const char *name, FILE *fp, char *out, size_t outlen, bool raw_output=false)
Wrapper around hash_init()/hash_update()/hash_finish(). If raw_output == true out will contain binary...
Definition: hash.cpp:121
DSL_API bool DSL_CC hash_finish(HASH_CTX *ctx, uint8 *out, size_t outlen)
Finalize hash and store in out. outlen should be >= hashSize in the HASH_CTX struct....
Definition: hash.cpp:68