Index: wp-includes/compat.php
===================================================================
--- wp-includes/compat.php	(revision 18099)
+++ wp-includes/compat.php	(working copy)
@@ -31,3 +31,32 @@
 	$chars = is_null( $length )? array_slice( $match[0], $start ) : array_slice( $match[0], $start, $length );
 	return implode( '', $chars );
 }
+
+if ( !function_exists('hash_hmac') ):
+function hash_hmac($algo, $data, $key, $raw_output = false) {
+	return _hash_hmac($algo, $data, $key, $raw_output);
+}
+endif;
+
+function _hash_hmac($algo, $data, $key, $raw_output = false) {
+	$packs = array('md5' => 'H32', 'sha1' => 'H40');
+
+	if ( !isset($packs[$algo]) )
+		return false;
+
+	$pack = $packs[$algo];
+
+	if (strlen($key) > 64)
+		$key = pack($pack, $algo($key));
+
+	$key = str_pad($key, 64, chr(0));
+
+	$ipad = (substr($key, 0, 64) ^ str_repeat(chr(0x36), 64));
+	$opad = (substr($key, 0, 64) ^ str_repeat(chr(0x5C), 64));
+
+	$hmac = $algo($opad . pack($pack, $algo($ipad . $data)));
+
+	if ( $raw_output )
+		return pack( $pack, $hmac );
+	return $hmac;
+}
