tinydtls  0.8.6
Data Structures | Macros | Typedefs | Enumerations | Functions
hmac.h File Reference
#include <sys/types.h>
#include "tinydtls.h"
#include "global.h"
#include "sha2/sha2.h"

Go to the source code of this file.

Data Structures

struct  dtls_hmac_context_t
 

Macros

#define DTLS_HASH_CTX_SIZE   sizeof(dtls_sha256_ctx)
 
#define DTLS_HMAC_BLOCKSIZE   64
 
#define DTLS_HMAC_DIGEST_SIZE   32
 
#define DTLS_HMAC_MAX   64
 

Typedefs

typedef dtls_sha256_ctx dtls_hash_ctx
 
typedef dtls_hash_ctxdtls_hash_t
 

Enumerations

enum  dtls_hashfunc_t {
  HASH_NONE =0, HASH_MD5 =1, HASH_SHA1 =2, HASH_SHA224 =3,
  HASH_SHA256 =4, HASH_SHA384 =5, HASH_SHA512 =6
}
 

Functions

static void dtls_hash_init (dtls_hash_t ctx)
 
static void dtls_hash_update (dtls_hash_t ctx, const unsigned char *input, size_t len)
 
static size_t dtls_hash_finalize (unsigned char *buf, dtls_hash_t ctx)
 
void dtls_hmac_storage_init (void)
 
void dtls_hmac_init (dtls_hmac_context_t *ctx, const unsigned char *key, size_t klen)
 
dtls_hmac_context_tdtls_hmac_new (const unsigned char *key, size_t klen)
 
void dtls_hmac_free (dtls_hmac_context_t *ctx)
 
void dtls_hmac_update (dtls_hmac_context_t *ctx, const unsigned char *input, size_t ilen)
 
int dtls_hmac_finalize (dtls_hmac_context_t *ctx, unsigned char *result)
 

Macro Definition Documentation

#define DTLS_HASH_CTX_SIZE   sizeof(dtls_sha256_ctx)

Definition at line 33 of file hmac.h.

Typedef Documentation

typedef dtls_sha256_ctx dtls_hash_ctx

Aaron D. Gifford's implementation of SHA256 see http://www.aarongifford.com/

Definition at line 31 of file hmac.h.

Definition at line 32 of file hmac.h.

Function Documentation

static size_t dtls_hash_finalize ( unsigned char *  buf,
dtls_hash_t  ctx 
)
inlinestatic

Definition at line 46 of file hmac.h.

static void dtls_hash_init ( dtls_hash_t  ctx)
inlinestatic

Definition at line 36 of file hmac.h.

static void dtls_hash_update ( dtls_hash_t  ctx,
const unsigned char *  input,
size_t  len 
)
inlinestatic

Definition at line 41 of file hmac.h.

void dtls_hmac_storage_init ( void  )

Definition at line 46 of file hmac.c.