FFmpeg
Loading...
Searching...
No Matches
hmac.c File Reference
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include "attributes.h"
#include "error.h"
#include "hmac.h"
#include "md5.h"
#include "sha.h"
#include "sha512.h"
#include "mem.h"

Go to the source code of this file.

Data Structures

struct  AVHMAC
 

Macros

#define MAX_HASHLEN   64
 
#define MAX_BLOCKLEN   128
 
#define DEFINE_ALGO_BITS_INIT(prefix, bits)
 
#define DEFINE_ALGO_INIT(prefix)
 
#define DEFINE_ALGO(prefix)
 

Typedefs

typedef void(* hmac_final) (void *ctx, uint8_t *dst)
 
typedef void(* hmac_update) (void *ctx, const uint8_t *src, size_t len)
 
typedef void(* hmac_init) (void *ctx)
 

Functions

AVHMACav_hmac_alloc (enum AVHMACType type)
 Allocate an AVHMAC context.
 
void av_hmac_free (AVHMAC *c)
 Free an AVHMAC context.
 
void av_hmac_init (AVHMAC *c, const uint8_t *key, unsigned int keylen)
 Initialize an AVHMAC context with an authentication key.
 
void av_hmac_update (AVHMAC *c, const uint8_t *data, unsigned int len)
 Hash data with the HMAC.
 
int av_hmac_final (AVHMAC *c, uint8_t *out, unsigned int outlen)
 Finish hashing and output the HMAC digest.
 
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.
 

Macro Definition Documentation

◆ MAX_HASHLEN

#define MAX_HASHLEN   64

Definition at line 33 of file hmac.c.

Referenced by test().

◆ MAX_BLOCKLEN

#define MAX_BLOCKLEN   128

Definition at line 34 of file hmac.c.

Referenced by av_hmac_final(), and av_hmac_init().

◆ DEFINE_ALGO_BITS_INIT

#define DEFINE_ALGO_BITS_INIT ( prefix,
bits )
Value:
static av_cold void prefix##bits##_init(void *ctx) \
{ \
av_##prefix##_init(ctx, bits); \
}
static AVFormatContext * ctx
static const uint8_t bits[8]
Definition fastaudio.c:100
#define av_cold
Definition attributes.h:117
char prefix[8]

Definition at line 50 of file hmac.c.

◆ DEFINE_ALGO_INIT

#define DEFINE_ALGO_INIT ( prefix)
Value:
static av_cold void prefix##_init(void *ctx) \
{ \
av_##prefix##_init(ctx); \
}

Definition at line 56 of file hmac.c.

◆ DEFINE_ALGO

#define DEFINE_ALGO ( prefix)
Value:
static void prefix##_update(void *ctx, const uint8_t *src, size_t len) \
{ \
av_##prefix##_update(ctx, src, len); \
} \
static void prefix##_final(void *ctx, uint8_t *dst) \
{ \
av_##prefix##_final(ctx, dst); \
}
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:87
#define src
Definition vp8dsp.c:248
int len

Definition at line 62 of file hmac.c.

Typedef Documentation

◆ hmac_final

typedef void(* hmac_final) (void *ctx, uint8_t *dst)

Definition at line 36 of file hmac.c.

◆ hmac_update

typedef void(* hmac_update) (void *ctx, const uint8_t *src, size_t len)

Definition at line 37 of file hmac.c.

◆ hmac_init

typedef void(* hmac_init) (void *ctx)

Definition at line 38 of file hmac.c.