14 #include <drift/rwops.h>
50 DSL_API
bool DSL_CC
hmacdata(
const char * name,
const uint8 *key,
size_t keylen,
const uint8 *data,
size_t datalen,
char * out,
size_t outlen);
51 DSL_API
bool DSL_CC
hmacfile(
const char * name,
const uint8 *key,
size_t keylen,
const char * fn,
char * out,
size_t outlen);
52 DSL_API
bool DSL_CC
hmacfile_fp(
const char * name,
const uint8 *key,
size_t keylen, FILE * fp,
char * out,
size_t outlen);
53 DSL_API
bool DSL_CC
hmacfile_rw(
const char * name,
const uint8 *key,
size_t keylen,
DSL_FILE * fp,
char * out,
size_t outlen);
60 const char *
const name;
61 HASH_HMAC_CTX * (*hmac_init)(
const char * name,
const uint8 *key,
size_t length);
62 void(*hmac_update)(
HASH_HMAC_CTX *ctx,
const uint8 *input,
size_t length);
63 bool(*hmac_finish)(
HASH_HMAC_CTX *ctx, uint8 * out,
size_t outlen);
69 bool(*init)(
HASH_HMAC_CTX * ctx,
const uint8 *key,
size_t length);
70 void(*update)(
HASH_HMAC_CTX * ctx,
const uint8 *input,
size_t length);
74 DSL_API
void DSL_CC dsl_add_hmac_provider(
const HMAC_PROVIDER * p);
75 DSL_API
void DSL_CC dsl_remove_hmac_provider(
const HMAC_PROVIDER * p);
76 DSL_API
void DSL_CC dsl_get_hmac_providers(vector<const HMAC_PROVIDER *>& p);
78 DSL_API
void DSL_CC dsl_add_native_hmac(
const char * name,
const HMAC_NATIVE * p);
DSL_API bool DSL_CC hmacfile_rw(const char *name, const uint8 *key, size_t keylen, DSL_FILE *fp, char *out, size_t outlen)
Wrapper around hmac_init()/hmac_update()/hmac_finish(). If raw_output == true out will contain binary...
DSL_API bool DSL_CC hmacfile(const char *name, const uint8 *key, size_t keylen, const char *fn, char *out, size_t outlen)
Wrapper around hmac_init()/hmac_update()/hmac_finish(). If raw_output == true out will contain binary...
DSL_API bool DSL_CC hmac_finish(HASH_HMAC_CTX *ctx, uint8 *out, size_t outlen)
Finalize HMAC and store in out. outlen should be >= hashSize in the HASH_CTX struct....
DSL_API HASH_HMAC_CTX *DSL_CC hmac_init(const char *name, const uint8 *key, size_t length)
DSL_API bool DSL_CC hmacdata(const char *name, const uint8 *key, size_t keylen, const uint8 *data, size_t datalen, char *out, size_t outlen)
Wrapper around hmac_init()/hmac_update()/hmac_finish(). If raw_output == true out will contain binary...
DSL_API bool DSL_CC hmacfile_fp(const char *name, const uint8 *key, size_t keylen, FILE *fp, char *out, size_t outlen)
Wrapper around hmac_init()/hmac_update()/hmac_finish(). If raw_output == true out will contain binary...
DSL_API void DSL_CC hmac_update(HASH_HMAC_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 ...