/********************************************************************************************************/
/* some helping functions */
-const
+static const
uint32_t rotl32(uint32_t n, uint8_t bits){
return ((n<<bits) | (n>>(32-bits)));
}
-const
+static const
uint32_t change_endian32(uint32_t x){
return (((x)<<24) | ((x)>>24) | (((x)& 0x0000ff00)<<8) | (((x)& 0x00ff0000)>>8));
}
#define MASK 0x0000000f
-typedef uint32_t (*pf_t)(uint32_t x, uint32_t y, uint32_t z);
+typedef const uint32_t (*pf_t)(uint32_t x, uint32_t y, uint32_t z);
void sha1_nextBlock (sha1_ctx_t *state, const void* block){
uint32_t a[5];
/********************************************************************************************************/
-void sha1_ctx2hash (sha1_hash_t *dest, sha1_ctx_t *state){
+void sha1_ctx2hash (void *dest, sha1_ctx_t *state){
#if defined LITTLE_ENDIAN
uint8_t i;
for(i=0; i<5; ++i){
*
*
*/
-void sha1 (sha1_hash_t *dest, const void* msg, uint32_t length){
+void sha1 (void *dest, const void* msg, uint32_t length){
sha1_ctx_t s;
sha1_init(&s);
while(length & (~0x0001ff)){ /* length>=512 */