v3.21.3 Unreleased

This commit is contained in:
Jay D Dee
2023-03-13 03:20:13 -04:00
parent b339450898
commit c6bc9d67fb
49 changed files with 1126 additions and 1111 deletions

View File

@@ -31,26 +31,8 @@
yespower_params_t yespower_params;
// master g_work
sha256_context yespower_sha256_prehash_ctx;
uint32_t _ALIGN(64) yespower_endiandata[20];
// local work
__thread sha256_context sha256_prehash_ctx;
int yespower_sha256_prehash( struct work *work )
{
uint32_t *pdata = work->data;
for ( int k = 0; k < 19; k++ )
be32enc( &yespower_endiandata[k], pdata[k] );
sha256_ctx_init( &yespower_sha256_prehash_ctx );
sha256_update( &yespower_sha256_prehash_ctx, yespower_endiandata, 64 );
return 1;
}
// YESPOWER
int yespower_hash( const char *input, char *output, uint32_t len, int thrid )
@@ -71,15 +53,14 @@ int scanhash_yespower( struct work *work, uint32_t max_nonce,
uint32_t n = first_nonce;
const int thr_id = mythr->id;
// pthread_rwlock_rdlock( &g_work_lock );
memcpy( endiandata, yespower_endiandata, sizeof endiandata );
memcpy( &sha256_prehash_ctx, &yespower_sha256_prehash_ctx, sizeof sha256_prehash_ctx );
// pthread_rwlock_unlock( &g_work_lock );
for ( int k = 0; k < 19; k++ )
be32enc( &endiandata[k], pdata[k] );
endiandata[19] = n;
// do sha256 prehash
sha256_ctx_init( &sha256_prehash_ctx );
sha256_update( &sha256_prehash_ctx, endiandata, 64 );
do {
if ( yespower_hash( (char*)endiandata, (char*)vhash, 80, thr_id ) )
if unlikely( valid_hash( vhash, ptarget ) && !opt_benchmark )
@@ -159,7 +140,6 @@ bool register_yespower_algo( algo_gate_t* gate )
gate->optimizations = SSE2_OPT | SHA_OPT;
gate->scanhash = (void*)&scanhash_yespower;
gate->prehash = (void*)&yespower_sha256_prehash;
gate->hash = (void*)&yespower_hash;
opt_target_factor = 65536.0;
return true;
@@ -174,7 +154,6 @@ bool register_yespowerr16_algo( algo_gate_t* gate )
yespower_params.perslen = 0;
gate->optimizations = SSE2_OPT | SHA_OPT;
gate->scanhash = (void*)&scanhash_yespower;
gate->prehash = (void*)&yespower_sha256_prehash;
gate->hash = (void*)&yespower_hash;
opt_target_factor = 65536.0;
return true;
@@ -186,7 +165,6 @@ bool register_yescrypt_algo( algo_gate_t* gate )
{
gate->optimizations = SSE2_OPT | SHA_OPT;
gate->scanhash = (void*)&scanhash_yespower;
gate->prehash = (void*)&yespower_sha256_prehash;
yespower_params.version = YESPOWER_0_5;
opt_target_factor = 65536.0;
@@ -220,7 +198,6 @@ bool register_yescryptr8_algo( algo_gate_t* gate )
{
gate->optimizations = SSE2_OPT | SHA_OPT;
gate->scanhash = (void*)&scanhash_yespower;
gate->prehash = (void*)&yespower_sha256_prehash;
yespower_params.version = YESPOWER_0_5;
yespower_params.N = 2048;
yespower_params.r = 8;
@@ -234,7 +211,6 @@ bool register_yescryptr16_algo( algo_gate_t* gate )
{
gate->optimizations = SSE2_OPT | SHA_OPT;
gate->scanhash = (void*)&scanhash_yespower;
gate->prehash = (void*)&yespower_sha256_prehash;
yespower_params.version = YESPOWER_0_5;
yespower_params.N = 4096;
yespower_params.r = 16;
@@ -248,7 +224,6 @@ bool register_yescryptr32_algo( algo_gate_t* gate )
{
gate->optimizations = SSE2_OPT | SHA_OPT;
gate->scanhash = (void*)&scanhash_yespower;
gate->prehash = (void*)&yespower_sha256_prehash;
yespower_params.version = YESPOWER_0_5;
yespower_params.N = 4096;
yespower_params.r = 32;