summaryrefslogtreecommitdiff
path: root/src/share/keytrans
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2009-04-06 21:09:12 -0400
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>2009-04-06 21:09:12 -0400
commit5df09d935f33477cdd9763c0e9c1ba7c8073aea0 (patch)
tree4ab1a9f21cf3a84c22ab085cd2b27ec0aa6b5c49 /src/share/keytrans
parent8a10cedafffa08873508598c9bff0c12e1c5d278 (diff)
more portable perl-based simple_checksum; i think this is correct, but i welcome any pointers about what i might be getting wrong.
Diffstat (limited to 'src/share/keytrans')
-rwxr-xr-xsrc/share/keytrans4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/share/keytrans b/src/share/keytrans
index 8b2e2ea..e6777ff 100755
--- a/src/share/keytrans
+++ b/src/share/keytrans
@@ -195,11 +195,11 @@ my $keyserver_prefs = { nomodify => 0x80
########### Math/Utility Functions ##############
-# see the bottom of page 43 of RFC 4880
+# see the bottom of page 44 of RFC 4880 (http://tools.ietf.org/html/rfc4880#page-44)
sub simple_checksum {
my $bytes = shift;
- return unpack("%32W*",$bytes) % 65536;
+ return unpack("%16C*",$bytes);
}
# calculate the multiplicative inverse of a mod b this is euclid's