hmacsha.h File Reference

#include <isc/lang.h>
#include <isc/platform.h>
#include <isc/sha1.h>
#include <isc/sha2.h>
#include <isc/types.h>

Go to the source code of this file.

Data Structures

struct  isc_hmacsha1_t
struct  isc_hmacsha224_t
struct  isc_hmacsha256_t
struct  isc_hmacsha384_t
struct  isc_hmacsha512_t

Defines

#define ISC_HMACSHA_H   1
#define ISC_HMACSHA1_KEYLENGTH   ISC_SHA1_BLOCK_LENGTH
#define ISC_HMACSHA224_KEYLENGTH   ISC_SHA224_BLOCK_LENGTH
#define ISC_HMACSHA256_KEYLENGTH   ISC_SHA256_BLOCK_LENGTH
#define ISC_HMACSHA384_KEYLENGTH   ISC_SHA384_BLOCK_LENGTH
#define ISC_HMACSHA512_KEYLENGTH   ISC_SHA512_BLOCK_LENGTH

Functions

ISC_LANG_BEGINDECLS void isc_hmacsha1_init (isc_hmacsha1_t *ctx, const unsigned char *key, unsigned int len)
void isc_hmacsha1_invalidate (isc_hmacsha1_t *ctx)
void isc_hmacsha1_update (isc_hmacsha1_t *ctx, const unsigned char *buf, unsigned int len)
void isc_hmacsha1_sign (isc_hmacsha1_t *ctx, unsigned char *digest, size_t len)
isc_boolean_t isc_hmacsha1_verify (isc_hmacsha1_t *ctx, unsigned char *digest, size_t len)
void isc_hmacsha224_init (isc_hmacsha224_t *ctx, const unsigned char *key, unsigned int len)
void isc_hmacsha224_invalidate (isc_hmacsha224_t *ctx)
void isc_hmacsha224_update (isc_hmacsha224_t *ctx, const unsigned char *buf, unsigned int len)
void isc_hmacsha224_sign (isc_hmacsha224_t *ctx, unsigned char *digest, size_t len)
isc_boolean_t isc_hmacsha224_verify (isc_hmacsha224_t *ctx, unsigned char *digest, size_t len)
void isc_hmacsha256_init (isc_hmacsha256_t *ctx, const unsigned char *key, unsigned int len)
void isc_hmacsha256_invalidate (isc_hmacsha256_t *ctx)
void isc_hmacsha256_update (isc_hmacsha256_t *ctx, const unsigned char *buf, unsigned int len)
void isc_hmacsha256_sign (isc_hmacsha256_t *ctx, unsigned char *digest, size_t len)
isc_boolean_t isc_hmacsha256_verify (isc_hmacsha256_t *ctx, unsigned char *digest, size_t len)
void isc_hmacsha384_init (isc_hmacsha384_t *ctx, const unsigned char *key, unsigned int len)
void isc_hmacsha384_invalidate (isc_hmacsha384_t *ctx)
void isc_hmacsha384_update (isc_hmacsha384_t *ctx, const unsigned char *buf, unsigned int len)
void isc_hmacsha384_sign (isc_hmacsha384_t *ctx, unsigned char *digest, size_t len)
isc_boolean_t isc_hmacsha384_verify (isc_hmacsha384_t *ctx, unsigned char *digest, size_t len)
void isc_hmacsha512_init (isc_hmacsha512_t *ctx, const unsigned char *key, unsigned int len)
void isc_hmacsha512_invalidate (isc_hmacsha512_t *ctx)
void isc_hmacsha512_update (isc_hmacsha512_t *ctx, const unsigned char *buf, unsigned int len)
void isc_hmacsha512_sign (isc_hmacsha512_t *ctx, unsigned char *digest, size_t len)
isc_boolean_t isc_hmacsha512_verify (isc_hmacsha512_t *ctx, unsigned char *digest, size_t len)


Detailed Description

This is the header file for the HMAC-SHA1, HMAC-SHA224, HMAC-SHA256, HMAC-SHA334 and HMAC-SHA512 hash algorithm described in RFC 2104.

Definition in file hmacsha.h.


Define Documentation

#define ISC_HMACSHA_H   1

Definition at line 25 of file hmacsha.h.

#define ISC_HMACSHA1_KEYLENGTH   ISC_SHA1_BLOCK_LENGTH

Definition at line 33 of file hmacsha.h.

#define ISC_HMACSHA224_KEYLENGTH   ISC_SHA224_BLOCK_LENGTH

Definition at line 34 of file hmacsha.h.

#define ISC_HMACSHA256_KEYLENGTH   ISC_SHA256_BLOCK_LENGTH

Definition at line 35 of file hmacsha.h.

#define ISC_HMACSHA384_KEYLENGTH   ISC_SHA384_BLOCK_LENGTH

Definition at line 36 of file hmacsha.h.

#define ISC_HMACSHA512_KEYLENGTH   ISC_SHA512_BLOCK_LENGTH

Definition at line 37 of file hmacsha.h.


Function Documentation

ISC_LANG_BEGINDECLS void isc_hmacsha1_init ( isc_hmacsha1_t ctx,
const unsigned char *  key,
unsigned int  len 
)

Definition at line 642 of file hmacsha.c.

References IPAD, ISC_SHA1_BLOCK_LENGTH, isc_sha1_final(), isc_sha1_init(), isc_sha1_update(), isc_hmacsha1_t::key, and isc_hmacsha1_t::sha1ctx.

Referenced by ATF_TC_BODY(), hmacsha1_createctx(), sign(), and verify().

void isc_hmacsha1_invalidate ( isc_hmacsha1_t ctx  ) 

Definition at line 665 of file hmacsha.c.

References isc_sha1_invalidate(), and isc_hmacsha1_t::sha1ctx.

Referenced by hmacsha1_destroyctx(), and isc_hmacsha1_sign().

void isc_hmacsha1_update ( isc_hmacsha1_t ctx,
const unsigned char *  buf,
unsigned int  len 
)

Definition at line 675 of file hmacsha.c.

References isc_sha1_update(), and isc_hmacsha1_t::sha1ctx.

Referenced by ATF_TC_BODY(), hmacsha1_adddata(), sign(), and verify().

void isc_hmacsha1_sign ( isc_hmacsha1_t ctx,
unsigned char *  digest,
size_t  len 
)

Definition at line 685 of file hmacsha.c.

References isc_hmacsha1_invalidate(), ISC_SHA1_BLOCK_LENGTH, ISC_SHA1_DIGESTLENGTH, isc_sha1_final(), isc_sha1_init(), isc_sha1_update(), isc_hmacsha1_t::key, OPAD, REQUIRE, and isc_hmacsha1_t::sha1ctx.

Referenced by ATF_TC_BODY(), hmacsha1_sign(), isc_hmacsha1_verify(), sign(), and verify().

isc_boolean_t isc_hmacsha1_verify ( isc_hmacsha1_t ctx,
unsigned char *  digest,
size_t  len 
)

Definition at line 976 of file hmacsha.c.

References isc_hmacsha1_sign(), isc_safe_memcmp(), ISC_SHA1_DIGESTLENGTH, and REQUIRE.

Referenced by hmacsha1_verify().

void isc_hmacsha224_init ( isc_hmacsha224_t ctx,
const unsigned char *  key,
unsigned int  len 
)

Definition at line 710 of file hmacsha.c.

References IPAD, ISC_SHA224_BLOCK_LENGTH, isc_sha224_final(), isc_sha224_init(), isc_sha224_update(), isc_hmacsha224_t::key, and isc_hmacsha224_t::sha224ctx.

Referenced by ATF_TC_BODY(), hmacsha224_createctx(), sign(), and verify().

void isc_hmacsha224_invalidate ( isc_hmacsha224_t ctx  ) 

Definition at line 733 of file hmacsha.c.

Referenced by hmacsha224_destroyctx().

void isc_hmacsha224_update ( isc_hmacsha224_t ctx,
const unsigned char *  buf,
unsigned int  len 
)

Definition at line 742 of file hmacsha.c.

References isc_sha224_update(), and isc_hmacsha224_t::sha224ctx.

Referenced by ATF_TC_BODY(), hmacsha224_adddata(), sign(), and verify().

void isc_hmacsha224_sign ( isc_hmacsha224_t ctx,
unsigned char *  digest,
size_t  len 
)

Definition at line 752 of file hmacsha.c.

References ISC_SHA224_BLOCK_LENGTH, ISC_SHA224_DIGESTLENGTH, isc_sha224_final(), isc_sha224_init(), isc_sha224_update(), isc_hmacsha224_t::key, OPAD, REQUIRE, and isc_hmacsha224_t::sha224ctx.

Referenced by ATF_TC_BODY(), hmacsha224_sign(), isc_hmacsha224_verify(), sign(), and verify().

isc_boolean_t isc_hmacsha224_verify ( isc_hmacsha224_t ctx,
unsigned char *  digest,
size_t  len 
)

Definition at line 989 of file hmacsha.c.

References isc_hmacsha224_sign(), isc_safe_memcmp(), ISC_SHA224_DIGESTLENGTH, and REQUIRE.

Referenced by hmacsha224_verify().

void isc_hmacsha256_init ( isc_hmacsha256_t ctx,
const unsigned char *  key,
unsigned int  len 
)

Definition at line 776 of file hmacsha.c.

References IPAD, ISC_SHA256_BLOCK_LENGTH, isc_sha256_final(), isc_sha256_init(), isc_sha256_update(), isc_hmacsha256_t::key, and isc_hmacsha256_t::sha256ctx.

Referenced by ATF_TC_BODY(), hmacsha256_createctx(), sign(), and verify().

void isc_hmacsha256_invalidate ( isc_hmacsha256_t ctx  ) 

Definition at line 799 of file hmacsha.c.

Referenced by hmacsha256_destroyctx().

void isc_hmacsha256_update ( isc_hmacsha256_t ctx,
const unsigned char *  buf,
unsigned int  len 
)

Definition at line 808 of file hmacsha.c.

References isc_sha256_update(), and isc_hmacsha256_t::sha256ctx.

Referenced by ATF_TC_BODY(), hmacsha256_adddata(), sign(), and verify().

void isc_hmacsha256_sign ( isc_hmacsha256_t ctx,
unsigned char *  digest,
size_t  len 
)

Definition at line 818 of file hmacsha.c.

References ISC_SHA256_BLOCK_LENGTH, ISC_SHA256_DIGESTLENGTH, isc_sha256_final(), isc_sha256_init(), isc_sha256_update(), isc_hmacsha256_t::key, OPAD, REQUIRE, and isc_hmacsha256_t::sha256ctx.

Referenced by ATF_TC_BODY(), hmacsha256_sign(), isc_hmacsha256_verify(), sign(), and verify().

isc_boolean_t isc_hmacsha256_verify ( isc_hmacsha256_t ctx,
unsigned char *  digest,
size_t  len 
)

Definition at line 1002 of file hmacsha.c.

References isc_hmacsha256_sign(), isc_safe_memcmp(), ISC_SHA256_DIGESTLENGTH, and REQUIRE.

Referenced by hmacsha256_verify().

void isc_hmacsha384_init ( isc_hmacsha384_t ctx,
const unsigned char *  key,
unsigned int  len 
)

Definition at line 842 of file hmacsha.c.

References IPAD, ISC_SHA384_BLOCK_LENGTH, isc_sha384_final(), isc_sha384_init(), isc_sha384_update(), isc_hmacsha384_t::key, and isc_hmacsha384_t::sha384ctx.

Referenced by ATF_TC_BODY(), hmacsha384_createctx(), sign(), and verify().

void isc_hmacsha384_invalidate ( isc_hmacsha384_t ctx  ) 

Definition at line 865 of file hmacsha.c.

Referenced by hmacsha384_destroyctx().

void isc_hmacsha384_update ( isc_hmacsha384_t ctx,
const unsigned char *  buf,
unsigned int  len 
)

Definition at line 874 of file hmacsha.c.

References isc_sha384_update(), and isc_hmacsha384_t::sha384ctx.

Referenced by ATF_TC_BODY(), hmacsha384_adddata(), sign(), and verify().

void isc_hmacsha384_sign ( isc_hmacsha384_t ctx,
unsigned char *  digest,
size_t  len 
)

Definition at line 884 of file hmacsha.c.

References ISC_SHA384_BLOCK_LENGTH, ISC_SHA384_DIGESTLENGTH, isc_sha384_final(), isc_sha384_init(), isc_sha384_update(), isc_hmacsha384_t::key, OPAD, REQUIRE, and isc_hmacsha384_t::sha384ctx.

Referenced by ATF_TC_BODY(), hmacsha384_sign(), isc_hmacsha384_verify(), sign(), and verify().

isc_boolean_t isc_hmacsha384_verify ( isc_hmacsha384_t ctx,
unsigned char *  digest,
size_t  len 
)

Definition at line 1015 of file hmacsha.c.

References isc_hmacsha384_sign(), isc_safe_memcmp(), ISC_SHA384_DIGESTLENGTH, and REQUIRE.

Referenced by hmacsha384_verify().

void isc_hmacsha512_init ( isc_hmacsha512_t ctx,
const unsigned char *  key,
unsigned int  len 
)

Definition at line 908 of file hmacsha.c.

References IPAD, ISC_SHA512_BLOCK_LENGTH, isc_sha512_final(), isc_sha512_init(), isc_sha512_update(), isc_hmacsha512_t::key, and isc_hmacsha512_t::sha512ctx.

Referenced by ATF_TC_BODY(), hmacsha512_createctx(), sign(), and verify().

void isc_hmacsha512_invalidate ( isc_hmacsha512_t ctx  ) 

Definition at line 931 of file hmacsha.c.

Referenced by hmacsha512_destroyctx().

void isc_hmacsha512_update ( isc_hmacsha512_t ctx,
const unsigned char *  buf,
unsigned int  len 
)

Definition at line 940 of file hmacsha.c.

References isc_sha512_update(), and isc_hmacsha512_t::sha512ctx.

Referenced by ATF_TC_BODY(), hmacsha512_adddata(), sign(), and verify().

void isc_hmacsha512_sign ( isc_hmacsha512_t ctx,
unsigned char *  digest,
size_t  len 
)

Definition at line 950 of file hmacsha.c.

References ISC_SHA512_BLOCK_LENGTH, ISC_SHA512_DIGESTLENGTH, isc_sha512_final(), isc_sha512_init(), isc_sha512_update(), isc_hmacsha512_t::key, OPAD, REQUIRE, and isc_hmacsha512_t::sha512ctx.

Referenced by ATF_TC_BODY(), hmacsha512_sign(), isc_hmacsha512_verify(), sign(), and verify().

isc_boolean_t isc_hmacsha512_verify ( isc_hmacsha512_t ctx,
unsigned char *  digest,
size_t  len 
)

Definition at line 1028 of file hmacsha.c.

References isc_hmacsha512_sign(), isc_safe_memcmp(), ISC_SHA512_DIGESTLENGTH, and REQUIRE.

Referenced by hmacsha512_verify().


Generated on Tue Apr 28 17:41:15 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha