summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2006-10-09 17:24:09 +0300
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-10-09 12:28:11 +0000
commit14bcf1fba6025667471d613a7140a38e72169526 (patch)
treebd2942726628daa6ae3aabe4a4dd8eea266dd472
parentf6eae373eea5b82b52f1f0b35a663b690f50dd27 (diff)
downloadperl-14bcf1fba6025667471d613a7140a38e72169526.tar.gz
Digest::SHA 5.43_01 - ANSIfy src/hmac.c
Message-ID: <452A3159.3060003@iki.fi> p4raw-id: //depot/perl@28971
-rw-r--r--ext/Digest/SHA/SHA.pm2
-rw-r--r--ext/Digest/SHA/src/hmac.c25
2 files changed, 8 insertions, 19 deletions
diff --git a/ext/Digest/SHA/SHA.pm b/ext/Digest/SHA/SHA.pm
index bcb8bce4eb..48a720848a 100644
--- a/ext/Digest/SHA/SHA.pm
+++ b/ext/Digest/SHA/SHA.pm
@@ -6,7 +6,7 @@ use strict;
use warnings;
use integer;
-our $VERSION = '5.43';
+our $VERSION = '5.43_01';
require Exporter;
our @ISA = qw(Exporter);
diff --git a/ext/Digest/SHA/src/hmac.c b/ext/Digest/SHA/src/hmac.c
index 95d5c396ba..4fd7610de0 100644
--- a/ext/Digest/SHA/src/hmac.c
+++ b/ext/Digest/SHA/src/hmac.c
@@ -17,10 +17,7 @@
#include "sha.h"
/* hmacopen: creates a new HMAC-SHA digest object */
-HMAC *hmacopen(alg, key, keylen)
-int alg;
-unsigned char *key;
-unsigned int keylen;
+HMAC *hmacopen(int alg, unsigned char *key, unsigned int keylen)
{
unsigned int i;
HMAC *h;
@@ -62,17 +59,13 @@ unsigned int keylen;
}
/* hmacwrite: triggers a state update using data in bitstr/bitcnt */
-unsigned long hmacwrite(bitstr, bitcnt, h)
-unsigned char *bitstr;
-unsigned long bitcnt;
-HMAC *h;
+unsigned long hmacwrite(unsigned char *bitstr, unsigned long bitcnt, HMAC *h)
{
return(shawrite(bitstr, bitcnt, h->isha));
}
/* hmacfinish: computes final digest state */
-void hmacfinish(h)
-HMAC *h;
+void hmacfinish(HMAC *h)
{
shafinish(h->isha);
shawrite(shadigest(h->isha), h->isha->digestlen * 8, h->osha);
@@ -81,29 +74,25 @@ HMAC *h;
}
/* hmacdigest: returns pointer to digest (binary) */
-unsigned char *hmacdigest(h)
-HMAC *h;
+unsigned char *hmacdigest(HMAC *h)
{
return(shadigest(h->osha));
}
/* hmachex: returns pointer to digest (hexadecimal) */
-char *hmachex(h)
-HMAC *h;
+char *hmachex(HMAC *h)
{
return(shahex(h->osha));
}
/* hmacbase64: returns pointer to digest (Base 64) */
-char *hmacbase64(h)
-HMAC *h;
+char *hmacbase64(HMAC *h)
{
return(shabase64(h->osha));
}
/* hmacclose: de-allocates digest object */
-int hmacclose(h)
-HMAC *h;
+int hmacclose(HMAC *h)
{
shaclose(h->osha);
memset(h, 0, sizeof(HMAC));