tinydtls  0.8.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Data Structures | Macros | Typedefs | Enumerations | Functions
hmac.h File Reference
#include <sys/types.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(SHA256_CTX)
 
#define DTLS_HMAC_BLOCKSIZE   64
 
#define DTLS_HMAC_DIGEST_SIZE   32
 
#define DTLS_HMAC_MAX   64
 

Typedefs

typedef 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)
 
static void dtls_hmac_storage_init ()
 
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(SHA256_CTX)

Definition at line 40 of file hmac.h.

Typedef Documentation

typedef SHA256_CTX dtls_hash_ctx

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

Definition at line 38 of file hmac.h.

Definition at line 39 of file hmac.h.

Function Documentation

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

Definition at line 53 of file hmac.h.

static void dtls_hash_init ( dtls_hash_t  ctx)
inlinestatic

Definition at line 43 of file hmac.h.

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

Definition at line 48 of file hmac.h.

static void dtls_hmac_storage_init ( )
inlinestatic

Definition at line 60 of file hmac.h.