Skip to content

Commit da64078

Browse files
Refactor vipstar_hash function to use void pointers for output and input parameters, enhancing type flexibility. Update hash constants in vipstar.h for improved hashing accuracy.
1 parent 7a381a3 commit da64078

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/vipstar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#include "vipstar.h"
77

8-
void vipstar_hash(char *output, const char *input, uint32_t len) {
8+
void vipstar_hash(void *output, const void *input, uint32_t len) {
99
sha256d_181_swap((uint32_t*)output, (const uint32_t*)input);
1010
}
1111

src/vipstar.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static const uint32_t sha256d_hash1[16] = {
3535
0x00000000, 0x00000000, 0x00000000, 0x00000000,
3636
0x00000000, 0x00000000, 0x00000000, 0x00000000,
3737
0x80000000, 0x00000000, 0x00000000, 0x00000000,
38-
0x00000000, 0x00000000, 0x00000000, 0x00000100
38+
0x00000000, 0x00000000, 0x00000000, 0x000005a8
3939
};
4040

4141
/* Elementary functions used by SHA256 */
@@ -69,7 +69,7 @@ static inline void sha256d_preextend(uint32_t *W);
6969
static inline void sha256d_preextend2(uint32_t *W);
7070
static inline void sha256d_prehash(uint32_t *S, const uint32_t *W);
7171
static inline void sha256d_ms_vips(uint32_t *hash, uint32_t *W, const uint32_t *midstate, const uint32_t *prehash);
72-
void vipstar_hash(char* output, const char* input, uint32_t len);
72+
void vipstar_hash(void *output, const void *input, uint32_t len);
7373

7474
#ifdef __cplusplus
7575
}

0 commit comments

Comments
 (0)