FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions
hmac.c File Reference
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include "attributes.h"
#include "hmac.h"
#include "md5.h"
#include "sha.h"
#include "sha512.h"
#include "mem.h"
#include "version.h"

Go to the source code of this file.

Data Structures

struct  AVHMAC
 

Macros

#define MAX_HASHLEN   64
 
#define MAX_BLOCKLEN   128
 
#define DEFINE_SHA(bits)
 
#define DEFINE_SHA512(bits)
 

Typedefs

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

Functions

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

Macro Definition Documentation

#define MAX_HASHLEN   64

Definition at line 33 of file hmac.c.

Referenced by test().

#define MAX_BLOCKLEN   128

Definition at line 34 of file hmac.c.

Referenced by av_hmac_final(), and av_hmac_init().

#define DEFINE_SHA (   bits)
Value:
static av_cold void sha ## bits ##_init(void *ctx) \
{ \
av_sha_init(ctx, bits); \
}
av_cold int av_sha_init(AVSHA *ctx, int bits)
Initialize SHA-1 or SHA-2 hashing.
Definition: sha.c:273
#define av_cold
Definition: attributes.h:82
AVFormatContext * ctx
Definition: movenc.c:48

Definition at line 54 of file hmac.c.

#define DEFINE_SHA512 (   bits)
Value:
static av_cold void sha ## bits ##_init(void *ctx) \
{ \
}
#define av_cold
Definition: attributes.h:82
AVFormatContext * ctx
Definition: movenc.c:48
av_cold int av_sha512_init(AVSHA512 *ctx, int bits)
Initialize SHA-2 512 hashing.
Definition: sha512.c:191

Definition at line 60 of file hmac.c.

Typedef Documentation

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

Definition at line 36 of file hmac.c.

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

Definition at line 38 of file hmac.c.

typedef void(* hmac_init)(void *ctx)

Definition at line 42 of file hmac.c.