summaryrefslogtreecommitdiff
path: root/cpan
diff options
context:
space:
mode:
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>2011-03-09 14:45:15 +0000
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>2011-03-09 14:46:31 +0000
commit340a2f445163cea6a1888123fca6cdf5f47a95b3 (patch)
tree71d01cb435cd3ec4b18665b492d83332233f28c4 /cpan
parent133589c34f08d0c23609ff1f3e6f39430badddfc (diff)
downloadperl-340a2f445163cea6a1888123fca6cdf5f47a95b3.tar.gz
Update Digest-SHA to CPAN version 5.61
5.61 Wed Mar 9 05:26:36 MST 2011 - corrected bug in 'algorithm' method - fixed -x option in Makefile.PL -- not often used since it deliberately excludes all 64-bit SHA transforms - addressed minor documentation oversights
Diffstat (limited to 'cpan')
-rw-r--r--cpan/Digest-SHA/Changes7
-rw-r--r--cpan/Digest-SHA/README8
-rw-r--r--cpan/Digest-SHA/SHA.xs4
-rw-r--r--cpan/Digest-SHA/lib/Digest/SHA.pm19
-rw-r--r--cpan/Digest-SHA/shasum6
-rw-r--r--cpan/Digest-SHA/src/hmac.c4
-rw-r--r--cpan/Digest-SHA/src/hmac.h4
-rw-r--r--cpan/Digest-SHA/src/sha.c10
-rw-r--r--cpan/Digest-SHA/src/sha.h5
-rw-r--r--cpan/Digest-SHA/src/sha64bit.c4
-rw-r--r--cpan/Digest-SHA/src/sha64bit.h2
11 files changed, 45 insertions, 28 deletions
diff --git a/cpan/Digest-SHA/Changes b/cpan/Digest-SHA/Changes
index c415e13dd5..6bcacdc2a3 100644
--- a/cpan/Digest-SHA/Changes
+++ b/cpan/Digest-SHA/Changes
@@ -1,5 +1,12 @@
Revision history for Perl extension Digest::SHA.
+5.61 Wed Mar 9 05:26:36 MST 2011
+ - corrected bug in 'algorithm' method
+ - fixed -x option in Makefile.PL
+ -- not often used since it deliberately excludes
+ all 64-bit SHA transforms
+ - addressed minor documentation oversights
+
5.60 Thu Mar 3 05:26:42 MST 2011
- added new SHA-512/224 and SHA-512/256 transforms
-- ref. NIST Draft FIPS 180-4 (February 2011)
diff --git a/cpan/Digest-SHA/README b/cpan/Digest-SHA/README
index d03e174322..3d393b551a 100644
--- a/cpan/Digest-SHA/README
+++ b/cpan/Digest-SHA/README
@@ -1,11 +1,11 @@
-Digest::SHA version 5.60
+Digest::SHA version 5.61
========================
Digest::SHA is a complete implementation of the NIST Secure Hash
Standard. It gives Perl programmers a convenient way to calculate
-SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512 message digests.
-The module can handle all types of input, including partial-byte
-data.
+SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224, and SHA-512/256
+message digests. The module can handle all types of input, including
+partial-byte data.
Digest::SHA is written in C for speed. If your platform lacks a
C compiler, you can install the functionally-equivalent (but much
diff --git a/cpan/Digest-SHA/SHA.xs b/cpan/Digest-SHA/SHA.xs
index 9cd22ded35..7088a33bf6 100644
--- a/cpan/Digest-SHA/SHA.xs
+++ b/cpan/Digest-SHA/SHA.xs
@@ -166,9 +166,7 @@ PREINIT:
int result;
PPCODE:
state = INT2PTR(SHA *, SvIV(SvRV(SvRV(self))));
- result = shadsize(state) << 3;
- if (ix == 1 && result == 160)
- result = 1;
+ result = ix ? shaalg(state) : shadsize(state) << 3;
ST(0) = sv_2mortal(newSViv(result));
XSRETURN(1);
diff --git a/cpan/Digest-SHA/lib/Digest/SHA.pm b/cpan/Digest-SHA/lib/Digest/SHA.pm
index acdc3cedd4..f809ce3afb 100644
--- a/cpan/Digest-SHA/lib/Digest/SHA.pm
+++ b/cpan/Digest-SHA/lib/Digest/SHA.pm
@@ -7,7 +7,7 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
use Fcntl;
use integer;
-$VERSION = '5.60';
+$VERSION = '5.61';
require Exporter;
require DynaLoader;
@@ -430,10 +430,11 @@ I<OOP style>
=item B<new($alg)>
-Returns a new Digest::SHA object. Allowed values for I<$alg> are
-1, 224, 256, 384, or 512. It's also possible to use common string
-representations of the algorithm (e.g. "sha256", "SHA-384"). If
-the argument is missing, SHA-1 will be used by default.
+Returns a new Digest::SHA object. Allowed values for I<$alg> are 1,
+224, 256, 384, 512, 512224, or 512256. It's also possible to use
+common string representations of the algorithm (e.g. "sha256",
+"SHA-384"). If the argument is missing, SHA-1 will be used by
+default.
Invoking I<new> as an instance method will not create a new object;
instead, it will simply reset the object to the initial state
@@ -448,14 +449,14 @@ I<reset> is just an alias for I<new>.
=item B<hashsize>
Returns the number of digest bits for this object. The values are
-160, 224, 256, 384, and 512 for SHA-1, SHA-224, SHA-256, SHA-384,
-and SHA-512, respectively.
+160, 224, 256, 384, 512, 224, and 256 for SHA-1, SHA-224, SHA-256,
+SHA-384, SHA-512, SHA-512/224 and SHA-512/256, respectively.
=item B<algorithm>
Returns the digest algorithm for this object. The values are 1,
-224, 256, 384, and 512 for SHA-1, SHA-224, SHA-256, SHA-384, and
-SHA-512, respectively.
+224, 256, 384, 512, 512224, and 512256 for SHA-1, SHA-224, SHA-256,
+SHA-384, SHA-512, SHA-512/224, and SHA-512/256, respectively.
=item B<clone>
diff --git a/cpan/Digest-SHA/shasum b/cpan/Digest-SHA/shasum
index 4e256fc01e..0a584cca0e 100644
--- a/cpan/Digest-SHA/shasum
+++ b/cpan/Digest-SHA/shasum
@@ -4,8 +4,8 @@
##
## Copyright (C) 2003-2011 Mark Shelor, All Rights Reserved
##
- ## Version: 5.60
- ## Thu Mar 3 05:26:42 MST 2011
+ ## Version: 5.61
+ ## Wed Mar 9 05:26:36 MST 2011
## shasum SYNOPSIS adapted from GNU Coreutils sha1sum.
## Include an "-a" option for algorithm selection, and a
@@ -85,7 +85,7 @@ use strict;
use Fcntl;
use Getopt::Long;
-my $VERSION = "5.60";
+my $VERSION = "5.61";
## Try to use Digest::SHA. If not installed, use the slower
diff --git a/cpan/Digest-SHA/src/hmac.c b/cpan/Digest-SHA/src/hmac.c
index 7c8dea7324..12ca2a80ae 100644
--- a/cpan/Digest-SHA/src/hmac.c
+++ b/cpan/Digest-SHA/src/hmac.c
@@ -5,8 +5,8 @@
*
* Copyright (C) 2003-2011 Mark Shelor, All Rights Reserved
*
- * Version: 5.60
- * Thu Mar 3 05:26:42 MST 2011
+ * Version: 5.61
+ * Wed Mar 9 05:26:36 MST 2011
*
*/
diff --git a/cpan/Digest-SHA/src/hmac.h b/cpan/Digest-SHA/src/hmac.h
index 9a52d875f9..9a29419cb7 100644
--- a/cpan/Digest-SHA/src/hmac.h
+++ b/cpan/Digest-SHA/src/hmac.h
@@ -5,8 +5,8 @@
*
* Copyright (C) 2003-2011 Mark Shelor, All Rights Reserved
*
- * Version: 5.60
- * Thu Mar 3 05:26:42 MST 2011
+ * Version: 5.61
+ * Wed Mar 9 05:26:36 MST 2011
*
*/
diff --git a/cpan/Digest-SHA/src/sha.c b/cpan/Digest-SHA/src/sha.c
index e77ff3f373..20f2d7157e 100644
--- a/cpan/Digest-SHA/src/sha.c
+++ b/cpan/Digest-SHA/src/sha.c
@@ -5,8 +5,8 @@
*
* Copyright (C) 2003-2011 Mark Shelor, All Rights Reserved
*
- * Version: 5.60
- * Thu Mar 3 05:26:42 MST 2011
+ * Version: 5.61
+ * Wed Mar 9 05:26:36 MST 2011
*
*/
@@ -473,6 +473,12 @@ int shadsize(SHA *s)
return(s->digestlen);
}
+/* shaalg: returns which SHA algorithm is being used */
+int shaalg(SHA *s)
+{
+ return(s->alg);
+}
+
/* shadup: duplicates current digest object */
SHA *shadup(SHA *s)
{
diff --git a/cpan/Digest-SHA/src/sha.h b/cpan/Digest-SHA/src/sha.h
index 82efe48373..cb7610ff43 100644
--- a/cpan/Digest-SHA/src/sha.h
+++ b/cpan/Digest-SHA/src/sha.h
@@ -5,8 +5,8 @@
*
* Copyright (C) 2003-2011 Mark Shelor, All Rights Reserved
*
- * Version: 5.60
- * Thu Mar 3 05:26:42 MST 2011
+ * Version: 5.61
+ * Wed Mar 9 05:26:36 MST 2011
*
*/
@@ -211,6 +211,7 @@ unsigned char *shadigest (_SHA_STATE);
char *shahex (_SHA_STATE);
char *shabase64 (_SHA_STATE);
int shadsize (_SHA_STATE);
+int shaalg (_SHA_STATE);
SHA *shadup (_SHA_STATE);
int shadump (_SHA_FNAME, _SHA_STATE);
SHA *shaload (_SHA_FNAME);
diff --git a/cpan/Digest-SHA/src/sha64bit.c b/cpan/Digest-SHA/src/sha64bit.c
index aaf87f83fc..b37d6f3c09 100644
--- a/cpan/Digest-SHA/src/sha64bit.c
+++ b/cpan/Digest-SHA/src/sha64bit.c
@@ -6,6 +6,8 @@
#undef sha512
#undef H0384
#undef H0512
+#undef H0512224
+#undef H0512256
#define sha_384_512 1
@@ -70,8 +72,8 @@ static W64 H0512224[8] = /* SHA-512/224 initial hash value */
C64(0x8c3d37c819544da2), C64(0x73e1996689dcd4d6), C64(0x1dfab7ae32ff9c82),
C64(0x679dd514582f9fcf), C64(0x0f6d2b697bd44da8), C64(0x77e36f7304c48942),
C64(0x3f9d85a86a1d36c8), C64(0x1112e6ad91d692a1)
-
};
+
static W64 H0512256[8] = /* SHA-512/256 initial hash value */
{
C64(0x22312194fc2bf72c), C64(0x9f555fa3c84c64c2), C64(0x2393b86b6f53b151),
diff --git a/cpan/Digest-SHA/src/sha64bit.h b/cpan/Digest-SHA/src/sha64bit.h
index 5a02c92ddd..c4fe7666bd 100644
--- a/cpan/Digest-SHA/src/sha64bit.h
+++ b/cpan/Digest-SHA/src/sha64bit.h
@@ -13,3 +13,5 @@
#define sha512 NULL
#define H0384 H01
#define H0512 H01
+#define H0512224 H01
+#define H0512256 H01