29 #define MAX_HASHLEN 32 30 #define MAX_BLOCKLEN 64 42 #define DEFINE_SHA(bits) \ 43 static av_cold void sha ## bits ##_init(void *ctx) \ 45 av_sha_init(ctx, bits); \ 69 c->
init = sha160_init;
77 c->
init = sha224_init;
85 c->
init = sha256_init;
119 memcpy(c->
key, key, keylen);
123 for (i = 0; i < c->
keylen; i++)
124 block[i] = c->
key[i] ^ 0x36;
143 for (i = 0; i < c->
keylen; i++)
144 block[i] = c->
key[i] ^ 0x5C;
void av_sha_final(AVSHA *ctx, uint8_t *digest)
Finish hashing and output digest value.
int av_hmac_calc(AVHMAC *c, const uint8_t *data, unsigned int len, const uint8_t *key, unsigned int keylen, uint8_t *out, unsigned int outlen)
Hash an array of data with a key.
void av_sha_update(AVSHA *ctx, const uint8_t *data, unsigned int len)
Update hash value.
AVHMAC * av_hmac_alloc(enum AVHMACType type)
Allocate an AVHMAC context.
memory handling functions
Macro definitions for various function/variable attributes.
struct AVMD5 * av_md5_alloc(void)
void(* final)(void *, uint8_t *)
void av_hmac_update(AVHMAC *c, const uint8_t *data, unsigned int len)
Hash data with the HMAC.
void av_md5_update(AVMD5 *ctx, const uint8_t *src, const int len)
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
void av_hmac_init(AVHMAC *c, const uint8_t *key, unsigned int keylen)
Initialize an AVHMAC context with an authentication key.
uint8_t key[MAX_BLOCKLEN]
static void(WINAPI *cond_broadcast)(pthread_cond_t *cond)
struct AVSHA * av_sha_alloc(void)
Allocate an AVSHA context.
void av_md5_init(AVMD5 *ctx)
void av_md5_final(AVMD5 *ctx, uint8_t *dst)
int av_hmac_final(AVHMAC *c, uint8_t *out, unsigned int outlen)
Finish hashing and output the HMAC digest.
void av_hmac_free(AVHMAC *c)
Free an AVHMAC context.
void(* update)(void *, const uint8_t *, int len)
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...