unsigned int index, padLen;
/* Save number of bits */
- bits[0] = context->count[0] & 0xFF;
- bits[1] = (context->count[0] >> 8) & 0xFF;
- bits[2] = (context->count[0] >> 16) & 0xFF;
- bits[3] = (context->count[0] >> 24) & 0xFF;
- bits[4] = context->count[1] & 0xFF;
- bits[5] = (context->count[1] >> 8) & 0xFF;
- bits[6] = (context->count[1] >> 16) & 0xFF;
- bits[7] = (context->count[1] >> 24) & 0xFF;
+ bits[0] = (unsigned char) (context->count[0] & 0xFF);
+ bits[1] = (unsigned char) ((context->count[0] >> 8) & 0xFF);
+ bits[2] = (unsigned char) ((context->count[0] >> 16) & 0xFF);
+ bits[3] = (unsigned char) ((context->count[0] >> 24) & 0xFF);
+ bits[4] = (unsigned char) (context->count[1] & 0xFF);
+ bits[5] = (unsigned char) ((context->count[1] >> 8) & 0xFF);
+ bits[6] = (unsigned char) ((context->count[1] >> 16) & 0xFF);
+ bits[7] = (unsigned char) ((context->count[1] >> 24) & 0xFF);
/* Pad out to 56 mod 64.
*/
unsigned int index, padLen;
/* Save number of bits */
- bits[0] = context->count[0] & 0xFF;
- bits[1] = (context->count[0] >> 8) & 0xFF;
- bits[2] = (context->count[0] >> 16) & 0xFF;
- bits[3] = (context->count[0] >> 24) & 0xFF;
- bits[4] = context->count[1] & 0xFF;
- bits[5] = (context->count[1] >> 8) & 0xFF;
- bits[6] = (context->count[1] >> 16) & 0xFF;
- bits[7] = (context->count[1] >> 24) & 0xFF;
+ bits[0] = (unsigned char) (context->count[0] & 0xFF);
+ bits[1] = (unsigned char) ((context->count[0] >> 8) & 0xFF);
+ bits[2] = (unsigned char) ((context->count[0] >> 16) & 0xFF);
+ bits[3] = (unsigned char) ((context->count[0] >> 24) & 0xFF);
+ bits[4] = (unsigned char) (context->count[1] & 0xFF);
+ bits[5] = (unsigned char) ((context->count[1] >> 8) & 0xFF);
+ bits[6] = (unsigned char) ((context->count[1] >> 16) & 0xFF);
+ bits[7] = (unsigned char) ((context->count[1] >> 24) & 0xFF);
/* Pad out to 56 mod 64.
*/
unsigned int index, padLen;
/* Save number of bits */
- bits[7] = context->count[0] & 0xFF;
- bits[6] = (context->count[0] >> 8) & 0xFF;
- bits[5] = (context->count[0] >> 16) & 0xFF;
- bits[4] = (context->count[0] >> 24) & 0xFF;
- bits[3] = context->count[1] & 0xFF;
- bits[2] = (context->count[1] >> 8) & 0xFF;
- bits[1] = (context->count[1] >> 16) & 0xFF;
- bits[0] = (context->count[1] >> 24) & 0xFF;
+ bits[7] = (unsigned char) (context->count[0] & 0xFF);
+ bits[6] = (unsigned char) ((context->count[0] >> 8) & 0xFF);
+ bits[5] = (unsigned char) ((context->count[0] >> 16) & 0xFF);
+ bits[4] = (unsigned char) ((context->count[0] >> 24) & 0xFF);
+ bits[3] = (unsigned char) (context->count[1] & 0xFF);
+ bits[2] = (unsigned char) ((context->count[1] >> 8) & 0xFF);
+ bits[1] = (unsigned char) ((context->count[1] >> 16) & 0xFF);
+ bits[0] = (unsigned char) ((context->count[1] >> 24) & 0xFF);
/* Pad out to 56 mod 64.
*/
*/
bufferBits = bufferPos = 0;
}
- buffer[bufferPos] = b << (8 - bufferRem);
+ buffer[bufferPos] = (unsigned char) (b << (8 - bufferRem));
bufferBits += bufferRem;
/*
* proceed to remaining data:
* all remaining data fits on buffer[bufferPos],
* and there still remains some space.
*/
- bufferBits += sourceBits;
+ bufferBits += (int) sourceBits;
} else {
/*
* buffer[bufferPos] is full:
*/
bufferBits = bufferPos = 0;
}
- buffer[bufferPos] = b << (8 - bufferRem);
+ buffer[bufferPos] = (unsigned char) (b << (8 - bufferRem));
bufferBits += (int)sourceBits;
}
context->buffer.bits = bufferBits;
#define PHP_HASH_HMAC 0x0001
-typedef int (*php_hash_init_func_t)(void *context);
-typedef int (*php_hash_update_func_t)(void *context, const unsigned char *buf, unsigned int count);
-typedef int (*php_hash_final_func_t)(unsigned char *digest, void *context);
+typedef void (*php_hash_init_func_t)(void *context);
+typedef void (*php_hash_update_func_t)(void *context, const unsigned char *buf, unsigned int count);
+typedef void (*php_hash_final_func_t)(unsigned char *digest, void *context);
typedef struct _php_hash_ops {
php_hash_init_func_t hash_init;
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Michael Wallner <mike@php.net> |
+ +----------------------------------------------------------------------+
+*/
/* $Id$ */
#include "config.h"
#endif
-#ifndef _MSC_VER
+#ifndef PHP_WIN32
#if SIZEOF_LONG == 8
#define L64(x) x
typedef unsigned long php_hash_uint64;
#else
#error "Need a 32bit integer type"
#endif
+#else
+#error "Need a 64bit integer type"
#endif
#else
#define L64(x) x##i64
#endif
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: sw=4 ts=4 fdm=marker
+ * vim<600: sw=4 ts=4
+ */