From 6b691a5c85ddc4e407e32781841fee5c029506cd Mon Sep 17 00:00:00 2001 From: Ulf Möller Date: Mon, 19 Apr 1999 21:31:43 +0000 Subject: Change functions to ANSI C. --- crypto/hmac/hmac.c | 29 ++++++----------------------- crypto/hmac/hmactest.c | 7 ++----- 2 files changed, 8 insertions(+), 28 deletions(-) (limited to 'crypto/hmac') diff --git a/crypto/hmac/hmac.c b/crypto/hmac/hmac.c index ead5f649f8..64c5162130 100644 --- a/crypto/hmac/hmac.c +++ b/crypto/hmac/hmac.c @@ -60,11 +60,7 @@ #include #include "hmac.h" -void HMAC_Init(ctx,key,len,md) -HMAC_CTX *ctx; -unsigned char *key; -int len; -const EVP_MD *md; +void HMAC_Init(HMAC_CTX *ctx, unsigned char *key, int len, const EVP_MD *md) { int i,j,reset=0; unsigned char pad[HMAC_MAX_MD_CBLOCK]; @@ -112,18 +108,12 @@ const EVP_MD *md; memcpy(&ctx->md_ctx,&ctx->i_ctx,sizeof(ctx->i_ctx)); } -void HMAC_Update(ctx,data,len) -HMAC_CTX *ctx; -unsigned char *data; -int len; +void HMAC_Update(HMAC_CTX *ctx, unsigned char *data, int len) { EVP_DigestUpdate(&(ctx->md_ctx),data,len); } -void HMAC_Final(ctx,md,len) -HMAC_CTX *ctx; -unsigned char *md; -unsigned int *len; +void HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len) { int j; unsigned int i; @@ -137,20 +127,13 @@ unsigned int *len; EVP_DigestFinal(&(ctx->md_ctx),md,len); } -void HMAC_cleanup(ctx) -HMAC_CTX *ctx; +void HMAC_cleanup(HMAC_CTX *ctx) { memset(ctx,0,sizeof(HMAC_CTX)); } -unsigned char *HMAC(evp_md,key,key_len,d,n,md,md_len) -EVP_MD *evp_md; -unsigned char *key; -int key_len; -unsigned char *d; -int n; -unsigned char *md; -unsigned int *md_len; +unsigned char *HMAC(EVP_MD *evp_md, unsigned char *key, int key_len, + unsigned char *d, int n, unsigned char *md, unsigned int *md_len) { HMAC_CTX c; static unsigned char m[EVP_MAX_MD_SIZE]; diff --git a/crypto/hmac/hmactest.c b/crypto/hmac/hmactest.c index 5938e375dc..13b3946348 100644 --- a/crypto/hmac/hmactest.c +++ b/crypto/hmac/hmactest.c @@ -108,9 +108,7 @@ static char *pt(unsigned char *md); static char *pt(); #endif -int main(argc,argv) -int argc; -char *argv[]; +int main(int argc, char *argv[]) { int i,err=0; char *p; @@ -135,8 +133,7 @@ char *argv[]; return(0); } -static char *pt(md) -unsigned char *md; +static char *pt(unsigned char *md) { int i; static char buf[80]; -- cgit v1.2.3