Skip to content

Commit

Permalink
v3.8.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
JayDDee committed Feb 17, 2018
1 parent d60a268 commit 502ed0b
Show file tree
Hide file tree
Showing 21 changed files with 263 additions and 341 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ Others may work but may require more effort.

MacOS, OSx is not supported.

3. Stratum pool. Some algos may work wallet mining using getwork.
3. Stratum pool. Some algos may work wallet mining using getwork or GBT. YMMV.

Supported Algorithms
--------------------

allium Garlicoin
anime Animecoin
argon2
axiom Shabal-256 MemoHash
Expand Down Expand Up @@ -107,7 +108,7 @@ Supported Algorithms
x17
xevan Bitsend
yescrypt Globalboost-Y (BSTY)
yescryptr8 BitZeny (ZNY)\n\
yescryptr8 BitZeny (ZNY)
yescryptr16 Yenten (YTN)
zr5 Ziftr

Expand Down
7 changes: 7 additions & 0 deletions RELEASE_NOTES
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@ Support for even older x86_64 without AES_NI or SSE2 is not availble.
Change Log
----------

v3.8.2.1

Fixed low difficulty rejects with allium.
Fixed qubit AVX2.
Restored lyra2z lost hash.
Fixed build.sh

v3.8.2

Fixed and faster myr-gr.
Expand Down
12 changes: 6 additions & 6 deletions algo/luffa/luffa-hash-2way.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,14 +491,14 @@ int luffa_2way_update( luffa_2way_context *state, const void *data,
__m256i *buffer = (__m256i*)state->buffer;
__m256i msg[2];
int i;
int blocks = (int)len / 32;
state-> rembytes = (int)len % 32;
int blocks = (int)len >> 5;
state-> rembytes = (int)len & 0x1F;

// full blocks
for ( i = 0; i < blocks; i++, vdata+=2 )
{
msg[0] = mm256_bswap_32( vdata[ i ] );
msg[1] = mm256_bswap_32( vdata[ i+1 ] );
msg[0] = mm256_bswap_32( vdata[ 0] );
msg[1] = mm256_bswap_32( vdata[ 1 ] );
rnd512_2way( state, msg );
}

Expand Down Expand Up @@ -533,7 +533,7 @@ int luffa_2way_close( luffa_2way_context *state, void *hashval )
finalization512_2way( state, (uint32*)hashval );

if ( state->hashbitlen > 512 )
finalization512_2way( state, (uint32*)( hashval+128 ) );
finalization512_2way( state, (uint32*)( hashval+32 ) );
return 0;
}

Expand Down Expand Up @@ -575,7 +575,7 @@ int luffa_2way_update_close( luffa_2way_context *state,

finalization512_2way( state, (uint32*)output );
if ( state->hashbitlen > 512 )
finalization512_2way( state, (uint32*)( output+128 ) );
finalization512_2way( state, (uint32*)( output+32 ) );

return 0;
}
Expand Down
6 changes: 4 additions & 2 deletions algo/lyra2/allium-4way.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "allium-gate.h"
#include <memory.h>
#include <mm_malloc.h>

#if defined (ALLIUM_4WAY)

Expand All @@ -18,14 +19,15 @@ typedef struct {

} allium_4way_ctx_holder;

static allium_4way_ctx_holder allium_4way_ctx;
static __thread allium_4way_ctx_holder allium_4way_ctx;

void init_allium_4way_ctx()
bool init_allium_4way_ctx()
{
keccak256_4way_init( &allium_4way_ctx.keccak );
cubehashInit( &allium_4way_ctx.cube, 256, 16, 32 );
skein256_4way_init( &allium_4way_ctx.skein );
init_groestl256( &allium_4way_ctx.groestl, 32 );
return true;
}

void allium_4way_hash( void *state, const void *input )
Expand Down
4 changes: 2 additions & 2 deletions algo/lyra2/allium-gate.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ int64_t get_max64_0xFFFFLL() { return 0xFFFFLL; }
bool register_allium_algo( algo_gate_t* gate )
{
#if defined (ALLIUM_4WAY)
init_allium_4way_ctx();
gate->miner_thread_init = (void*)&init_allium_4way_ctx;
gate->scanhash = (void*)&scanhash_allium_4way;
gate->hash = (void*)&allium_4way_hash;
#else
init_allium_ctx();
gate->miner_thread_init = (void*)&init_allium_ctx;
gate->scanhash = (void*)&scanhash_allium;
gate->hash = (void*)&allium_hash;
#endif
Expand Down
4 changes: 2 additions & 2 deletions algo/lyra2/allium-gate.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ bool register_allium_algo( algo_gate_t* gate );
void allium_4way_hash( void *state, const void *input );
int scanhash_allium_4way( int thr_id, struct work *work, uint32_t max_nonce,
uint64_t *hashes_done );
void init_allium_4way_ctx();
bool init_allium_4way_ctx();

#endif

void allium_hash( void *state, const void *input );
int scanhash_allium( int thr_id, struct work *work, uint32_t max_nonce,
uint64_t *hashes_done );
void init_allium_ctx();
bool init_allium_ctx();

#endif

7 changes: 4 additions & 3 deletions algo/lyra2/allium.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
#include "lyra2.h"

typedef struct {
cubehashParam cube;
sph_blake256_context blake;
sph_keccak256_context keccak;
cubehashParam cube;
sph_skein256_context skein;
#if defined (__AES__)
hashState_groestl256 groestl;
Expand All @@ -23,9 +23,9 @@ typedef struct {
#endif
} allium_ctx_holder;

static allium_ctx_holder allium_ctx;
static __thread allium_ctx_holder allium_ctx;

void init_allium_ctx()
bool init_allium_ctx()
{
sph_keccak256_init( &allium_ctx.keccak );
cubehashInit( &allium_ctx.cube, 256, 16, 32 );
Expand All @@ -35,6 +35,7 @@ void init_allium_ctx()
#else
sph_groestl256_init( &allium_ctx.groestl );
#endif
return true;
}

void allium_hash(void *state, const void *input)
Expand Down
123 changes: 0 additions & 123 deletions algo/lyra2/allium.c.broke

This file was deleted.

29 changes: 14 additions & 15 deletions algo/lyra2/lyra2.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ int LYRA2REV2( uint64_t* wholeMatrix, void *K, uint64_t kLen, const void *pwd,
//Tries to allocate enough space for the whole memory matrix

const int64_t ROW_LEN_INT64 = BLOCK_LEN_INT64 * nCols;
const int64_t ROW_LEN_BYTES = ROW_LEN_INT64 * 8;
// const int64_t ROW_LEN_BYTES = ROW_LEN_INT64 * 8;
// for Lyra2REv2, nCols = 4, v1 was using 8
const int64_t BLOCK_LEN = (nCols == 4) ? BLOCK_LEN_BLAKE2_SAFE_INT64
: BLOCK_LEN_BLAKE2_SAFE_BYTES;
uint64_t *ptrWord = wholeMatrix;

memset( wholeMatrix, 0, ROW_LEN_BYTES * nRows );
// memset( wholeMatrix, 0, ROW_LEN_BYTES * nRows );

//=== Getting the password + salt + basil padded with 10*1 ==========//
//OBS.:The memory matrix will temporarily hold the password: not for saving memory,
Expand Down Expand Up @@ -232,9 +232,9 @@ int LYRA2Z( uint64_t* wholeMatrix, void *K, uint64_t kLen, const void *pwd,
//Tries to allocate enough space for the whole memory matrix

const int64_t ROW_LEN_INT64 = BLOCK_LEN_INT64 * nCols;
const int64_t ROW_LEN_BYTES = ROW_LEN_INT64 * 8;
// const int64_t ROW_LEN_BYTES = ROW_LEN_INT64 * 8;

memset( wholeMatrix, 0, ROW_LEN_BYTES * nRows );
// memset( wholeMatrix, 0, ROW_LEN_BYTES * nRows );

//==== Getting the password + salt + basil padded with 10*1 ============//
//OBS.:The memory matrix will temporarily hold the password: not for saving memory,
Expand Down Expand Up @@ -380,18 +380,17 @@ int LYRA2RE( void *K, uint64_t kLen, const void *pwd, const uint64_t pwdlen,
: BLOCK_LEN_BLAKE2_SAFE_BYTES;

i = (int64_t)ROW_LEN_BYTES * nRows;
uint64_t *wholeMatrix = _mm_malloc( i, 32 );
// uint64_t *wholeMatrix = _mm_malloc( i, 64 );
uint64_t *wholeMatrix = _mm_malloc( i, 64 );
if (wholeMatrix == NULL)
return -1;

//#if defined (__AVX2__)
// memset_zero_m256i( (__m256i*)wholeMatrix, i<<5 );
//#elif defined(__AVX__)
// memset_zero_m128i( (__m128i*)wholeMatrix, i<<4 );
//#else
memset(wholeMatrix, 0, i);
//#endif
#if defined(__AVX2__)
memset_zero_256( (__m256i*)wholeMatrix, i>>5 );
#elif defined(__AVX__)
memset_zero_128( (__m128i*)wholeMatrix, i>>4 );
#else
memset( wholeMatrix, 0, i );
#endif

uint64_t *ptrWord = wholeMatrix;

Expand All @@ -413,8 +412,8 @@ int LYRA2RE( void *K, uint64_t kLen, const void *pwd, const uint64_t pwdlen,
memcpy(ptrByte, salt, saltlen);
ptrByte += saltlen;

memset( ptrByte, 0, nBlocksInput * BLOCK_LEN_BLAKE2_SAFE_BYTES
- (saltlen + pwdlen) );
// memset( ptrByte, 0, nBlocksInput * BLOCK_LEN_BLAKE2_SAFE_BYTES
// - (saltlen + pwdlen) );

//Concatenates the basil: every integer passed as parameter, in the order they are provided by the interface
memcpy(ptrByte, &kLen, sizeof(int64_t));
Expand Down
3 changes: 2 additions & 1 deletion algo/lyra2/lyra2rev2-4way.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ typedef struct {

static lyra2v2_4way_ctx_holder l2v2_4way_ctx;

void init_lyra2rev2_4way_ctx()
bool init_lyra2rev2_4way_ctx()
{
keccak256_4way_init( &l2v2_4way_ctx.keccak );
cubehashInit( &l2v2_4way_ctx.cube, 256, 16, 32 );
skein256_4way_init( &l2v2_4way_ctx.skein );
bmw256_4way_init( &l2v2_4way_ctx.bmw );
return true;
}

void lyra2rev2_4way_hash( void *state, const void *input )
Expand Down
8 changes: 5 additions & 3 deletions algo/lyra2/lyra2rev2-gate.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,20 @@ bool lyra2rev2_thread_init()

int i = (int64_t)ROW_LEN_BYTES * 4; // nRows;
l2v2_wholeMatrix = _mm_malloc( i, 64 );

#if defined (LYRA2REV2_4WAY)
init_lyra2rev2_4way_ctx();;
#else
init_lyra2rev2_ctx();
#endif
return l2v2_wholeMatrix;
}

bool register_lyra2rev2_algo( algo_gate_t* gate )
{
#if defined (LYRA2REV2_4WAY)
init_lyra2rev2_4way_ctx();
gate->scanhash = (void*)&scanhash_lyra2rev2_4way;
gate->hash = (void*)&lyra2rev2_4way_hash;
#else
init_lyra2rev2_ctx();
gate->scanhash = (void*)&scanhash_lyra2rev2;
gate->hash = (void*)&lyra2rev2_hash;
#endif
Expand Down
Loading

0 comments on commit 502ed0b

Please sign in to comment.