diff --git a/happstack-util.cabal b/happstack-util.cabal
--- a/happstack-util.cabal
+++ b/happstack-util.cabal
@@ -1,5 +1,5 @@
 Name:                happstack-util
-Version:             6.0.2
+Version:             6.0.3
 Synopsis:            Web framework
 License:             BSD3
 License-file:        COPYING
diff --git a/src/Happstack/Crypto/SHA1.lhs b/src/Happstack/Crypto/SHA1.lhs
--- a/src/Happstack/Crypto/SHA1.lhs
+++ b/src/Happstack/Crypto/SHA1.lhs
@@ -161,5 +161,5 @@
 >     where getn n = chr (fromIntegral (x0 `shiftR` (n*8) .&. 0xFF))
 
 > rotL :: Word32 -> Rotation -> Word32
-> rotL a s = shiftL a s .|. shiftL a (s-32)
+> rotL a s = shiftL a s .|. shiftR a (32 - s)
 
