From: Steve Peters Date: Sat, 26 Nov 2005 11:40:57 +0000 (+0000) Subject: Actually update one of the files from the previous change. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ec81b1ec874152d7aa4951978d0c0ca767a2224f;p=p5sagit%2Fp5-mst-13.2.git Actually update one of the files from the previous change. p4raw-id: //depot/perl@26210 --- diff --git a/lib/Digest.pm b/lib/Digest.pm index f901fdb..eb7469a 100644 --- a/lib/Digest.pm +++ b/lib/Digest.pm @@ -3,7 +3,7 @@ package Digest; use strict; use vars qw($VERSION %MMAP $AUTOLOAD); -$VERSION = "1.13"; +$VERSION = "1.14"; %MMAP = ( "SHA-1" => ["Digest::SHA1", ["Digest::SHA", 1], ["Digest::SHA2", 1]], @@ -80,11 +80,18 @@ bytes or bits. An important property of the digest algorithms is that the digest is I to change if the message change in some way. Another -property is that digest functions are one-way functions, i.e. it +property is that digest functions are one-way functions, that is it should be I to find a message that correspond to some given digest. Algorithms differ in how "likely" and how "hard", as well as how efficient they are to compute. +Note that the properties of the algorithms change over time, as the +algorithms are analyzed and machines grow faster. If your application +for instance depends on it being "impossible" to generate the same +digest for a different message it is wise to make it easy to plug in +stronger algorithms as the one used grow weaker. Using the interface +documented here should make it easy to change algorithms later. + All C modules provide the same programming interface. A functional interface for simple use, as well as an object oriented interface that can handle messages of arbitrary length and which can @@ -182,7 +189,7 @@ The two argument form of add_bits() will add the first $nbits bits from data. For the last potentially partial byte only the high order C<< $nbits % 8 >> bits are used. If $nbits is greater than C<< length($data) * 8 >>, then this method would do the same as C<< -$ctx->add($data) >>, i.e. $nbits is silently ignored. +$ctx->add($data) >>, that is $nbits is silently ignored. The one argument form of add_bits() takes a $bitstring of "1" and "0" chars as argument. It's a shorthand for C<< $ctx->add_bits(pack("B*",