mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-22 20:44:19 +00:00
Move 32-bit swap code into miner.h, for sharing.
This commit is contained in:
parent
ae4cc6fc39
commit
970e74c07d
11
miner.h
11
miner.h
@ -22,6 +22,17 @@
|
|||||||
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
|
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define ___constant_swab32(x) ((uint32_t)( \
|
||||||
|
(((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) | \
|
||||||
|
(((uint32_t)(x) & (uint32_t)0x0000ff00UL) << 8) | \
|
||||||
|
(((uint32_t)(x) & (uint32_t)0x00ff0000UL) >> 8) | \
|
||||||
|
(((uint32_t)(x) & (uint32_t)0xff000000UL) >> 24)))
|
||||||
|
|
||||||
|
static inline uint32_t swab32(uint32_t v)
|
||||||
|
{
|
||||||
|
return ___constant_swab32(v);
|
||||||
|
}
|
||||||
|
|
||||||
extern bool opt_debug;
|
extern bool opt_debug;
|
||||||
extern bool opt_protocol;
|
extern bool opt_protocol;
|
||||||
extern const uint32_t sha256_init_state[];
|
extern const uint32_t sha256_init_state[];
|
||||||
|
11
sha256_via.c
11
sha256_via.c
@ -8,17 +8,6 @@
|
|||||||
|
|
||||||
#ifdef WANT_VIA_PADLOCK
|
#ifdef WANT_VIA_PADLOCK
|
||||||
|
|
||||||
#define ___constant_swab32(x) ((uint32_t)( \
|
|
||||||
(((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) | \
|
|
||||||
(((uint32_t)(x) & (uint32_t)0x0000ff00UL) << 8) | \
|
|
||||||
(((uint32_t)(x) & (uint32_t)0x00ff0000UL) >> 8) | \
|
|
||||||
(((uint32_t)(x) & (uint32_t)0xff000000UL) >> 24)))
|
|
||||||
|
|
||||||
static inline uint32_t swab32(uint32_t v)
|
|
||||||
{
|
|
||||||
return ___constant_swab32(v);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void via_sha256(void *hash, void *buf, unsigned len)
|
static void via_sha256(void *hash, void *buf, unsigned len)
|
||||||
{
|
{
|
||||||
unsigned stat = 0;
|
unsigned stat = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user