diff --git a/Crypto/MAC/HMAC.hs b/Crypto/MAC/HMAC.hs
new file mode 100644
--- /dev/null
+++ b/Crypto/MAC/HMAC.hs
@@ -0,0 +1,27 @@
+-- |
+-- Module      : Crypto.MAC.HMAC
+-- License     : BSD-style
+-- Maintainer  : Vincent Hanquez <vincent@snarc.org>
+-- Stability   : experimental
+-- Portability : unknown
+--
+-- provide the HMAC (Hash based Message Authentification Code) base algorithm.
+-- http://en.wikipedia.org/wiki/HMAC
+--
+module Crypto.MAC.HMAC
+	( hmac
+	) where
+
+import Data.ByteString (ByteString)
+import qualified Data.ByteString as B
+import Data.Bits (xor)
+
+-- | compute a MAC using the supplied hashing function
+hmac :: (ByteString -> ByteString) -> Int -> ByteString -> ByteString -> ByteString
+hmac f blockSize secret msg = f $ B.append opad (f $ B.append ipad msg) where
+	opad = B.map (xor 0x5c) k'
+	ipad = B.map (xor 0x36) k'
+
+	k' = B.append kt pad
+	kt = if B.length secret > fromIntegral blockSize then f secret else secret
+	pad = B.replicate (fromIntegral blockSize - B.length kt) 0
diff --git a/cryptohash.cabal b/cryptohash.cabal
--- a/cryptohash.cabal
+++ b/cryptohash.cabal
@@ -1,5 +1,5 @@
 Name:                cryptohash
-Version:             0.7.3
+Version:             0.7.4
 Description:
     A collection of crypto hashes, with a practical incremental and one-pass, pure APIs,
     with performance close to the fastest implementations available in others languages.
@@ -51,6 +51,7 @@
                      Crypto.Hash.Skein256
                      Crypto.Hash.Skein512
                      Crypto.Hash.Tiger
+                     Crypto.MAC.HMAC
   ghc-options:       -Wall -O2 -optc-O3 -fno-cse
   C-sources:         cbits/sha1.c
                      cbits/sha256.c
