Commit fc7685a7 authored by Mark Andrews's avatar Mark Andrews
Browse files

silence compiler warnings

parent 68e0fce2
......@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: hmacsha.c,v 1.3 2006/01/27 23:57:46 marka Exp $ */
/* $Id: hmacsha.c,v 1.4 2006/01/31 00:35:21 marka Exp $ */
/*
* This code implements the HMAC-SHA1, HMAC-SHA224, HMAC-SHA256, HMAC-SHA384
......@@ -40,10 +40,10 @@
*/
void
isc_hmacsha1_init(isc_hmacsha1_t *ctx, const unsigned char *key,
unsigned int len)
unsigned int len)
{
unsigned char ipad[ISC_SHA1_DIGESTLENGTH];
int i;
unsigned int i;
memset(ctx->key, 0, sizeof(ctx->key));
if (len > sizeof(ctx->key)) {
......@@ -86,7 +86,7 @@ void
isc_hmacsha1_sign(isc_hmacsha1_t *ctx, unsigned char *digest, size_t len) {
unsigned char opad[ISC_SHA1_DIGESTLENGTH];
unsigned char newdigest[ISC_SHA1_DIGESTLENGTH];
int i;
unsigned int i;
REQUIRE(len <= ISC_SHA1_DIGESTLENGTH);
isc_sha1_final(&ctx->sha1ctx, newdigest);
......@@ -122,10 +122,10 @@ 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)
unsigned int len)
{
unsigned char ipad[ISC_SHA224_DIGESTLENGTH];
int i;
unsigned int i;
memset(ctx->key, 0, sizeof(ctx->key));
if (len > sizeof(ctx->key)) {
......@@ -167,7 +167,7 @@ void
isc_hmacsha224_sign(isc_hmacsha224_t *ctx, unsigned char *digest, size_t len) {
unsigned char opad[ISC_SHA224_DIGESTLENGTH];
unsigned char newdigest[ISC_SHA224_DIGESTLENGTH];
int i;
unsigned int i;
REQUIRE(len <= ISC_SHA224_DIGESTLENGTH);
isc_sha224_final(newdigest, &ctx->sha224ctx);
......@@ -202,10 +202,10 @@ 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)
unsigned int len)
{
unsigned char ipad[ISC_SHA256_DIGESTLENGTH];
int i;
unsigned int i;
memset(ctx->key, 0, sizeof(ctx->key));
if (len > sizeof(ctx->key)) {
......@@ -247,7 +247,7 @@ void
isc_hmacsha256_sign(isc_hmacsha256_t *ctx, unsigned char *digest, size_t len) {
unsigned char opad[ISC_SHA256_DIGESTLENGTH];
unsigned char newdigest[ISC_SHA256_DIGESTLENGTH];
int i;
unsigned int i;
REQUIRE(len <= ISC_SHA256_DIGESTLENGTH);
isc_sha256_final(newdigest, &ctx->sha256ctx);
......@@ -282,10 +282,10 @@ 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)
unsigned int len)
{
unsigned char ipad[ISC_SHA384_DIGESTLENGTH];
int i;
unsigned int i;
memset(ctx->key, 0, sizeof(ctx->key));
if (len > sizeof(ctx->key)) {
......@@ -327,7 +327,7 @@ void
isc_hmacsha384_sign(isc_hmacsha384_t *ctx, unsigned char *digest, size_t len) {
unsigned char opad[ISC_SHA384_DIGESTLENGTH];
unsigned char newdigest[ISC_SHA384_DIGESTLENGTH];
int i;
unsigned int i;
REQUIRE(len <= ISC_SHA384_DIGESTLENGTH);
isc_sha384_final(newdigest, &ctx->sha384ctx);
......@@ -362,10 +362,10 @@ 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)
unsigned int len)
{
unsigned char ipad[ISC_SHA512_DIGESTLENGTH];
int i;
unsigned int i;
memset(ctx->key, 0, sizeof(ctx->key));
if (len > sizeof(ctx->key)) {
......@@ -407,7 +407,7 @@ void
isc_hmacsha512_sign(isc_hmacsha512_t *ctx, unsigned char *digest, size_t len) {
unsigned char opad[ISC_SHA512_DIGESTLENGTH];
unsigned char newdigest[ISC_SHA512_DIGESTLENGTH];
int i;
unsigned int i;
REQUIRE(len <= ISC_SHA512_DIGESTLENGTH);
isc_sha512_final(newdigest, &ctx->sha512ctx);
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: md5.h,v 1.11 2005/04/29 00:23:40 marka Exp $ */
/* $Id: md5.h,v 1.12 2006/01/31 00:35:21 marka Exp $ */
/*! \file
* \brief This is the header file for the MD5 message-digest algorithm.
......@@ -46,7 +46,7 @@
#include <isc/lang.h>
#include <isc/types.h>
#define ISC_MD5_DIGESTLENGTH 16
#define ISC_MD5_DIGESTLENGTH 16U
typedef struct {
isc_uint32_t buf[4];
......
......@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: sha2.h,v 1.3 2006/01/27 23:57:46 marka Exp $ */
/* $Id: sha2.h,v 1.4 2006/01/31 00:35:21 marka Exp $ */
/* $FreeBSD: src/sys/crypto/sha2/sha2.h,v 1.1.2.1 2001/07/03 11:01:36 ume Exp $ */
/* $KAME: sha2.h,v 1.3 2001/03/12 08:27:48 itojun Exp $ */
......@@ -62,16 +62,16 @@
/*** SHA-224/256/384/512 Various Length Definitions ***********************/
#define ISC_SHA224_DIGESTLENGTH 28
#define ISC_SHA224_DIGESTLENGTH 28U
#define ISC_SHA224_DIGESTSTRINGLENGTH (ISC_SHA224_DIGESTLENGTH * 2 + 1)
#define ISC_SHA256_BLOCK_LENGTH 64
#define ISC_SHA256_DIGESTLENGTH 32
#define ISC_SHA256_DIGESTLENGTH 32U
#define ISC_SHA256_DIGESTSTRINGLENGTH (ISC_SHA256_DIGESTLENGTH * 2 + 1)
#define ISC_SHA384_BLOCK_LENGTH 128
#define ISC_SHA384_DIGESTLENGTH 48
#define ISC_SHA384_DIGESTLENGTH 48U
#define ISC_SHA384_DIGESTSTRINGLENGTH (ISC_SHA384_DIGESTLENGTH * 2 + 1)
#define ISC_SHA512_BLOCK_LENGTH 128
#define ISC_SHA512_DIGESTLENGTH 64
#define ISC_SHA512_DIGESTLENGTH 64U
#define ISC_SHA512_DIGESTSTRINGLENGTH (ISC_SHA512_DIGESTLENGTH * 2 + 1)
......
......@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: sha2.c,v 1.4 2006/01/31 00:10:57 marka Exp $ */
/* $Id: sha2.c,v 1.5 2006/01/31 00:35:21 marka Exp $ */
/* $FreeBSD: src/sys/crypto/sha2/sha2.c,v 1.2.2.2 2002/03/05 08:36:47 ume Exp $ */
/* $KAME: sha2.c,v 1.8 2001/11/08 01:07:52 itojun Exp $ */
......@@ -327,7 +327,8 @@ isc_sha224_init(isc_sha224_t *context) {
if (context == (isc_sha256_t *)0) {
return;
}
memcpy(context->state, sha224_initial_hash_value, ISC_SHA256_DIGESTLENGTH);
memcpy(context->state, sha224_initial_hash_value,
ISC_SHA256_DIGESTLENGTH);
memset(context->buffer, 0, ISC_SHA256_BLOCK_LENGTH);
context->bitcount = 0;
}
......@@ -348,7 +349,7 @@ isc_sha224_final(isc_uint8_t digest[], isc_sha256_t *context) {
char *
isc_sha224_end(isc_sha224_t *context, char buffer[]) {
isc_uint8_t digest[ISC_SHA224_DIGESTLENGTH], *d = digest;
int i;
unsigned int i;
/* Sanity check: */
REQUIRE(context != (isc_sha224_t *)0);
......@@ -386,7 +387,8 @@ isc_sha256_init(isc_sha256_t *context) {
if (context == (isc_sha256_t *)0) {
return;
}
memcpy(context->state, sha256_initial_hash_value, ISC_SHA256_DIGESTLENGTH);
memcpy(context->state, sha256_initial_hash_value,
ISC_SHA256_DIGESTLENGTH);
memset(context->buffer, 0, ISC_SHA256_BLOCK_LENGTH);
context->bitcount = 0;
}
......@@ -683,7 +685,7 @@ isc_sha256_final(isc_uint8_t digest[], isc_sha256_t *context) {
char *
isc_sha256_end(isc_sha256_t *context, char buffer[]) {
isc_uint8_t digest[ISC_SHA256_DIGESTLENGTH], *d = digest;
int i;
unsigned int i;
/* Sanity check: */
REQUIRE(context != (isc_sha256_t *)0);
......@@ -722,7 +724,8 @@ isc_sha512_init(isc_sha512_t *context) {
if (context == (isc_sha512_t *)0) {
return;
}
memcpy(context->state, sha512_initial_hash_value, ISC_SHA512_DIGESTLENGTH);
memcpy(context->state, sha512_initial_hash_value,
ISC_SHA512_DIGESTLENGTH);
memset(context->buffer, 0, ISC_SHA512_BLOCK_LENGTH);
context->bitcount[0] = context->bitcount[1] = 0;
}
......@@ -1018,7 +1021,7 @@ void isc_sha512_final(isc_uint8_t digest[], isc_sha512_t *context) {
char *
isc_sha512_end(isc_sha512_t *context, char buffer[]) {
isc_uint8_t digest[ISC_SHA512_DIGESTLENGTH], *d = digest;
int i;
unsigned int i;
/* Sanity check: */
REQUIRE(context != (isc_sha512_t *)0);
......@@ -1057,7 +1060,8 @@ isc_sha384_init(isc_sha384_t *context) {
if (context == (isc_sha384_t *)0) {
return;
}
memcpy(context->state, sha384_initial_hash_value, ISC_SHA512_DIGESTLENGTH);
memcpy(context->state, sha384_initial_hash_value,
ISC_SHA512_DIGESTLENGTH);
memset(context->buffer, 0, ISC_SHA384_BLOCK_LENGTH);
context->bitcount[0] = context->bitcount[1] = 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment