hmacsha.c File Reference

#include "config.h"
#include <isc/assertions.h>
#include <isc/hmacsha.h>
#include <isc/platform.h>
#include <isc/safe.h>
#include <isc/sha1.h>
#include <isc/sha2.h>
#include <isc/string.h>
#include <isc/types.h>
#include <isc/util.h>

Go to the source code of this file.

Defines

#define IPAD   0x36
#define OPAD   0x5C

Functions

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)
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)
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)
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)
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_hmacsha1_verify (isc_hmacsha1_t *ctx, unsigned char *digest, size_t len)
isc_boolean_t isc_hmacsha224_verify (isc_hmacsha224_t *ctx, unsigned char *digest, size_t len)
isc_boolean_t isc_hmacsha256_verify (isc_hmacsha256_t *ctx, unsigned char *digest, size_t len)
isc_boolean_t isc_hmacsha384_verify (isc_hmacsha384_t *ctx, unsigned char *digest, size_t len)
isc_boolean_t isc_hmacsha512_verify (isc_hmacsha512_t *ctx, unsigned char *digest, size_t len)


Define Documentation

#define IPAD   0x36

Definition at line 635 of file hmacsha.c.

#define OPAD   0x5C

Definition at line 636 of file hmacsha.c.


Function Documentation

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().

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().

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().

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().

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_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().

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().

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().

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().

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:14 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha