Browse Source

Move be32enc_vect to miner.h

tweaked
elbandi 8 years ago
parent
commit
303b27d3ac
  1. 14
      algorithm/animecoin.c
  2. 14
      algorithm/bitblock.c
  3. 13
      algorithm/blake256.c
  4. 13
      algorithm/blakecoin.c
  5. 9
      algorithm/credits.c
  6. 14
      algorithm/darkcoin.c
  7. 14
      algorithm/fresh.c
  8. 14
      algorithm/fuguecoin.c
  9. 14
      algorithm/groestlcoin.c
  10. 13
      algorithm/inkcoin.c
  11. 14
      algorithm/lyra2re.c
  12. 14
      algorithm/lyra2rev2.c
  13. 14
      algorithm/marucoin.c
  14. 14
      algorithm/myriadcoin-groestl.c
  15. 12
      algorithm/pluck.c
  16. 14
      algorithm/quarkcoin.c
  17. 15
      algorithm/qubitcoin.c
  18. 13
      algorithm/scrypt.c
  19. 14
      algorithm/sifcoin.c
  20. 14
      algorithm/talkcoin.c
  21. 14
      algorithm/twecoin.c
  22. 14
      algorithm/whirlcoin.c
  23. 14
      algorithm/whirlpoolx.c
  24. 13
      algorithm/x14.c
  25. 9
      algorithm/yescrypt.c
  26. 12
      miner.h

14
algorithm/animecoin.c

@ -38,20 +38,6 @@ @@ -38,20 +38,6 @@
#include "sph/sph_jh.h"
#include "sph/sph_keccak.h"
/*
* Encode a length len/4 vector of (uint32_t) into a length len vector of
* (unsigned char) in big-endian form. Assumes len is a multiple of 4.
*/
static inline void
be32enc_vect(uint32_t *dst, const uint32_t *src, uint32_t len)
{
uint32_t i;
for (i = 0; i < len; i++)
dst[i] = htobe32(src[i]);
}
#ifdef __APPLE_CC__
static
#endif

14
algorithm/bitblock.c

@ -92,20 +92,6 @@ void init_Bhash_contexts() @@ -92,20 +92,6 @@ void init_Bhash_contexts()
sph_whirlpool_init(&base_contexts.whirlpool1);
}
/*
* Encode a length len/4 vector of (uint32_t) into a length len vector of
* (unsigned char) in big-endian form. Assumes len is a multiple of 4.
*/
static inline void
be32enc_vect(uint32_t *dst, const uint32_t *src, uint32_t len)
{
uint32_t i;
for (i = 0; i < len; i++)
dst[i] = htobe32(src[i]);
}
#ifdef __APPLE_CC__
static
#endif

13
algorithm/blake256.c

@ -39,19 +39,6 @@ @@ -39,19 +39,6 @@
#include "sph/sph_blake.h"
#include "algorithm/blake256.h"
/*
* Encode a length len/4 vector of (uint32_t) into a length len vector of
* (unsigned char) in big-endian form. Assumes len is a multiple of 4.
*/
static void
be32enc_vect(uint32_t *dst, const uint32_t *src, uint32_t len)
{
uint32_t i;
for (i = 0; i < len; i++)
dst[i] = htobe32(src[i]);
}
static const uint32_t diff1targ_blake256 = 0x000000ff;
void blake256hash(void *state, const void *input)

13
algorithm/blakecoin.c

@ -39,19 +39,6 @@ @@ -39,19 +39,6 @@
#include "sph/sph_blake.h"
#include "algorithm/blakecoin.h"
/*
* Encode a length len/4 vector of (uint32_t) into a length len vector of
* (unsigned char) in big-endian form. Assumes len is a multiple of 4.
*/
static void
be32enc_vect(uint32_t *dst, const uint32_t *src, uint32_t len)
{
uint32_t i;
for (i = 0; i < len; i++)
dst[i] = htobe32(src[i]);
}
static const uint32_t diff1targ_blake256 = 0x000000ff;
void blakecoinhash(void *state, const void *input)

9
algorithm/credits.c

@ -52,15 +52,6 @@ void credits_hash(void *state, const void *input) @@ -52,15 +52,6 @@ void credits_hash(void *state, const void *input)
sph_sha256_close(&sha2, hash2);
memcpy(state, hash2, 32);
}
static inline void
be32enc_vect(uint32_t *dst, const uint32_t *src, uint32_t len)
{
uint32_t i;
for (i = 0; i < len; i++)
dst[i] = htobe32(src[i]);
}
/* Used externally as confirmation of correct OCL code */

14
algorithm/darkcoin.c

@ -80,20 +80,6 @@ static void init_Xhash_contexts() @@ -80,20 +80,6 @@ static void init_Xhash_contexts()
sph_echo512_init(&base_contexts.echo1);
}
/*
* Encode a length len/4 vector of (uint32_t) into a length len vector of
* (unsigned char) in big-endian form. Assumes len is a multiple of 4.
*/
static inline void
be32enc_vect(uint32_t *dst, const uint32_t *src, uint32_t len)
{
uint32_t i;
for (i = 0; i < len; i++)
dst[i] = htobe32(src[i]);
}
static void xhash(void *state, const void *input)
{
init_Xhash_contexts();

14
algorithm/fresh.c

@ -61,20 +61,6 @@ void init_freshHash_contexts() @@ -61,20 +61,6 @@ void init_freshHash_contexts()
sph_echo512_init(&base_contexts.echo2);
}
/*
* Encode a length len/4 vector of (uint32_t) into a length len vector of
* (unsigned char) in big-endian form. Assumes len is a multiple of 4.
*/
static inline void
be32enc_vect(uint32_t *dst, const uint32_t *src, uint32_t len)
{
uint32_t i;
for (i = 0; i < len; i++)
dst[i] = htobe32(src[i]);
}
#ifdef __APPLE_CC__
static
#endif

14
algorithm/fuguecoin.c

@ -33,20 +33,6 @@ @@ -33,20 +33,6 @@
#include "sph/sph_fugue.h"
/*
* Encode a length len/4 vector of (uint32_t) into a length len vector of
* (unsigned char) in big-endian form. Assumes len is a multiple of 4.
*/
static inline void
be32enc_vect(uint32_t *dst, const uint32_t *src, uint32_t len)
{
uint32_t i;
for (i = 0; i < len; i++)
dst[i] = htobe32(src[i]);
}
#ifdef __APPLE_CC__
static
#endif

14
algorithm/groestlcoin.c

@ -37,20 +37,6 @@ @@ -37,20 +37,6 @@
#include "sph/sph_groestl.h"
#include "sph/sph_sha2.h"
/*
* Encode a length len/4 vector of (uint32_t) into a length len vector of
* (unsigned char) in big-endian form. Assumes len is a multiple of 4.
*/
static inline void
be32enc_vect(uint32_t *dst, const uint32_t *src, uint32_t len)
{
uint32_t i;
for (i = 0; i < len; i++)
dst[i] = htobe32(src[i]);
}
#ifdef __APPLE_CC__
static
#endif

13
algorithm/inkcoin.c

@ -77,19 +77,6 @@ static void init_Xhash_contexts() @@ -77,19 +77,6 @@ static void init_Xhash_contexts()
sph_echo512_init(&base_contexts.echo1);
}
/*
* Encode a length len/4 vector of (uint32_t) into a length len vector of
* (unsigned char) in big-endian form. Assumes len is a multiple of 4.
*/
static inline void
be32enc_vect(uint32_t *dst, const uint32_t *src, uint32_t len)
{
uint32_t i;
for (i = 0; i < len; i++)
dst[i] = htobe32(src[i]);
}
#ifdef __APPLE_CC__
static
#endif

14
algorithm/lyra2re.c

@ -38,20 +38,6 @@ @@ -38,20 +38,6 @@
#include "sph/sph_keccak.h"
#include "lyra2.h"
/*
* Encode a length len/4 vector of (uint32_t) into a length len vector of
* (unsigned char) in big-endian form. Assumes len is a multiple of 4.
*/
static inline void
be32enc_vect(uint32_t *dst, const uint32_t *src, uint32_t len)
{
uint32_t i;
for (i = 0; i < len; i++)
dst[i] = htobe32(src[i]);
}
void lyra2rehash(void *state, const void *input)
{
sph_blake256_context ctx_blake;

14
algorithm/lyra2rev2.c

@ -40,20 +40,6 @@ @@ -40,20 +40,6 @@
#include "sph/sph_cubehash.h"
#include "lyra2.h"
/*
* Encode a length len/4 vector of (uint32_t) into a length len vector of
* (unsigned char) in big-endian form. Assumes len is a multiple of 4.
*/
static inline void
be32enc_vect(uint32_t *dst, const uint32_t *src, uint32_t len)
{
uint32_t i;
for (i = 0; i < len; i++)
dst[i] = htobe32(src[i]);
}
void lyra2rev2hash(void *state, const void *input)
{
sph_blake256_context ctx_blake;

14
algorithm/marucoin.c

@ -86,20 +86,6 @@ void init_Mhash_contexts() @@ -86,20 +86,6 @@ void init_Mhash_contexts()
sph_fugue512_init(&base_contexts.fugue1);
}
/*
* Encode a length len/4 vector of (uint32_t) into a length len vector of
* (unsigned char) in big-endian form. Assumes len is a multiple of 4.
*/
static inline void
be32enc_vect(uint32_t *dst, const uint32_t *src, uint32_t len)
{
uint32_t i;
for (i = 0; i < len; i++)
dst[i] = htobe32(src[i]);
}
#ifdef __APPLE_CC__
static
#endif

14
algorithm/myriadcoin-groestl.c

@ -37,20 +37,6 @@ @@ -37,20 +37,6 @@
#include "sph/sph_groestl.h"
#include "sph/sph_sha2.h"
/*
* Encode a length len/4 vector of (uint32_t) into a length len vector of
* (unsigned char) in big-endian form. Assumes len is a multiple of 4.
*/
static inline void
be32enc_vect(uint32_t *dst, const uint32_t *src, uint32_t len)
{
uint32_t i;
for (i = 0; i < len; i++)
dst[i] = htobe32(src[i]);
}
#ifdef __APPLE_CC__
static
#endif

12
algorithm/pluck.c

@ -187,18 +187,6 @@ void sha256_transform(uint32_t *state, const uint32_t *block, int swap) @@ -187,18 +187,6 @@ void sha256_transform(uint32_t *state, const uint32_t *block, int swap)
state[i] += S[i];
}
/*
* Encode a length len/4 vector of (uint32_t) into a length len vector of
* (unsigned char) in big-endian form. Assumes len is a multiple of 4.
*/
static inline void
be32enc_vect(uint32_t *dst, const uint32_t *src, uint32_t len)
{
uint32_t i;
for (i = 0; i < len; i++)
dst[i] = htobe32(src[i]);
}
#define ROTL(a, b) (((a) << (b)) | ((a) >> (32 - (b))))
//note, this is 64 bytes
static inline void xor_salsa8(uint32_t B[16], const uint32_t Bx[16])

14
algorithm/quarkcoin.c

@ -38,20 +38,6 @@ @@ -38,20 +38,6 @@
#include "sph/sph_jh.h"
#include "sph/sph_keccak.h"
/*
* Encode a length len/4 vector of (uint32_t) into a length len vector of
* (unsigned char) in big-endian form. Assumes len is a multiple of 4.
*/
static inline void
be32enc_vect(uint32_t *dst, const uint32_t *src, uint32_t len)
{
uint32_t i;
for (i = 0; i < len; i++)
dst[i] = htobe32(src[i]);
}
#ifdef __APPLE_CC__
static
#endif

15
algorithm/qubitcoin.c

@ -62,21 +62,6 @@ void init_Qhash_contexts() @@ -62,21 +62,6 @@ void init_Qhash_contexts()
sph_echo512_init(&base_contexts.echo1);
}
/*
* Encode a length len/4 vector of (uint32_t) into a length len vector of
* (unsigned char) in big-endian form. Assumes len is a multiple of 4.
*/
static inline void
be32enc_vect(uint32_t *dst, const uint32_t *src, uint32_t len)
{
uint32_t i;
for (i = 0; i < len; i++)
dst[i] = htobe32(src[i]);
}
#ifdef __APPLE_CC__
static
#endif

13
algorithm/scrypt.c

@ -39,19 +39,6 @@ typedef struct SHA256Context { @@ -39,19 +39,6 @@ typedef struct SHA256Context {
uint32_t buf[16];
} SHA256_CTX;
/*
* Encode a length len/4 vector of (uint32_t) into a length len vector of
* (unsigned char) in big-endian form. Assumes len is a multiple of 4.
*/
static inline void
be32enc_vect(uint32_t *dst, const uint32_t *src, uint32_t len)
{
uint32_t i;
for (i = 0; i < len; i++)
dst[i] = htobe32(src[i]);
}
/* Elementary functions used by SHA256 */
#define Ch(x, y, z) ((x & (y ^ z)) ^ z)
#define Maj(x, y, z) ((x & (y | z)) | (y & z))

14
algorithm/sifcoin.c

@ -38,20 +38,6 @@ @@ -38,20 +38,6 @@
#include "sph/sph_jh.h"
#include "sph/sph_keccak.h"
/*
* Encode a length len/4 vector of (uint32_t) into a length len vector of
* (unsigned char) in big-endian form. Assumes len is a multiple of 4.
*/
static inline void
be32enc_vect(uint32_t *dst, const uint32_t *src, uint32_t len)
{
uint32_t i;
for (i = 0; i < len; i++)
dst[i] = htobe32(src[i]);
}
#ifdef __APPLE_CC__
static
#endif

14
algorithm/talkcoin.c

@ -58,20 +58,6 @@ void init_Nhash_contexts() @@ -58,20 +58,6 @@ void init_Nhash_contexts()
sph_skein512_init(&base_contexts.skein1);
}
/*
* Encode a length len/4 vector of (uint32_t) into a length len vector of
* (unsigned char) in big-endian form. Assumes len is a multiple of 4.
*/
static inline void
be32enc_vect(uint32_t *dst, const uint32_t *src, uint32_t len)
{
uint32_t i;
for (i = 0; i < len; i++)
dst[i] = htobe32(src[i]);
}
#ifdef __APPLE_CC__
static
#endif

14
algorithm/twecoin.c

@ -39,20 +39,6 @@ @@ -39,20 +39,6 @@
#include "sph/sph_hamsi.h"
#include "sph/sph_panama.h"
/*
* Encode a length len/4 vector of (uint32_t) into a length len vector of
* (unsigned char) in big-endian form. Assumes len is a multiple of 4.
*/
static inline void
be32enc_vect(uint32_t *dst, const uint32_t *src, uint32_t len)
{
uint32_t i;
for (i = 0; i < len; i++)
dst[i] = htobe32(src[i]);
}
#ifdef __APPLE_CC__
static
#endif

14
algorithm/whirlcoin.c

@ -55,20 +55,6 @@ void init_whirlcoin_hash_contexts() @@ -55,20 +55,6 @@ void init_whirlcoin_hash_contexts()
sph_whirlpool1_init(&base_contexts.whirlpool4);
}
/*
* Encode a length len/4 vector of (uint32_t) into a length len vector of
* (unsigned char) in big-endian form. Assumes len is a multiple of 4.
*/
static inline void
be32enc_vect(uint32_t *dst, const uint32_t *src, uint32_t len)
{
uint32_t i;
for (i = 0; i < len; i++)
dst[i] = htobe32(src[i]);
}
#ifdef __APPLE_CC__
static
#endif

14
algorithm/whirlpoolx.c

@ -36,20 +36,6 @@ @@ -36,20 +36,6 @@
#include "whirlpoolx.h"
/*
* Encode a length len/4 vector of (uint32_t) into a length len vector of
* (unsigned char) in big-endian form. Assumes len is a multiple of 4.
*/
static inline void
be32enc_vect(uint32_t *dst, const uint32_t *src, uint32_t len)
{
uint32_t i;
for (i = 0; i < len; i++)
dst[i] = htobe32(src[i]);
}
void whirlpool_compress(uint8_t state[64], const uint8_t block[64])
{
const int NUM_ROUNDS = 10;

13
algorithm/x14.c

@ -88,19 +88,6 @@ void init_X14hash_contexts() @@ -88,19 +88,6 @@ void init_X14hash_contexts()
sph_shabal512_init(&base_contexts.shabal1);
}
/*
* Encode a length len/4 vector of (uint32_t) into a length len vector of
* (unsigned char) in big-endian form. Assumes len is a multiple of 4.
*/
static inline void be32enc_vect(uint32_t *dst, const uint32_t *src, uint32_t len)
{
uint32_t i;
for (i = 0; i < len; i++)
dst[i] = htobe32(src[i]);
}
#ifdef __APPLE_CC__
static
#endif

9
algorithm/yescrypt.c

@ -35,15 +35,6 @@ @@ -35,15 +35,6 @@
static const uint32_t diff1targ = 0x0000ffff;
static inline void
be32enc_vect(uint32_t *dst, const uint32_t *src, uint32_t len)
{
uint32_t i;
for (i = 0; i < len; i++)
dst[i] = htobe32(src[i]);
}
/* Used externally as confirmation of correct OCL code */
int yescrypt_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t nonce)
{

12
miner.h

@ -743,6 +743,18 @@ static inline void flip168(void *dest_p, const void *src_p) @@ -743,6 +743,18 @@ static inline void flip168(void *dest_p, const void *src_p)
dest[i] = swab32(src[i]);
}
/*
* Encode a length len/4 vector of (uint32_t) into a length len vector of
* (unsigned char) in big-endian form. Assumes len is a multiple of 4.
*/
static inline void
be32enc_vect(uint32_t *dst, const uint32_t *src, uint32_t len)
{
uint32_t i;
for (i = 0; i < len; i++)
dst[i] = htobe32(src[i]);
}
/* For flipping to the correct endianness if necessary */
#if defined(__BIG_ENDIAN__) || defined(MIPSEB)

Loading…
Cancel
Save