Digest::SHA 5.43_01 - ANSIfy src/hmac.c
authorJarkko Hietaniemi <jhi@iki.fi>
Mon, 9 Oct 2006 14:24:09 +0000 (17:24 +0300)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Mon, 9 Oct 2006 12:28:11 +0000 (12:28 +0000)
Message-ID: <452A3159.3060003@iki.fi>

p4raw-id: //depot/perl@28971

ext/Digest/SHA/SHA.pm
ext/Digest/SHA/src/hmac.c

index bcb8bce..48a7208 100644 (file)
@@ -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);
index 95d5c39..4fd7610 100644 (file)
 #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));