mirror of
https://github.com/JayDDee/cpuminer-opt.git
synced 2025-09-17 23:44:27 +00:00
v3.5.9.1
This commit is contained in:
36
Dockerfile
36
Dockerfile
@@ -1,25 +1,23 @@
|
|||||||
#
|
#
|
||||||
# Dockerfile for cpuminer
|
# Dockerfile for cpuminer-opt
|
||||||
# usage: docker run creack/cpuminer --url xxxx --user xxxx --pass xxxx
|
# usage: docker build -t cpuminer-opt:latest .
|
||||||
# ex: docker run creack/cpuminer --url stratum+tcp://ltc.pool.com:80 --user creack.worker1 --pass abcdef
|
# run: docker run -it --rm cpuminer-opt:latest [ARGS]
|
||||||
#
|
# ex: docker run -it --rm cpuminer-opt:latest -a cryptonight -o cryptonight.eu.nicehash.com:3355 -u 1MiningDW2GKzf4VQfmp4q2XoUvR6iy6PD.worker1 -p x -t 3
|
||||||
#
|
#
|
||||||
|
|
||||||
FROM ubuntu:12.10
|
FROM ubuntu:16.04
|
||||||
MAINTAINER Guillaume J. Charmes <guillaume@charmes.net>
|
RUN BUILD_DEPS="build-essential \
|
||||||
|
libssl-dev \
|
||||||
|
libgmp-dev \
|
||||||
|
libcurl4-openssl-dev \
|
||||||
|
libjansson-dev \
|
||||||
|
automake" && \
|
||||||
|
|
||||||
RUN apt-get update -qq
|
apt-get update && \
|
||||||
|
apt-get install -y ${BUILD_DEPS}
|
||||||
|
|
||||||
RUN apt-get install -qqy automake
|
COPY . /app/
|
||||||
RUN apt-get install -qqy libcurl4-openssl-dev
|
RUN cd /app/ && ./build.sh
|
||||||
RUN apt-get install -qqy git
|
|
||||||
RUN apt-get install -qqy make
|
|
||||||
|
|
||||||
RUN git clone https://github.com/pooler/cpuminer
|
ENTRYPOINT ["/app/cpuminer"]
|
||||||
|
CMD ["-h"]
|
||||||
RUN cd cpuminer && ./autogen.sh
|
|
||||||
RUN cd cpuminer && ./configure CFLAGS="-O3"
|
|
||||||
RUN cd cpuminer && make
|
|
||||||
|
|
||||||
WORKDIR /cpuminer
|
|
||||||
ENTRYPOINT ["./cpuminer"]
|
|
||||||
|
@@ -81,7 +81,9 @@ cpuminer_SOURCES = \
|
|||||||
algo/groestl/myr-groestl.c \
|
algo/groestl/myr-groestl.c \
|
||||||
algo/groestl/aes_ni/hash-groestl.c \
|
algo/groestl/aes_ni/hash-groestl.c \
|
||||||
algo/groestl/aes_ni/hash-groestl256.c \
|
algo/groestl/aes_ni/hash-groestl256.c \
|
||||||
algo/haval/haval.c\
|
algo/groestl/sse2/grso.c \
|
||||||
|
algo/groestl/sse2/grso-asm.c \
|
||||||
|
algo/haval/haval.c \
|
||||||
algo/heavy/heavy.c \
|
algo/heavy/heavy.c \
|
||||||
algo/heavy/bastion.c \
|
algo/heavy/bastion.c \
|
||||||
algo/hmq1725.c \
|
algo/hmq1725.c \
|
||||||
@@ -119,6 +121,7 @@ cpuminer_SOURCES = \
|
|||||||
algo/scrypt.c \
|
algo/scrypt.c \
|
||||||
algo/scryptjane/scrypt-jane.c \
|
algo/scryptjane/scrypt-jane.c \
|
||||||
algo/sha2/sha2.c \
|
algo/sha2/sha2.c \
|
||||||
|
algo/sha2/sha256t.c \
|
||||||
algo/simd/sse2/nist.c \
|
algo/simd/sse2/nist.c \
|
||||||
algo/simd/sse2/vector.c \
|
algo/simd/sse2/vector.c \
|
||||||
algo/skein/skein.c \
|
algo/skein/skein.c \
|
||||||
|
@@ -179,7 +179,7 @@ bool register_algo_gate( int algo, algo_gate_t *gate )
|
|||||||
case ALGO_LYRA2RE: register_lyra2re_algo ( gate ); break;
|
case ALGO_LYRA2RE: register_lyra2re_algo ( gate ); break;
|
||||||
case ALGO_LYRA2REV2: register_lyra2rev2_algo ( gate ); break;
|
case ALGO_LYRA2REV2: register_lyra2rev2_algo ( gate ); break;
|
||||||
case ALGO_LYRA2Z: register_zcoin_algo ( gate ); break;
|
case ALGO_LYRA2Z: register_zcoin_algo ( gate ); break;
|
||||||
case ALGO_LYRA2ZOIN: register_zoin_algo ( gate ); break;
|
case ALGO_LYRA2Z330: register_lyra2z330_algo ( gate ); break;
|
||||||
case ALGO_M7M: register_m7m_algo ( gate ); break;
|
case ALGO_M7M: register_m7m_algo ( gate ); break;
|
||||||
case ALGO_MYR_GR: register_myriad_algo ( gate ); break;
|
case ALGO_MYR_GR: register_myriad_algo ( gate ); break;
|
||||||
case ALGO_NEOSCRYPT: register_neoscrypt_algo ( gate ); break;
|
case ALGO_NEOSCRYPT: register_neoscrypt_algo ( gate ); break;
|
||||||
@@ -191,6 +191,7 @@ bool register_algo_gate( int algo, algo_gate_t *gate )
|
|||||||
case ALGO_SCRYPT: register_scrypt_algo ( gate ); break;
|
case ALGO_SCRYPT: register_scrypt_algo ( gate ); break;
|
||||||
case ALGO_SCRYPTJANE: register_scryptjane_algo ( gate ); break;
|
case ALGO_SCRYPTJANE: register_scryptjane_algo ( gate ); break;
|
||||||
case ALGO_SHA256D: register_sha256d_algo ( gate ); break;
|
case ALGO_SHA256D: register_sha256d_algo ( gate ); break;
|
||||||
|
case ALGO_SHA256T: register_sha256t_algo ( gate ); break;
|
||||||
case ALGO_SHAVITE3: register_shavite_algo ( gate ); break;
|
case ALGO_SHAVITE3: register_shavite_algo ( gate ); break;
|
||||||
case ALGO_SKEIN: register_skein_algo ( gate ); break;
|
case ALGO_SKEIN: register_skein_algo ( gate ); break;
|
||||||
case ALGO_SKEIN2: register_skein2_algo ( gate ); break;
|
case ALGO_SKEIN2: register_skein2_algo ( gate ); break;
|
||||||
@@ -281,13 +282,14 @@ const char* const algo_alias_map[][2] =
|
|||||||
{ "jane", "scryptjane" },
|
{ "jane", "scryptjane" },
|
||||||
{ "lyra2", "lyra2re" },
|
{ "lyra2", "lyra2re" },
|
||||||
{ "lyra2v2", "lyra2rev2" },
|
{ "lyra2v2", "lyra2rev2" },
|
||||||
|
{ "lyra2zoin", "lyra2z330" },
|
||||||
{ "myriad", "myr-gr" },
|
{ "myriad", "myr-gr" },
|
||||||
{ "neo", "neoscrypt" },
|
{ "neo", "neoscrypt" },
|
||||||
{ "sib", "x11gost" },
|
{ "sib", "x11gost" },
|
||||||
{ "yes", "yescrypt" },
|
{ "yes", "yescrypt" },
|
||||||
{ "ziftr", "zr5" },
|
{ "ziftr", "zr5" },
|
||||||
{ "zcoin", "lyra2z" },
|
{ "zcoin", "lyra2z" },
|
||||||
{ "zoin", "lyra2zoin" },
|
{ "zoin", "lyra2z330" },
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -129,6 +129,8 @@ void blake2b_be_build_stratum_request( char *req, struct work *work )
|
|||||||
free( xnonce2str );
|
free( xnonce2str );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define min(a,b) (a>b ? (b) :(a))
|
||||||
|
|
||||||
// merkle root handled here, no need for gen_merkle_root gate target
|
// merkle root handled here, no need for gen_merkle_root gate target
|
||||||
void blake2b_build_extraheader( struct work* g_work, struct stratum_ctx* sctx )
|
void blake2b_build_extraheader( struct work* g_work, struct stratum_ctx* sctx )
|
||||||
{
|
{
|
||||||
@@ -161,6 +163,8 @@ void blake2b_build_extraheader( struct work* g_work, struct stratum_ctx* sctx )
|
|||||||
g_work->data[12+i] = ( (uint32_t*)merkle_root )[i];
|
g_work->data[12+i] = ( (uint32_t*)merkle_root )[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef min
|
||||||
|
|
||||||
void blake2b_get_new_work( struct work* work, struct work* g_work, int thr_id,
|
void blake2b_get_new_work( struct work* work, struct work* g_work, int thr_id,
|
||||||
uint32_t* end_nonce_ptr, bool clean_job )
|
uint32_t* end_nonce_ptr, bool clean_job )
|
||||||
{
|
{
|
||||||
|
@@ -194,6 +194,9 @@ void decred_gen_merkle_root( char* merkle_root, struct stratum_ctx* sctx )
|
|||||||
memcpy( decred_extraheader, &sctx->job.coinbase[32], decred_headersize);
|
memcpy( decred_extraheader, &sctx->job.coinbase[32], decred_headersize);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define min(a,b) (a>b ? (b) :(a))
|
||||||
|
|
||||||
void decred_build_extraheader( struct work* g_work, struct stratum_ctx* sctx )
|
void decred_build_extraheader( struct work* g_work, struct stratum_ctx* sctx )
|
||||||
{
|
{
|
||||||
uchar merkle_root[64] = { 0 };
|
uchar merkle_root[64] = { 0 };
|
||||||
@@ -239,6 +242,8 @@ void decred_build_extraheader( struct work* g_work, struct stratum_ctx* sctx )
|
|||||||
//applog_hex(&work->data[36], 36);
|
//applog_hex(&work->data[36], 36);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef min
|
||||||
|
|
||||||
/*
|
/*
|
||||||
bool decred_prevent_dupes( struct work* work, struct stratum_ctx* stratum,
|
bool decred_prevent_dupes( struct work* work, struct stratum_ctx* stratum,
|
||||||
int thr_id )
|
int thr_id )
|
||||||
|
133
algo/groestl/sse2/brg_endian.h
Normal file
133
algo/groestl/sse2/brg_endian.h
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
/*
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
Copyright (c) 1998-2008, Brian Gladman, Worcester, UK. All rights reserved.
|
||||||
|
|
||||||
|
LICENSE TERMS
|
||||||
|
|
||||||
|
The redistribution and use of this software (with or without changes)
|
||||||
|
is allowed without the payment of fees or royalties provided that:
|
||||||
|
|
||||||
|
1. source code distributions include the above copyright notice, this
|
||||||
|
list of conditions and the following disclaimer;
|
||||||
|
|
||||||
|
2. binary distributions include the above copyright notice, this list
|
||||||
|
of conditions and the following disclaimer in their documentation;
|
||||||
|
|
||||||
|
3. the name of the copyright holder is not used to endorse products
|
||||||
|
built using this software without specific written permission.
|
||||||
|
|
||||||
|
DISCLAIMER
|
||||||
|
|
||||||
|
This software is provided 'as is' with no explicit or implied warranties
|
||||||
|
in respect of its properties, including, but not limited to, correctness
|
||||||
|
and/or fitness for purpose.
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
Issue Date: 20/12/2007
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _BRG_ENDIAN_H
|
||||||
|
#define _BRG_ENDIAN_H
|
||||||
|
|
||||||
|
#define IS_BIG_ENDIAN 4321 /* byte 0 is most significant (mc68k) */
|
||||||
|
#define IS_LITTLE_ENDIAN 1234 /* byte 0 is least significant (i386) */
|
||||||
|
|
||||||
|
/* Include files where endian defines and byteswap functions may reside */
|
||||||
|
#if defined( __sun )
|
||||||
|
# include <sys/isa_defs.h>
|
||||||
|
#elif defined( __FreeBSD__ ) || defined( __OpenBSD__ ) || defined( __NetBSD__ )
|
||||||
|
# include <sys/endian.h>
|
||||||
|
#elif defined( BSD ) && ( BSD >= 199103 ) || defined( __APPLE__ ) || \
|
||||||
|
defined( __CYGWIN32__ ) || defined( __DJGPP__ ) || defined( __osf__ )
|
||||||
|
# include <machine/endian.h>
|
||||||
|
#elif defined( __linux__ ) || defined( __GNUC__ ) || defined( __GNU_LIBRARY__ )
|
||||||
|
# if !defined( __MINGW32__ ) && !defined( _AIX )
|
||||||
|
# include <endian.h>
|
||||||
|
# if !defined( __BEOS__ )
|
||||||
|
# include <byteswap.h>
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Now attempt to set the define for platform byte order using any */
|
||||||
|
/* of the four forms SYMBOL, _SYMBOL, __SYMBOL & __SYMBOL__, which */
|
||||||
|
/* seem to encompass most endian symbol definitions */
|
||||||
|
|
||||||
|
#if defined( BIG_ENDIAN ) && defined( LITTLE_ENDIAN )
|
||||||
|
# if defined( BYTE_ORDER ) && BYTE_ORDER == BIG_ENDIAN
|
||||||
|
# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
|
||||||
|
# elif defined( BYTE_ORDER ) && BYTE_ORDER == LITTLE_ENDIAN
|
||||||
|
# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
|
||||||
|
# endif
|
||||||
|
#elif defined( BIG_ENDIAN )
|
||||||
|
# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
|
||||||
|
#elif defined( LITTLE_ENDIAN )
|
||||||
|
# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined( _BIG_ENDIAN ) && defined( _LITTLE_ENDIAN )
|
||||||
|
# if defined( _BYTE_ORDER ) && _BYTE_ORDER == _BIG_ENDIAN
|
||||||
|
# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
|
||||||
|
# elif defined( _BYTE_ORDER ) && _BYTE_ORDER == _LITTLE_ENDIAN
|
||||||
|
# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
|
||||||
|
# endif
|
||||||
|
#elif defined( _BIG_ENDIAN )
|
||||||
|
# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
|
||||||
|
#elif defined( _LITTLE_ENDIAN )
|
||||||
|
# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined( __BIG_ENDIAN ) && defined( __LITTLE_ENDIAN )
|
||||||
|
# if defined( __BYTE_ORDER ) && __BYTE_ORDER == __BIG_ENDIAN
|
||||||
|
# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
|
||||||
|
# elif defined( __BYTE_ORDER ) && __BYTE_ORDER == __LITTLE_ENDIAN
|
||||||
|
# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
|
||||||
|
# endif
|
||||||
|
#elif defined( __BIG_ENDIAN )
|
||||||
|
# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
|
||||||
|
#elif defined( __LITTLE_ENDIAN )
|
||||||
|
# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined( __BIG_ENDIAN__ ) && defined( __LITTLE_ENDIAN__ )
|
||||||
|
# if defined( __BYTE_ORDER__ ) && __BYTE_ORDER__ == __BIG_ENDIAN__
|
||||||
|
# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
|
||||||
|
# elif defined( __BYTE_ORDER__ ) && __BYTE_ORDER__ == __LITTLE_ENDIAN__
|
||||||
|
# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
|
||||||
|
# endif
|
||||||
|
#elif defined( __BIG_ENDIAN__ )
|
||||||
|
# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
|
||||||
|
#elif defined( __LITTLE_ENDIAN__ )
|
||||||
|
# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* if the platform byte order could not be determined, then try to */
|
||||||
|
/* set this define using common machine defines */
|
||||||
|
#if !defined(PLATFORM_BYTE_ORDER)
|
||||||
|
|
||||||
|
#if defined( __alpha__ ) || defined( __alpha ) || defined( i386 ) || \
|
||||||
|
defined( __i386__ ) || defined( _M_I86 ) || defined( _M_IX86 ) || \
|
||||||
|
defined( __OS2__ ) || defined( sun386 ) || defined( __TURBOC__ ) || \
|
||||||
|
defined( vax ) || defined( vms ) || defined( VMS ) || \
|
||||||
|
defined( __VMS ) || defined( _M_X64 )
|
||||||
|
# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
|
||||||
|
|
||||||
|
#elif defined( AMIGA ) || defined( applec ) || defined( __AS400__ ) || \
|
||||||
|
defined( _CRAY ) || defined( __hppa ) || defined( __hp9000 ) || \
|
||||||
|
defined( ibm370 ) || defined( mc68000 ) || defined( m68k ) || \
|
||||||
|
defined( __MRC__ ) || defined( __MVS__ ) || defined( __MWERKS__ ) || \
|
||||||
|
defined( sparc ) || defined( __sparc) || defined( SYMANTEC_C ) || \
|
||||||
|
defined( __VOS__ ) || defined( __TIGCC__ ) || defined( __TANDEM ) || \
|
||||||
|
defined( THINK_C ) || defined( __VMCMS__ ) || defined( _AIX )
|
||||||
|
# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
|
||||||
|
|
||||||
|
#elif 0 /* **** EDIT HERE IF NECESSARY **** */
|
||||||
|
# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
|
||||||
|
#elif 0 /* **** EDIT HERE IF NECESSARY **** */
|
||||||
|
# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
|
||||||
|
#else
|
||||||
|
# error Please edit lines 126 or 128 in brg_endian.h to set the platform byte order
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
231
algo/groestl/sse2/brg_types.h
Normal file
231
algo/groestl/sse2/brg_types.h
Normal file
@@ -0,0 +1,231 @@
|
|||||||
|
/*
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
Copyright (c) 1998-2008, Brian Gladman, Worcester, UK. All rights reserved.
|
||||||
|
|
||||||
|
(a few lines added by Soeren S. Thomsen, October 2008)
|
||||||
|
|
||||||
|
LICENSE TERMS
|
||||||
|
|
||||||
|
The redistribution and use of this software (with or without changes)
|
||||||
|
is allowed without the payment of fees or royalties provided that:
|
||||||
|
|
||||||
|
1. source code distributions include the above copyright notice, this
|
||||||
|
list of conditions and the following disclaimer;
|
||||||
|
|
||||||
|
2. binary distributions include the above copyright notice, this list
|
||||||
|
of conditions and the following disclaimer in their documentation;
|
||||||
|
|
||||||
|
3. the name of the copyright holder is not used to endorse products
|
||||||
|
built using this software without specific written permission.
|
||||||
|
|
||||||
|
DISCLAIMER
|
||||||
|
|
||||||
|
This software is provided 'as is' with no explicit or implied warranties
|
||||||
|
in respect of its properties, including, but not limited to, correctness
|
||||||
|
and/or fitness for purpose.
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
Issue Date: 20/12/2007
|
||||||
|
|
||||||
|
The unsigned integer types defined here are of the form uint_<nn>t where
|
||||||
|
<nn> is the length of the type; for example, the unsigned 32-bit type is
|
||||||
|
'uint_32t'. These are NOT the same as the 'C99 integer types' that are
|
||||||
|
defined in the inttypes.h and stdint.h headers since attempts to use these
|
||||||
|
types have shown that support for them is still highly variable. However,
|
||||||
|
since the latter are of the form uint<nn>_t, a regular expression search
|
||||||
|
and replace (in VC++ search on 'uint_{:z}t' and replace with 'uint\1_t')
|
||||||
|
can be used to convert the types used here to the C99 standard types.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _BRG_TYPES_H
|
||||||
|
#define _BRG_TYPES_H
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
|
#if defined( _MSC_VER ) && ( _MSC_VER >= 1300 )
|
||||||
|
# include <stddef.h>
|
||||||
|
# define ptrint_t intptr_t
|
||||||
|
#elif defined( __GNUC__ ) && ( __GNUC__ >= 3 )
|
||||||
|
# include <stdint.h>
|
||||||
|
# define ptrint_t intptr_t
|
||||||
|
#else
|
||||||
|
# define ptrint_t int
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef BRG_UI8
|
||||||
|
# define BRG_UI8
|
||||||
|
# if UCHAR_MAX == 255u
|
||||||
|
typedef unsigned char uint_8t;
|
||||||
|
# else
|
||||||
|
# error Please define uint_8t as an 8-bit unsigned integer type in brg_types.h
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef BRG_UI16
|
||||||
|
# define BRG_UI16
|
||||||
|
# if USHRT_MAX == 65535u
|
||||||
|
typedef unsigned short uint_16t;
|
||||||
|
# else
|
||||||
|
# error Please define uint_16t as a 16-bit unsigned short type in brg_types.h
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef BRG_UI32
|
||||||
|
# define BRG_UI32
|
||||||
|
# if UINT_MAX == 4294967295u
|
||||||
|
# define li_32(h) 0x##h##u
|
||||||
|
typedef unsigned int uint_32t;
|
||||||
|
# elif ULONG_MAX == 4294967295u
|
||||||
|
# define li_32(h) 0x##h##ul
|
||||||
|
typedef unsigned long uint_32t;
|
||||||
|
# elif defined( _CRAY )
|
||||||
|
# error This code needs 32-bit data types, which Cray machines do not provide
|
||||||
|
# else
|
||||||
|
# error Please define uint_32t as a 32-bit unsigned integer type in brg_types.h
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef BRG_UI64
|
||||||
|
# if defined( __BORLANDC__ ) && !defined( __MSDOS__ )
|
||||||
|
# define BRG_UI64
|
||||||
|
# define li_64(h) 0x##h##ui64
|
||||||
|
typedef unsigned __int64 uint_64t;
|
||||||
|
# elif defined( _MSC_VER ) && ( _MSC_VER < 1300 ) /* 1300 == VC++ 7.0 */
|
||||||
|
# define BRG_UI64
|
||||||
|
# define li_64(h) 0x##h##ui64
|
||||||
|
typedef unsigned __int64 uint_64t;
|
||||||
|
# elif defined( __sun ) && defined( ULONG_MAX ) && ULONG_MAX == 0xfffffffful
|
||||||
|
# define BRG_UI64
|
||||||
|
# define li_64(h) 0x##h##ull
|
||||||
|
typedef unsigned long long uint_64t;
|
||||||
|
# elif defined( __MVS__ )
|
||||||
|
# define BRG_UI64
|
||||||
|
# define li_64(h) 0x##h##ull
|
||||||
|
typedef unsigned int long long uint_64t;
|
||||||
|
# elif defined( UINT_MAX ) && UINT_MAX > 4294967295u
|
||||||
|
# if UINT_MAX == 18446744073709551615u
|
||||||
|
# define BRG_UI64
|
||||||
|
# define li_64(h) 0x##h##u
|
||||||
|
typedef unsigned int uint_64t;
|
||||||
|
# endif
|
||||||
|
# elif defined( ULONG_MAX ) && ULONG_MAX > 4294967295u
|
||||||
|
# if ULONG_MAX == 18446744073709551615ul
|
||||||
|
# define BRG_UI64
|
||||||
|
# define li_64(h) 0x##h##ul
|
||||||
|
typedef unsigned long uint_64t;
|
||||||
|
# endif
|
||||||
|
# elif defined( ULLONG_MAX ) && ULLONG_MAX > 4294967295u
|
||||||
|
# if ULLONG_MAX == 18446744073709551615ull
|
||||||
|
# define BRG_UI64
|
||||||
|
# define li_64(h) 0x##h##ull
|
||||||
|
typedef unsigned long long uint_64t;
|
||||||
|
# endif
|
||||||
|
# elif defined( ULONG_LONG_MAX ) && ULONG_LONG_MAX > 4294967295u
|
||||||
|
# if ULONG_LONG_MAX == 18446744073709551615ull
|
||||||
|
# define BRG_UI64
|
||||||
|
# define li_64(h) 0x##h##ull
|
||||||
|
typedef unsigned long long uint_64t;
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined( BRG_UI64 )
|
||||||
|
# if defined( NEED_UINT_64T )
|
||||||
|
# error Please define uint_64t as an unsigned 64 bit type in brg_types.h
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef RETURN_VALUES
|
||||||
|
# define RETURN_VALUES
|
||||||
|
# if defined( DLL_EXPORT )
|
||||||
|
# if defined( _MSC_VER ) || defined ( __INTEL_COMPILER )
|
||||||
|
# define VOID_RETURN __declspec( dllexport ) void __stdcall
|
||||||
|
# define INT_RETURN __declspec( dllexport ) int __stdcall
|
||||||
|
# elif defined( __GNUC__ )
|
||||||
|
# define VOID_RETURN __declspec( __dllexport__ ) void
|
||||||
|
# define INT_RETURN __declspec( __dllexport__ ) int
|
||||||
|
# else
|
||||||
|
# error Use of the DLL is only available on the Microsoft, Intel and GCC compilers
|
||||||
|
# endif
|
||||||
|
# elif defined( DLL_IMPORT )
|
||||||
|
# if defined( _MSC_VER ) || defined ( __INTEL_COMPILER )
|
||||||
|
# define VOID_RETURN __declspec( dllimport ) void __stdcall
|
||||||
|
# define INT_RETURN __declspec( dllimport ) int __stdcall
|
||||||
|
# elif defined( __GNUC__ )
|
||||||
|
# define VOID_RETURN __declspec( __dllimport__ ) void
|
||||||
|
# define INT_RETURN __declspec( __dllimport__ ) int
|
||||||
|
# else
|
||||||
|
# error Use of the DLL is only available on the Microsoft, Intel and GCC compilers
|
||||||
|
# endif
|
||||||
|
# elif defined( __WATCOMC__ )
|
||||||
|
# define VOID_RETURN void __cdecl
|
||||||
|
# define INT_RETURN int __cdecl
|
||||||
|
# else
|
||||||
|
# define VOID_RETURN void
|
||||||
|
# define INT_RETURN int
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* These defines are used to detect and set the memory alignment of pointers.
|
||||||
|
Note that offsets are in bytes.
|
||||||
|
|
||||||
|
ALIGN_OFFSET(x,n) return the positive or zero offset of
|
||||||
|
the memory addressed by the pointer 'x'
|
||||||
|
from an address that is aligned on an
|
||||||
|
'n' byte boundary ('n' is a power of 2)
|
||||||
|
|
||||||
|
ALIGN_FLOOR(x,n) return a pointer that points to memory
|
||||||
|
that is aligned on an 'n' byte boundary
|
||||||
|
and is not higher than the memory address
|
||||||
|
pointed to by 'x' ('n' is a power of 2)
|
||||||
|
|
||||||
|
ALIGN_CEIL(x,n) return a pointer that points to memory
|
||||||
|
that is aligned on an 'n' byte boundary
|
||||||
|
and is not lower than the memory address
|
||||||
|
pointed to by 'x' ('n' is a power of 2)
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define ALIGN_OFFSET(x,n) (((ptrint_t)(x)) & ((n) - 1))
|
||||||
|
#define ALIGN_FLOOR(x,n) ((uint_8t*)(x) - ( ((ptrint_t)(x)) & ((n) - 1)))
|
||||||
|
#define ALIGN_CEIL(x,n) ((uint_8t*)(x) + (-((ptrint_t)(x)) & ((n) - 1)))
|
||||||
|
|
||||||
|
/* These defines are used to declare buffers in a way that allows
|
||||||
|
faster operations on longer variables to be used. In all these
|
||||||
|
defines 'size' must be a power of 2 and >= 8. NOTE that the
|
||||||
|
buffer size is in bytes but the type length is in bits
|
||||||
|
|
||||||
|
UNIT_TYPEDEF(x,size) declares a variable 'x' of length
|
||||||
|
'size' bits
|
||||||
|
|
||||||
|
BUFR_TYPEDEF(x,size,bsize) declares a buffer 'x' of length 'bsize'
|
||||||
|
bytes defined as an array of variables
|
||||||
|
each of 'size' bits (bsize must be a
|
||||||
|
multiple of size / 8)
|
||||||
|
|
||||||
|
UNIT_CAST(x,size) casts a variable to a type of
|
||||||
|
length 'size' bits
|
||||||
|
|
||||||
|
UPTR_CAST(x,size) casts a pointer to a pointer to a
|
||||||
|
varaiable of length 'size' bits
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define UI_TYPE(size) uint_##size##t
|
||||||
|
#define UNIT_TYPEDEF(x,size) typedef UI_TYPE(size) x
|
||||||
|
#define BUFR_TYPEDEF(x,size,bsize) typedef UI_TYPE(size) x[bsize / (size >> 3)]
|
||||||
|
#define UNIT_CAST(x,size) ((UI_TYPE(size) )(x))
|
||||||
|
#define UPTR_CAST(x,size) ((UI_TYPE(size)*)(x))
|
||||||
|
|
||||||
|
/* Added by Soeren S. Thomsen (begin) */
|
||||||
|
#define u8 uint_8t
|
||||||
|
#define u32 uint_32t
|
||||||
|
#define u64 uint_64t
|
||||||
|
/* (end) */
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
1063
algo/groestl/sse2/grso-asm.c
Normal file
1063
algo/groestl/sse2/grso-asm.c
Normal file
File diff suppressed because it is too large
Load Diff
10
algo/groestl/sse2/grso-asm.h
Normal file
10
algo/groestl/sse2/grso-asm.h
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#ifndef GRSOASM_H
|
||||||
|
#define GRSOASM_H
|
||||||
|
|
||||||
|
#include "grso.h"
|
||||||
|
|
||||||
|
void grsoP1024ASM (u64 *x) ;
|
||||||
|
|
||||||
|
void grsoQ1024ASM (u64 *x) ;
|
||||||
|
|
||||||
|
#endif
|
1016
algo/groestl/sse2/grso-asm2.c
Normal file
1016
algo/groestl/sse2/grso-asm2.c
Normal file
File diff suppressed because it is too large
Load Diff
11
algo/groestl/sse2/grso-asm2.h
Normal file
11
algo/groestl/sse2/grso-asm2.h
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#ifndef GRSOASM_H
|
||||||
|
#define GRSOASM_H
|
||||||
|
/* really same as the mmx asm.h */
|
||||||
|
/* made just in case something must be changed */
|
||||||
|
#include "grso.h"
|
||||||
|
|
||||||
|
void grsoP1024ASM (u64 *x) ;
|
||||||
|
|
||||||
|
void grsoQ1024ASM (u64 *x) ;
|
||||||
|
|
||||||
|
#endif
|
110
algo/groestl/sse2/grso-macro.c
Normal file
110
algo/groestl/sse2/grso-macro.c
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
/* hash.c January 2011
|
||||||
|
*
|
||||||
|
* Groestl-512 implementation with inline assembly containing mmx and
|
||||||
|
* sse instructions. Optimized for Opteron.
|
||||||
|
* Authors: Krystian Matusiewicz and Soeren S. Thomsen
|
||||||
|
*
|
||||||
|
* This code is placed in the public domain
|
||||||
|
*/
|
||||||
|
|
||||||
|
//#include "grso.h"
|
||||||
|
//#include "grso-asm.h"
|
||||||
|
// #include "grsotab.h"
|
||||||
|
|
||||||
|
#define DECL_GRS
|
||||||
|
|
||||||
|
/* load initial constants */
|
||||||
|
#define GRS_I \
|
||||||
|
do { \
|
||||||
|
int i; \
|
||||||
|
/* set initial value */ \
|
||||||
|
for (i = 0; i < grsoCOLS-1; i++) sts_grs.grsstate[i] = 0; \
|
||||||
|
sts_grs.grsstate[grsoCOLS-1] = grsoU64BIG((u64)(8*grsoDIGESTSIZE)); \
|
||||||
|
\
|
||||||
|
/* set other variables */ \
|
||||||
|
sts_grs.grsbuf_ptr = 0; \
|
||||||
|
sts_grs.grsblock_counter = 0; \
|
||||||
|
} while (0); \
|
||||||
|
|
||||||
|
/* load hash */
|
||||||
|
#define GRS_U \
|
||||||
|
do { \
|
||||||
|
unsigned char* in = hash; \
|
||||||
|
unsigned long long index = 0; \
|
||||||
|
\
|
||||||
|
/* if the buffer contains data that has not yet been digested, first \
|
||||||
|
add data to buffer until full */ \
|
||||||
|
if (sts_grs.grsbuf_ptr) { \
|
||||||
|
while (sts_grs.grsbuf_ptr < grsoSIZE && index < 64) { \
|
||||||
|
hashbuf[(int)sts_grs.grsbuf_ptr++] = in[index++]; \
|
||||||
|
} \
|
||||||
|
if (sts_grs.grsbuf_ptr < grsoSIZE) continue; \
|
||||||
|
\
|
||||||
|
/* digest buffer */ \
|
||||||
|
sts_grs.grsbuf_ptr = 0; \
|
||||||
|
grsoTransform(&sts_grs, hashbuf, grsoSIZE); \
|
||||||
|
} \
|
||||||
|
\
|
||||||
|
/* digest bulk of message */ \
|
||||||
|
grsoTransform(&sts_grs, in+index, 64-index); \
|
||||||
|
index += ((64-index)/grsoSIZE)*grsoSIZE; \
|
||||||
|
\
|
||||||
|
/* store remaining data in buffer */ \
|
||||||
|
while (index < 64) { \
|
||||||
|
hashbuf[(int)sts_grs.grsbuf_ptr++] = in[index++]; \
|
||||||
|
} \
|
||||||
|
\
|
||||||
|
} while (0);
|
||||||
|
|
||||||
|
/* groestl512 hash loaded */
|
||||||
|
/* hash = groestl512(loaded) */
|
||||||
|
#define GRS_C \
|
||||||
|
do { \
|
||||||
|
char *out = hash; \
|
||||||
|
int i, j = 0; \
|
||||||
|
unsigned char *s = (unsigned char*)sts_grs.grsstate; \
|
||||||
|
\
|
||||||
|
hashbuf[sts_grs.grsbuf_ptr++] = 0x80; \
|
||||||
|
\
|
||||||
|
/* pad with '0'-bits */ \
|
||||||
|
if (sts_grs.grsbuf_ptr > grsoSIZE-grsoLENGTHFIELDLEN) { \
|
||||||
|
/* padding requires two blocks */ \
|
||||||
|
while (sts_grs.grsbuf_ptr < grsoSIZE) { \
|
||||||
|
hashbuf[sts_grs.grsbuf_ptr++] = 0; \
|
||||||
|
} \
|
||||||
|
/* digest first padding block */ \
|
||||||
|
grsoTransform(&sts_grs, hashbuf, grsoSIZE); \
|
||||||
|
sts_grs.grsbuf_ptr = 0; \
|
||||||
|
} \
|
||||||
|
while (sts_grs.grsbuf_ptr < grsoSIZE-grsoLENGTHFIELDLEN) { \
|
||||||
|
hashbuf[sts_grs.grsbuf_ptr++] = 0; \
|
||||||
|
} \
|
||||||
|
\
|
||||||
|
/* length padding */ \
|
||||||
|
sts_grs.grsblock_counter++; \
|
||||||
|
sts_grs.grsbuf_ptr = grsoSIZE; \
|
||||||
|
while (sts_grs.grsbuf_ptr > grsoSIZE-grsoLENGTHFIELDLEN) { \
|
||||||
|
hashbuf[--sts_grs.grsbuf_ptr] = (unsigned char)sts_grs.grsblock_counter; \
|
||||||
|
sts_grs.grsblock_counter >>= 8; \
|
||||||
|
} \
|
||||||
|
\
|
||||||
|
/* digest final padding block */ \
|
||||||
|
grsoTransform(&sts_grs, hashbuf, grsoSIZE); \
|
||||||
|
/* perform output transformation */ \
|
||||||
|
grsoOutputTransformation(&sts_grs); \
|
||||||
|
\
|
||||||
|
/* store hash result in output */ \
|
||||||
|
for (i = grsoSIZE-grsoDIGESTSIZE; i < grsoSIZE; i++,j++) { \
|
||||||
|
out[j] = s[i]; \
|
||||||
|
} \
|
||||||
|
\
|
||||||
|
/* zeroise relevant variables and deallocate memory */ \
|
||||||
|
for (i = 0; i < grsoCOLS; i++) { \
|
||||||
|
sts_grs.grsstate[i] = 0; \
|
||||||
|
} \
|
||||||
|
for (i = 0; i < grsoSIZE; i++) { \
|
||||||
|
hashbuf[i] = 0; \
|
||||||
|
} \
|
||||||
|
} while (0);
|
||||||
|
|
||||||
|
|
57
algo/groestl/sse2/grso.c
Normal file
57
algo/groestl/sse2/grso.c
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
/* hash.c January 2011
|
||||||
|
*
|
||||||
|
* Groestl-512 implementation with inline assembly containing mmx and
|
||||||
|
* sse instructions. Optimized for Opteron.
|
||||||
|
* Authors: Krystian Matusiewicz and Soeren S. Thomsen
|
||||||
|
*
|
||||||
|
* This code is placed in the public domain
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "algo/groestl/sse2/grso-asm.h"
|
||||||
|
#include "algo/groestl/sse2/grso.h"
|
||||||
|
#include "algo/groestl/sse2/grsotab.h"
|
||||||
|
|
||||||
|
/* digest up to len bytes of input (full blocks only) */
|
||||||
|
void grsoTransform(grsoState *ctx,
|
||||||
|
const unsigned char *in,
|
||||||
|
unsigned long long len) {
|
||||||
|
u64 y[grsoCOLS+2] __attribute__ ((aligned (16)));
|
||||||
|
u64 z[grsoCOLS+2] __attribute__ ((aligned (16)));
|
||||||
|
u64 *m, *h = (u64*)ctx->grsstate;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
/* increment block counter */
|
||||||
|
ctx->grsblock_counter += len/grsoSIZE;
|
||||||
|
|
||||||
|
/* digest message, one block at a time */
|
||||||
|
for (; len >= grsoSIZE; len -= grsoSIZE, in += grsoSIZE) {
|
||||||
|
m = (u64*)in;
|
||||||
|
for (i = 0; i < grsoCOLS; i++) {
|
||||||
|
y[i] = m[i];
|
||||||
|
z[i] = m[i] ^ h[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
grsoQ1024ASM(y);
|
||||||
|
grsoP1024ASM(z);
|
||||||
|
|
||||||
|
/* h' == h + Q(m) + P(h+m) */
|
||||||
|
for (i = 0; i < grsoCOLS; i++) {
|
||||||
|
h[i] ^= z[i] ^ y[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* given state h, do h <- P(h)+h */
|
||||||
|
void grsoOutputTransformation(grsoState *ctx) {
|
||||||
|
u64 z[grsoCOLS] __attribute__ ((aligned (16)));
|
||||||
|
int j;
|
||||||
|
|
||||||
|
for (j = 0; j < grsoCOLS; j++) {
|
||||||
|
z[j] = ctx->grsstate[j];
|
||||||
|
}
|
||||||
|
grsoP1024ASM(z);
|
||||||
|
for (j = 0; j < grsoCOLS; j++) {
|
||||||
|
ctx->grsstate[j] ^= z[j];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
62
algo/groestl/sse2/grso.h
Normal file
62
algo/groestl/sse2/grso.h
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
#ifndef __hash_h
|
||||||
|
#define __hash_h
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include "brg_endian.h"
|
||||||
|
#include "brg_types.h"
|
||||||
|
|
||||||
|
/* some sizes (number of bytes) */
|
||||||
|
#define grsoROWS 8
|
||||||
|
#define grsoLENGTHFIELDLEN grsoROWS
|
||||||
|
#define grsoCOLS 16
|
||||||
|
#define grsoSIZE (grsoROWS*grsoCOLS)
|
||||||
|
#define grsoDIGESTSIZE 64
|
||||||
|
|
||||||
|
#define grsoROUNDS 14
|
||||||
|
|
||||||
|
#define grsoROTL64(a,n) ((((a)<<(n))|((a)>>(64-(n))))&((u64)0xffffffffffffffffULL))
|
||||||
|
|
||||||
|
#if (PLATFORM_BYTE_ORDER == IS_BIG_ENDIAN)
|
||||||
|
#error
|
||||||
|
#endif /* IS_BIG_ENDIAN */
|
||||||
|
|
||||||
|
#if (PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN)
|
||||||
|
#define EXT_BYTE(var,n) ((u8)((u64)(var) >> (8*n)))
|
||||||
|
#define grsoU64BIG(a) \
|
||||||
|
((grsoROTL64(a, 8) & ((u64)0x000000ff000000ffULL)) | \
|
||||||
|
(grsoROTL64(a,24) & ((u64)0x0000ff000000ff00ULL)) | \
|
||||||
|
(grsoROTL64(a,40) & ((u64)0x00ff000000ff0000ULL)) | \
|
||||||
|
(grsoROTL64(a,56) & ((u64)0xff000000ff000000ULL)))
|
||||||
|
#endif /* IS_LITTLE_ENDIAN */
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
u64 grsstate[grsoCOLS]; /* actual state */
|
||||||
|
u64 grsblock_counter; /* message block counter */
|
||||||
|
int grsbuf_ptr; /* data buffer pointer */
|
||||||
|
} grsoState;
|
||||||
|
|
||||||
|
//extern int grsoInit(grsoState* ctx);
|
||||||
|
//extern int grsoUpdate(grsoState* ctx, const unsigned char* in,
|
||||||
|
// unsigned long long len);
|
||||||
|
//extern int grsoUpdateq(grsoState* ctx, const unsigned char* in);
|
||||||
|
//extern int grsoFinal(grsoState* ctx,
|
||||||
|
// unsigned char* out);
|
||||||
|
//
|
||||||
|
//extern int grsohash(unsigned char *out,
|
||||||
|
// const unsigned char *in,
|
||||||
|
// unsigned long long len);
|
||||||
|
|
||||||
|
/* digest up to len bytes of input (full blocks only) */
|
||||||
|
void grsoTransform( grsoState *ctx, const unsigned char *in,
|
||||||
|
unsigned long long len );
|
||||||
|
|
||||||
|
/* given state h, do h <- P(h)+h */
|
||||||
|
void grsoOutputTransformation( grsoState *ctx );
|
||||||
|
|
||||||
|
int grso_init ( grsoState* sts_grs );
|
||||||
|
int grso_update ( grsoState* sts_grs, char* hashbuf, char* hash );
|
||||||
|
int grso_close ( grsoState *sts_grs, char* hashbuf, char* hash );
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* __hash_h */
|
23
algo/groestl/sse2/grsotab.h
Normal file
23
algo/groestl/sse2/grsotab.h
Normal file
File diff suppressed because one or more lines are too long
@@ -84,7 +84,7 @@ bool zoin_thread_init()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool register_zoin_algo( algo_gate_t* gate )
|
bool register_lyra2z330_algo( algo_gate_t* gate )
|
||||||
{
|
{
|
||||||
gate->optimizations = SSE2_OPT | AES_OPT | AVX_OPT | AVX2_OPT;
|
gate->optimizations = SSE2_OPT | AES_OPT | AVX_OPT | AVX2_OPT;
|
||||||
gate->miner_thread_init = (void*)&zoin_thread_init;
|
gate->miner_thread_init = (void*)&zoin_thread_init;
|
||||||
|
15
algo/nist5.c
15
algo/nist5.c
@@ -17,7 +17,10 @@
|
|||||||
#include "algo/skein/sse2/skein.c"
|
#include "algo/skein/sse2/skein.c"
|
||||||
#include "algo/jh/sse2/jh_sse2_opt64.h"
|
#include "algo/jh/sse2/jh_sse2_opt64.h"
|
||||||
|
|
||||||
#ifndef NO_AES_NI
|
#ifdef NO_AES_NI
|
||||||
|
#include "algo/groestl/sse2/grso.h"
|
||||||
|
#include "algo/groestl/sse2/grso-macro.c"
|
||||||
|
#else
|
||||||
#include "algo/groestl/aes_ni/hash-groestl.h"
|
#include "algo/groestl/aes_ni/hash-groestl.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -43,7 +46,7 @@ void init_nist5_ctx()
|
|||||||
void nist5hash(void *output, const void *input)
|
void nist5hash(void *output, const void *input)
|
||||||
{
|
{
|
||||||
size_t hashptr;
|
size_t hashptr;
|
||||||
unsigned char hashbuf[128];
|
unsigned char hashbuf[128] __attribute__ ((aligned (32)));
|
||||||
sph_u64 hashctA;
|
sph_u64 hashctA;
|
||||||
sph_u64 hashctB;
|
sph_u64 hashctB;
|
||||||
unsigned char hash[128];
|
unsigned char hash[128];
|
||||||
@@ -59,8 +62,12 @@ void nist5hash(void *output, const void *input)
|
|||||||
BLK_C;
|
BLK_C;
|
||||||
|
|
||||||
#ifdef NO_AES_NI
|
#ifdef NO_AES_NI
|
||||||
sph_groestl512 (&ctx.groestl, hash, 64);
|
grsoState sts_grs;
|
||||||
sph_groestl512_close(&ctx.groestl, hash);
|
GRS_I;
|
||||||
|
GRS_U;
|
||||||
|
GRS_C;
|
||||||
|
// sph_groestl512 (&ctx.groestl, hash, 64);
|
||||||
|
// sph_groestl512_close(&ctx.groestl, hash);
|
||||||
#else
|
#else
|
||||||
update_groestl( &ctx.groestl, (char*)hash,512);
|
update_groestl( &ctx.groestl, (char*)hash,512);
|
||||||
final_groestl( &ctx.groestl, (char*)hash);
|
final_groestl( &ctx.groestl, (char*)hash);
|
||||||
|
@@ -19,7 +19,10 @@
|
|||||||
#include "algo/skein/sse2/skein.c"
|
#include "algo/skein/sse2/skein.c"
|
||||||
#include "algo/jh/sse2/jh_sse2_opt64.h"
|
#include "algo/jh/sse2/jh_sse2_opt64.h"
|
||||||
|
|
||||||
#ifndef NO_AES_NI
|
#ifdef NO_AES_NI
|
||||||
|
#include "algo/groestl/sse2/grso.h"
|
||||||
|
#include "algo/groestl/sse2/grso-macro.c"
|
||||||
|
#else
|
||||||
#include "algo/groestl/aes_ni/hash-groestl.h"
|
#include "algo/groestl/aes_ni/hash-groestl.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -55,7 +58,7 @@ inline static void quarkhash(void *state, const void *input)
|
|||||||
sph_u64 hashctA;
|
sph_u64 hashctA;
|
||||||
sph_u64 hashctB;
|
sph_u64 hashctB;
|
||||||
int i;
|
int i;
|
||||||
unsigned char hash[128];
|
unsigned char hash[128] __attribute__ ((aligned (32)));
|
||||||
#ifdef NO_AES_NI
|
#ifdef NO_AES_NI
|
||||||
sph_groestl512_context ctx;
|
sph_groestl512_context ctx;
|
||||||
#else
|
#else
|
||||||
@@ -113,9 +116,13 @@ inline static void quarkhash(void *state, const void *input)
|
|||||||
{
|
{
|
||||||
|
|
||||||
#ifdef NO_AES_NI
|
#ifdef NO_AES_NI
|
||||||
sph_groestl512_init( &ctx );
|
grsoState sts_grs;
|
||||||
sph_groestl512 ( &ctx, hash, 64 );
|
GRS_I;
|
||||||
sph_groestl512_close( &ctx, hash );
|
GRS_U;
|
||||||
|
GRS_C;
|
||||||
|
// sph_groestl512_init( &ctx );
|
||||||
|
// sph_groestl512 ( &ctx, hash, 64 );
|
||||||
|
// sph_groestl512_close( &ctx, hash );
|
||||||
#else
|
#else
|
||||||
reinit_groestl( &ctx );
|
reinit_groestl( &ctx );
|
||||||
update_groestl( &ctx, (char*)hash, 512 );
|
update_groestl( &ctx, (char*)hash, 512 );
|
||||||
|
143
algo/sha2/sha256t.c
Normal file
143
algo/sha2/sha256t.c
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
#include "miner.h"
|
||||||
|
#include "algo-gate-api.h"
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include "sph-sha2.h"
|
||||||
|
|
||||||
|
//#define DEBUG_ALGO
|
||||||
|
|
||||||
|
|
||||||
|
static sph_sha256_context sha256t_ctx __attribute__ ((aligned (64)));
|
||||||
|
static __thread sph_sha256_context sha256t_mid __attribute__ ((aligned (64)));
|
||||||
|
|
||||||
|
void sha256t_midstate( const void* input )
|
||||||
|
{
|
||||||
|
memcpy( &sha256t_mid, &sha256t_ctx, sizeof sha256t_mid );
|
||||||
|
sph_sha256( &sha256t_mid, input, 64 );
|
||||||
|
}
|
||||||
|
|
||||||
|
void sha256t_hash(void* output, const void* input, uint32_t len)
|
||||||
|
{
|
||||||
|
sph_sha256_context ctx_sha256 __attribute__ ((aligned (64)));
|
||||||
|
uint32_t _ALIGN(64) hashA[16];
|
||||||
|
|
||||||
|
const int midlen = 64; // bytes
|
||||||
|
const int tail = 80 - midlen; // 16
|
||||||
|
|
||||||
|
memcpy( &ctx_sha256, &sha256t_mid, sizeof sha256t_mid );
|
||||||
|
sph_sha256( &ctx_sha256, input + midlen, tail );
|
||||||
|
|
||||||
|
// sph_sha256_init(&ctx_sha256);
|
||||||
|
// sph_sha256 (&ctx_sha256, input, 80);
|
||||||
|
sph_sha256_close( &ctx_sha256, hashA );
|
||||||
|
|
||||||
|
// sph_sha256_init(&ctx_sha256);
|
||||||
|
memcpy( &ctx_sha256, &sha256t_ctx, sizeof sha256t_ctx );
|
||||||
|
sph_sha256( &ctx_sha256, hashA, 32 );
|
||||||
|
sph_sha256_close( &ctx_sha256, hashA );
|
||||||
|
|
||||||
|
// sph_sha256_init(&ctx_sha256);
|
||||||
|
memcpy( &ctx_sha256, &sha256t_ctx, sizeof sha256t_ctx );
|
||||||
|
sph_sha256( &ctx_sha256, hashA, 32 );
|
||||||
|
sph_sha256_close( &ctx_sha256, hashA );
|
||||||
|
|
||||||
|
memcpy( output, hashA, 32 );
|
||||||
|
}
|
||||||
|
|
||||||
|
int scanhash_sha256t(int thr_id, struct work *work,
|
||||||
|
uint32_t max_nonce, uint64_t *hashes_done)
|
||||||
|
{
|
||||||
|
uint32_t *pdata = work->data;
|
||||||
|
uint32_t *ptarget = work->target;
|
||||||
|
uint32_t len = 80;
|
||||||
|
|
||||||
|
uint32_t n = pdata[19] - 1;
|
||||||
|
const uint32_t first_nonce = pdata[19];
|
||||||
|
const uint32_t Htarg = ptarget[7];
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
uint32_t __declspec(align(32)) hash64[8];
|
||||||
|
#else
|
||||||
|
uint32_t hash64[8] __attribute__((aligned(32)));
|
||||||
|
#endif
|
||||||
|
uint32_t endiandata[32];
|
||||||
|
|
||||||
|
uint64_t htmax[] = {
|
||||||
|
0,
|
||||||
|
0xF,
|
||||||
|
0xFF,
|
||||||
|
0xFFF,
|
||||||
|
0xFFFF,
|
||||||
|
0x10000000
|
||||||
|
};
|
||||||
|
uint32_t masks[] = {
|
||||||
|
0xFFFFFFFF,
|
||||||
|
0xFFFFFFF0,
|
||||||
|
0xFFFFFF00,
|
||||||
|
0xFFFFF000,
|
||||||
|
0xFFFF0000,
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
|
// we need bigendian data...
|
||||||
|
for (int k = 0; k < 19; k++)
|
||||||
|
be32enc(&endiandata[k], pdata[k]);
|
||||||
|
|
||||||
|
sha256t_midstate( endiandata );
|
||||||
|
|
||||||
|
#ifdef DEBUG_ALGO
|
||||||
|
if (Htarg != 0)
|
||||||
|
printf("[%d] Htarg=%X\n", thr_id, Htarg);
|
||||||
|
#endif
|
||||||
|
for (int m=0; m < 6; m++) {
|
||||||
|
if (Htarg <= htmax[m]) {
|
||||||
|
uint32_t mask = masks[m];
|
||||||
|
do {
|
||||||
|
pdata[19] = ++n;
|
||||||
|
be32enc(&endiandata[19], n);
|
||||||
|
sha256t_hash(hash64, endiandata, len);
|
||||||
|
#ifndef DEBUG_ALGO
|
||||||
|
if ((!(hash64[7] & mask)) && fulltest(hash64, ptarget)) {
|
||||||
|
*hashes_done = n - first_nonce + 1;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
if (!(n % 0x1000) && !thr_id) printf(".");
|
||||||
|
if (!(hash64[7] & mask)) {
|
||||||
|
printf("[%d]",thr_id);
|
||||||
|
if (fulltest(hash64, ptarget)) {
|
||||||
|
*hashes_done = n - first_nonce + 1;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
} while (n < max_nonce && !work_restart[thr_id].restart);
|
||||||
|
// see blake.c if else to understand the loop on htmax => mask
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
*hashes_done = n - first_nonce + 1;
|
||||||
|
pdata[19] = n;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void sha256t_set_target( struct work* work, double job_diff )
|
||||||
|
{
|
||||||
|
work_set_target( work, job_diff / (256.0 * opt_diff_factor) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool register_sha256t_algo( algo_gate_t* gate )
|
||||||
|
{
|
||||||
|
sph_sha256_init( &sha256t_ctx );
|
||||||
|
gate->scanhash = (void*)&scanhash_sha256t;
|
||||||
|
gate->hash = (void*)&sha256t_hash;
|
||||||
|
gate->hash_alt = (void*)&sha256t_hash;
|
||||||
|
gate->set_target = (void*)&sha256t_set_target;
|
||||||
|
gate->get_max64 = (void*)&get_max64_0x3ffff;
|
||||||
|
return true;
|
||||||
|
}
|
@@ -17,7 +17,10 @@
|
|||||||
#include "algo/simd/sph_simd.h"
|
#include "algo/simd/sph_simd.h"
|
||||||
#include "algo/echo/sph_echo.h"
|
#include "algo/echo/sph_echo.h"
|
||||||
|
|
||||||
#ifndef NO_AES_NI
|
#ifdef NO_AES_NI
|
||||||
|
#include "algo/groestl/sse2/grso.h"
|
||||||
|
#include "algo/groestl/sse2/grso-macro.c"
|
||||||
|
#else
|
||||||
#include "algo/groestl/aes_ni/hash-groestl.h"
|
#include "algo/groestl/aes_ni/hash-groestl.h"
|
||||||
#include "algo/echo/aes_ni/hash_api.h"
|
#include "algo/echo/aes_ni/hash_api.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -64,7 +67,7 @@ void init_x11_ctx()
|
|||||||
|
|
||||||
static void x11_hash( void *state, const void *input )
|
static void x11_hash( void *state, const void *input )
|
||||||
{
|
{
|
||||||
unsigned char hash[128] __attribute__ ((aligned (16)));
|
unsigned char hash[128] __attribute__ ((aligned (32)));
|
||||||
unsigned char hashbuf[128] __attribute__ ((aligned (16)));
|
unsigned char hashbuf[128] __attribute__ ((aligned (16)));
|
||||||
sph_u64 hashctA;
|
sph_u64 hashctA;
|
||||||
sph_u64 hashctB;
|
sph_u64 hashctB;
|
||||||
@@ -89,8 +92,12 @@ static void x11_hash( void *state, const void *input )
|
|||||||
#undef dH
|
#undef dH
|
||||||
|
|
||||||
#ifdef NO_AES_NI
|
#ifdef NO_AES_NI
|
||||||
sph_groestl512 (&ctx.groestl, hash, 64);
|
grsoState sts_grs;
|
||||||
sph_groestl512_close(&ctx.groestl, hash);
|
GRS_I;
|
||||||
|
GRS_U;
|
||||||
|
GRS_C;
|
||||||
|
// sph_groestl512 (&ctx.groestl, hash, 64);
|
||||||
|
// sph_groestl512_close(&ctx.groestl, hash);
|
||||||
#else
|
#else
|
||||||
update_groestl( &ctx.groestl, (char*)hash, 512 );
|
update_groestl( &ctx.groestl, (char*)hash, 512 );
|
||||||
final_groestl( &ctx.groestl, (char*)hash );
|
final_groestl( &ctx.groestl, (char*)hash );
|
||||||
|
@@ -160,7 +160,7 @@ static void evo_twisted_code(uint32_t ntime, char *permstr)
|
|||||||
|
|
||||||
static inline void x11evo_hash( void *state, const void *input )
|
static inline void x11evo_hash( void *state, const void *input )
|
||||||
{
|
{
|
||||||
uint32_t hash[16];
|
uint32_t hash[16] __attribute__ ((aligned (32)));
|
||||||
x11evo_ctx_holder ctx;
|
x11evo_ctx_holder ctx;
|
||||||
memcpy( &ctx, &x11evo_ctx, sizeof(x11evo_ctx) );
|
memcpy( &ctx, &x11evo_ctx, sizeof(x11evo_ctx) );
|
||||||
|
|
||||||
|
@@ -20,7 +20,10 @@
|
|||||||
#include "algo/skein/sse2/skein.c"
|
#include "algo/skein/sse2/skein.c"
|
||||||
#include "algo/jh/sse2/jh_sse2_opt64.h"
|
#include "algo/jh/sse2/jh_sse2_opt64.h"
|
||||||
|
|
||||||
#ifndef NO_AES_NI
|
#ifdef NO_AES_NI
|
||||||
|
#include "algo/groestl/sse2/grso.h"
|
||||||
|
#include "algo/groestl/sse2/grso-macro.c"
|
||||||
|
#else
|
||||||
#include "algo/groestl/aes_ni/hash-groestl.h"
|
#include "algo/groestl/aes_ni/hash-groestl.h"
|
||||||
#include "algo/echo/aes_ni/hash_api.h"
|
#include "algo/echo/aes_ni/hash_api.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -61,7 +64,7 @@ void init_sib_ctx()
|
|||||||
|
|
||||||
void sibhash(void *output, const void *input)
|
void sibhash(void *output, const void *input)
|
||||||
{
|
{
|
||||||
unsigned char hash[128]; // uint32_t hashA[16], hashB[16];
|
unsigned char hash[128] __attribute__ ((aligned (32)));
|
||||||
#define hashA hash
|
#define hashA hash
|
||||||
#define hashB hash+64
|
#define hashB hash+64
|
||||||
|
|
||||||
@@ -90,8 +93,12 @@ void sibhash(void *output, const void *input)
|
|||||||
#undef dH
|
#undef dH
|
||||||
|
|
||||||
#ifdef NO_AES_NI
|
#ifdef NO_AES_NI
|
||||||
sph_groestl512 (&ctx.groestl, hash, 64);
|
grsoState sts_grs;
|
||||||
sph_groestl512_close(&ctx.groestl, hash);
|
GRS_I;
|
||||||
|
GRS_U;
|
||||||
|
GRS_C;
|
||||||
|
// sph_groestl512 (&ctx.groestl, hash, 64);
|
||||||
|
// sph_groestl512_close(&ctx.groestl, hash);
|
||||||
#else
|
#else
|
||||||
update_groestl( &ctx.groestl, (char*)hash,512);
|
update_groestl( &ctx.groestl, (char*)hash,512);
|
||||||
final_groestl( &ctx.groestl, (char*)hash);
|
final_groestl( &ctx.groestl, (char*)hash);
|
||||||
|
@@ -29,7 +29,10 @@
|
|||||||
#include "algo/skein/sse2/skein.c"
|
#include "algo/skein/sse2/skein.c"
|
||||||
#include "algo/jh/sse2/jh_sse2_opt64.h"
|
#include "algo/jh/sse2/jh_sse2_opt64.h"
|
||||||
|
|
||||||
#ifndef NO_AES_NI
|
#ifdef NO_AES_NI
|
||||||
|
#include "algo/groestl/sse2/grso.h"
|
||||||
|
#include "algo/groestl/sse2/grso-macro.c"
|
||||||
|
#else
|
||||||
#include "algo/groestl/aes_ni/hash-groestl.h"
|
#include "algo/groestl/aes_ni/hash-groestl.h"
|
||||||
#include "algo/echo/aes_ni/hash_api.h"
|
#include "algo/echo/aes_ni/hash_api.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -71,7 +74,7 @@ void init_x13_ctx()
|
|||||||
|
|
||||||
static void x13hash(void *output, const void *input)
|
static void x13hash(void *output, const void *input)
|
||||||
{
|
{
|
||||||
unsigned char hash[128]; // uint32_t hashA[16], hashB[16];
|
unsigned char hash[128] __attribute__ ((aligned (32)));
|
||||||
#define hashB hash+64
|
#define hashB hash+64
|
||||||
|
|
||||||
x13_ctx_holder ctx;
|
x13_ctx_holder ctx;
|
||||||
@@ -110,8 +113,12 @@ static void x13hash(void *output, const void *input)
|
|||||||
//---groetl----
|
//---groetl----
|
||||||
|
|
||||||
#ifdef NO_AES_NI
|
#ifdef NO_AES_NI
|
||||||
sph_groestl512 (&ctx.groestl, hash, 64);
|
grsoState sts_grs;
|
||||||
sph_groestl512_close(&ctx.groestl, hash);
|
GRS_I;
|
||||||
|
GRS_U;
|
||||||
|
GRS_C;
|
||||||
|
// sph_groestl512 (&ctx.groestl, hash, 64);
|
||||||
|
// sph_groestl512_close(&ctx.groestl, hash);
|
||||||
#else
|
#else
|
||||||
update_groestl( &ctx.groestl, (char*)hash,512);
|
update_groestl( &ctx.groestl, (char*)hash,512);
|
||||||
final_groestl( &ctx.groestl, (char*)hash);
|
final_groestl( &ctx.groestl, (char*)hash);
|
||||||
|
@@ -31,7 +31,10 @@
|
|||||||
#include "algo/skein/sse2/skein.c"
|
#include "algo/skein/sse2/skein.c"
|
||||||
#include "algo/jh/sse2/jh_sse2_opt64.h"
|
#include "algo/jh/sse2/jh_sse2_opt64.h"
|
||||||
|
|
||||||
#ifndef NO_AES_NI
|
#ifdef NO_AES_NI
|
||||||
|
#include "algo/groestl/sse2/grso.h"
|
||||||
|
#include "algo/groestl/sse2/grso-macro.c"
|
||||||
|
#else
|
||||||
#include "algo/groestl/aes_ni/hash-groestl.h"
|
#include "algo/groestl/aes_ni/hash-groestl.h"
|
||||||
#include "algo/echo/aes_ni/hash_api.h"
|
#include "algo/echo/aes_ni/hash_api.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -75,7 +78,7 @@ void init_x14_ctx()
|
|||||||
|
|
||||||
static void x14hash(void *output, const void *input)
|
static void x14hash(void *output, const void *input)
|
||||||
{
|
{
|
||||||
unsigned char hash[128]; // uint32_t hashA[16], hashB[16];
|
unsigned char hash[128] __attribute__ ((aligned (32)));
|
||||||
#define hashB hash+64
|
#define hashB hash+64
|
||||||
|
|
||||||
x14_ctx_holder ctx;
|
x14_ctx_holder ctx;
|
||||||
@@ -112,8 +115,12 @@ static void x14hash(void *output, const void *input)
|
|||||||
//---groestl----
|
//---groestl----
|
||||||
|
|
||||||
#ifdef NO_AES_NI
|
#ifdef NO_AES_NI
|
||||||
sph_groestl512 (&ctx.groestl, hash, 64);
|
grsoState sts_grs;
|
||||||
sph_groestl512_close(&ctx.groestl, hash);
|
GRS_I;
|
||||||
|
GRS_U;
|
||||||
|
GRS_C;
|
||||||
|
// sph_groestl512 (&ctx.groestl, hash, 64);
|
||||||
|
// sph_groestl512_close(&ctx.groestl, hash);
|
||||||
#else
|
#else
|
||||||
update_groestl( &ctx.groestl, (char*)hash,512);
|
update_groestl( &ctx.groestl, (char*)hash,512);
|
||||||
final_groestl( &ctx.groestl, (char*)hash);
|
final_groestl( &ctx.groestl, (char*)hash);
|
||||||
|
@@ -31,9 +31,12 @@
|
|||||||
#include "algo/skein/sse2/skein.c"
|
#include "algo/skein/sse2/skein.c"
|
||||||
#include "algo/jh/sse2/jh_sse2_opt64.h"
|
#include "algo/jh/sse2/jh_sse2_opt64.h"
|
||||||
|
|
||||||
#ifndef NO_AES_NI
|
#ifdef NO_AES_NI
|
||||||
#include "algo/echo/aes_ni/hash_api.h"
|
#include "algo/groestl/sse2/grso.h"
|
||||||
|
#include "algo/groestl/sse2/grso-macro.c"
|
||||||
|
#else
|
||||||
#include "algo/groestl/aes_ni/hash-groestl.h"
|
#include "algo/groestl/aes_ni/hash-groestl.h"
|
||||||
|
#include "algo/echo/aes_ni/hash_api.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -77,7 +80,7 @@ void init_x15_ctx()
|
|||||||
|
|
||||||
static void x15hash(void *output, const void *input)
|
static void x15hash(void *output, const void *input)
|
||||||
{
|
{
|
||||||
unsigned char hash[128]; // uint32_t hashA[16], hashB[16];
|
unsigned char hash[128] __attribute__ ((aligned (32)));
|
||||||
#define hashB hash+64
|
#define hashB hash+64
|
||||||
|
|
||||||
x15_ctx_holder ctx;
|
x15_ctx_holder ctx;
|
||||||
@@ -113,8 +116,12 @@ static void x15hash(void *output, const void *input)
|
|||||||
//---groestl----
|
//---groestl----
|
||||||
|
|
||||||
#ifdef NO_AES_NI
|
#ifdef NO_AES_NI
|
||||||
sph_groestl512(&ctx.groestl, hash, 64);
|
grsoState sts_grs;
|
||||||
sph_groestl512_close(&ctx.groestl, hash);
|
GRS_I;
|
||||||
|
GRS_U;
|
||||||
|
GRS_C;
|
||||||
|
// sph_groestl512(&ctx.groestl, hash, 64);
|
||||||
|
// sph_groestl512_close(&ctx.groestl, hash);
|
||||||
#else
|
#else
|
||||||
update_groestl( &ctx.groestl, (char*)hash,512);
|
update_groestl( &ctx.groestl, (char*)hash,512);
|
||||||
final_groestl( &ctx.groestl, (char*)hash);
|
final_groestl( &ctx.groestl, (char*)hash);
|
||||||
|
@@ -33,9 +33,12 @@
|
|||||||
#include "algo/skein/sse2/skein.c"
|
#include "algo/skein/sse2/skein.c"
|
||||||
#include "algo/jh/sse2/jh_sse2_opt64.h"
|
#include "algo/jh/sse2/jh_sse2_opt64.h"
|
||||||
|
|
||||||
#ifndef NO_AES_NI
|
#ifdef NO_AES_NI
|
||||||
#include "algo/echo/aes_ni/hash_api.h"
|
#include "algo/groestl/sse2/grso.h"
|
||||||
|
#include "algo/groestl/sse2/grso-macro.c"
|
||||||
|
#else
|
||||||
#include "algo/groestl/aes_ni/hash-groestl.h"
|
#include "algo/groestl/aes_ni/hash-groestl.h"
|
||||||
|
#include "algo/echo/aes_ni/hash_api.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -83,7 +86,7 @@ void init_x17_ctx()
|
|||||||
|
|
||||||
static void x17hash(void *output, const void *input)
|
static void x17hash(void *output, const void *input)
|
||||||
{
|
{
|
||||||
unsigned char hash[128]; // uint32_t hashA[16], hashB[16];
|
unsigned char hash[128] __attribute__ ((aligned (32)));
|
||||||
#define hashB hash+64
|
#define hashB hash+64
|
||||||
|
|
||||||
x17_ctx_holder ctx;
|
x17_ctx_holder ctx;
|
||||||
@@ -119,8 +122,12 @@ static void x17hash(void *output, const void *input)
|
|||||||
//---groestl----
|
//---groestl----
|
||||||
|
|
||||||
#ifdef NO_AES_NI
|
#ifdef NO_AES_NI
|
||||||
sph_groestl512(&ctx.groestl, hash, 64);
|
grsoState sts_grs;
|
||||||
sph_groestl512_close(&ctx.groestl, hash);
|
GRS_I;
|
||||||
|
GRS_U;
|
||||||
|
GRS_C;
|
||||||
|
// sph_groestl512(&ctx.groestl, hash, 64);
|
||||||
|
// sph_groestl512_close(&ctx.groestl, hash);
|
||||||
#else
|
#else
|
||||||
update_groestl( &ctx.groestl, (char*)hash,512);
|
update_groestl( &ctx.groestl, (char*)hash,512);
|
||||||
final_groestl( &ctx.groestl, (char*)hash);
|
final_groestl( &ctx.groestl, (char*)hash);
|
||||||
|
17
algo/zr5.c
17
algo/zr5.c
@@ -35,7 +35,10 @@
|
|||||||
#include "algo/groestl/sph_groestl.h"
|
#include "algo/groestl/sph_groestl.h"
|
||||||
#include "algo/keccak/sph_keccak.h"
|
#include "algo/keccak/sph_keccak.h"
|
||||||
|
|
||||||
#ifndef NO_AES_NI
|
#ifdef NO_AES_NI
|
||||||
|
#include "algo/groestl/sse2/grso.h"
|
||||||
|
#include "algo/groestl/sse2/grso-macro.c"
|
||||||
|
#else
|
||||||
#include "algo/groestl/aes_ni/hash-groestl.h"
|
#include "algo/groestl/aes_ni/hash-groestl.h"
|
||||||
#include "algo/echo/aes_ni/hash_api.h"
|
#include "algo/echo/aes_ni/hash_api.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -83,7 +86,7 @@ static void zr5hash(void *state, const void *input)
|
|||||||
{
|
{
|
||||||
|
|
||||||
DATA_ALIGN16(unsigned char hashbuf[128]);
|
DATA_ALIGN16(unsigned char hashbuf[128]);
|
||||||
DATA_ALIGN16(unsigned char hash[128]);
|
unsigned char hash[128] __attribute__ ((aligned (32)));
|
||||||
DATA_ALIGN16(size_t hashptr);
|
DATA_ALIGN16(size_t hashptr);
|
||||||
DATA_ALIGN16(sph_u64 hashctA);
|
DATA_ALIGN16(sph_u64 hashctA);
|
||||||
DATA_ALIGN16(sph_u64 hashctB);
|
DATA_ALIGN16(sph_u64 hashctB);
|
||||||
@@ -121,8 +124,14 @@ static const int arrOrder[][4] =
|
|||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
#ifdef NO_AES_NI
|
#ifdef NO_AES_NI
|
||||||
sph_groestl512 (&ctx.groestl, hash, 64);
|
{
|
||||||
sph_groestl512_close(&ctx.groestl, hash);
|
grsoState sts_grs;
|
||||||
|
GRS_I;
|
||||||
|
GRS_U;
|
||||||
|
GRS_C;
|
||||||
|
}
|
||||||
|
// sph_groestl512 (&ctx.groestl, hash, 64);
|
||||||
|
// sph_groestl512_close(&ctx.groestl, hash);
|
||||||
#else
|
#else
|
||||||
update_groestl( &ctx.groestl, (char*)hash,512);
|
update_groestl( &ctx.groestl, (char*)hash,512);
|
||||||
final_groestl( &ctx.groestl, (char*)hash);
|
final_groestl( &ctx.groestl, (char*)hash);
|
||||||
|
2
build.sh
2
build.sh
@@ -20,6 +20,6 @@ rm -f config.status
|
|||||||
|
|
||||||
CFLAGS="-O3 -march=native -Wall" CXXFLAGS="$CFLAGS -std=gnu++11" ./configure --with-curl
|
CFLAGS="-O3 -march=native -Wall" CXXFLAGS="$CFLAGS -std=gnu++11" ./configure --with-curl
|
||||||
|
|
||||||
make -j 4
|
make
|
||||||
|
|
||||||
strip -s cpuminer
|
strip -s cpuminer
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
AC_INIT([cpuminer-opt], [3.5.9])
|
AC_INIT([cpuminer-opt], [3.5.9.1])
|
||||||
|
|
||||||
AC_PREREQ([2.59c])
|
AC_PREREQ([2.59c])
|
||||||
AC_CANONICAL_SYSTEM
|
AC_CANONICAL_SYSTEM
|
||||||
|
23
miner.h
23
miner.h
@@ -47,14 +47,14 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
#ifndef min
|
#ifndef min
|
||||||
#define min(a,b) (a>b ? (b) :(a))
|
#define min(a,b) (a>b ? (b) :(a))
|
||||||
#endif
|
#endif
|
||||||
#ifndef max
|
#ifndef max
|
||||||
#define max(a,b) (a<b ? (b) : (a))
|
#define max(a,b) (a<b ? (b) : (a))
|
||||||
#endif
|
#endif
|
||||||
|
*/
|
||||||
|
|
||||||
//#ifdef HAVE_ALLOCA_H
|
//#ifdef HAVE_ALLOCA_H
|
||||||
//# include <alloca.h>
|
//# include <alloca.h>
|
||||||
@@ -499,7 +499,7 @@ enum algos {
|
|||||||
ALGO_LYRA2RE,
|
ALGO_LYRA2RE,
|
||||||
ALGO_LYRA2REV2,
|
ALGO_LYRA2REV2,
|
||||||
ALGO_LYRA2Z,
|
ALGO_LYRA2Z,
|
||||||
ALGO_LYRA2ZOIN,
|
ALGO_LYRA2Z330,
|
||||||
ALGO_M7M,
|
ALGO_M7M,
|
||||||
ALGO_MYR_GR,
|
ALGO_MYR_GR,
|
||||||
ALGO_NEOSCRYPT,
|
ALGO_NEOSCRYPT,
|
||||||
@@ -511,6 +511,7 @@ enum algos {
|
|||||||
ALGO_SCRYPT,
|
ALGO_SCRYPT,
|
||||||
ALGO_SCRYPTJANE,
|
ALGO_SCRYPTJANE,
|
||||||
ALGO_SHA256D,
|
ALGO_SHA256D,
|
||||||
|
ALGO_SHA256T,
|
||||||
ALGO_SHAVITE3,
|
ALGO_SHAVITE3,
|
||||||
ALGO_SKEIN,
|
ALGO_SKEIN,
|
||||||
ALGO_SKEIN2,
|
ALGO_SKEIN2,
|
||||||
@@ -559,7 +560,7 @@ static const char* const algo_names[] = {
|
|||||||
"lyra2re",
|
"lyra2re",
|
||||||
"lyra2rev2",
|
"lyra2rev2",
|
||||||
"lyra2z",
|
"lyra2z",
|
||||||
"lyra2zoin",
|
"lyra2z330",
|
||||||
"m7m",
|
"m7m",
|
||||||
"myr-gr",
|
"myr-gr",
|
||||||
"neoscrypt",
|
"neoscrypt",
|
||||||
@@ -571,6 +572,7 @@ static const char* const algo_names[] = {
|
|||||||
"scrypt",
|
"scrypt",
|
||||||
"scryptjane",
|
"scryptjane",
|
||||||
"sha256d",
|
"sha256d",
|
||||||
|
"sha256t",
|
||||||
"shavite3",
|
"shavite3",
|
||||||
"skein",
|
"skein",
|
||||||
"skein2",
|
"skein2",
|
||||||
@@ -657,14 +659,14 @@ Options:\n\
|
|||||||
"/* blake2b Sia\n*/"\
|
"/* blake2b Sia\n*/"\
|
||||||
blake2s Blake-2 S\n\
|
blake2s Blake-2 S\n\
|
||||||
bmw BMW 256\n\
|
bmw BMW 256\n\
|
||||||
c11 Flax\n\
|
c11 Chaincoin\n\
|
||||||
cryptolight Cryptonight-light\n\
|
cryptolight Cryptonight-light\n\
|
||||||
cryptonight cryptonote, Monero (XMR)\n\
|
cryptonight cryptonote, Monero (XMR)\n\
|
||||||
decred\n\
|
decred\n\
|
||||||
deep Deepcoin (DCN)\n\
|
deep Deepcoin (DCN)\n\
|
||||||
drop Dropcoin\n\
|
drop Dropcoin\n\
|
||||||
fresh Fresh\n\
|
fresh Fresh\n\
|
||||||
groestl groestl\n\
|
groestl dmd-gr, Groestl coin\n\
|
||||||
heavy Heavy\n\
|
heavy Heavy\n\
|
||||||
hmq1725 Espers\n\
|
hmq1725 Espers\n\
|
||||||
hodl Hodlcoin\n\
|
hodl Hodlcoin\n\
|
||||||
@@ -672,9 +674,9 @@ Options:\n\
|
|||||||
lbry LBC, LBRY Credits\n\
|
lbry LBC, LBRY Credits\n\
|
||||||
luffa Luffa\n\
|
luffa Luffa\n\
|
||||||
lyra2re lyra2\n\
|
lyra2re lyra2\n\
|
||||||
lyra2rev2 lyrav2\n\
|
lyra2rev2 lyrav2, Vertcoin\n\
|
||||||
lyra2z Zcoin (XZC)\n\
|
lyra2z Zcoin (XZC)\n\
|
||||||
lyra2zoin Zoin (ZOI)\n\
|
lyra2z330 Zoin (ZOI)\n\
|
||||||
m7m Magi (XMG)\n\
|
m7m Magi (XMG)\n\
|
||||||
myr-gr Myriad-Groestl\n\
|
myr-gr Myriad-Groestl\n\
|
||||||
neoscrypt NeoScrypt(128, 2, 1)\n\
|
neoscrypt NeoScrypt(128, 2, 1)\n\
|
||||||
@@ -686,7 +688,8 @@ Options:\n\
|
|||||||
scrypt scrypt(1024, 1, 1) (default)\n\
|
scrypt scrypt(1024, 1, 1) (default)\n\
|
||||||
scrypt:N scrypt(N, 1, 1)\n\
|
scrypt:N scrypt(N, 1, 1)\n\
|
||||||
scryptjane:nf\n\
|
scryptjane:nf\n\
|
||||||
sha256d SHA-256d\n\
|
sha256d Double SHA-256\n\
|
||||||
|
sha256t Triple SHA-256, Onecoin (OC)\n\
|
||||||
shavite3 Shavite3\n\
|
shavite3 Shavite3\n\
|
||||||
skein Skein+Sha (Skeincoin)\n\
|
skein Skein+Sha (Skeincoin)\n\
|
||||||
skein2 Double Skein (Woodcoin)\n\
|
skein2 Double Skein (Woodcoin)\n\
|
||||||
@@ -695,7 +698,7 @@ Options:\n\
|
|||||||
veltor\n\
|
veltor\n\
|
||||||
whirlpool\n\
|
whirlpool\n\
|
||||||
whirlpoolx\n\
|
whirlpoolx\n\
|
||||||
x11 X11\n\
|
x11 Dash\n\
|
||||||
x11evo Revolvercoin\n\
|
x11evo Revolvercoin\n\
|
||||||
x11gost sib (SibCoin)\n\
|
x11gost sib (SibCoin)\n\
|
||||||
x13 X13\n\
|
x13 X13\n\
|
||||||
|
45
winbuild-allarch.sh
Executable file
45
winbuild-allarch.sh
Executable file
@@ -0,0 +1,45 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
make distclean || echo clean
|
||||||
|
rm -f config.status
|
||||||
|
./autogen.sh || echo done
|
||||||
|
CFLAGS="-O3 -march=core-avx2 -Wall" CXXFLAGS="$CFLAGS -std=gnu++11 -fpermissive" ./configure --with-curl
|
||||||
|
make -j 4
|
||||||
|
strip -s cpuminer.exe
|
||||||
|
mv cpuminer.exe cpuminer-aes-avx2.exe
|
||||||
|
|
||||||
|
make clean || echo clean
|
||||||
|
rm -f config.status
|
||||||
|
./autogen.sh || echo done
|
||||||
|
CFLAGS="-O3 -march=corei7-avx -Wall" CXXFLAGS="$CFLAGS -std=gnu++11 -fpermissive" ./configure --with-curl
|
||||||
|
make -j 4
|
||||||
|
strip -s cpuminer.exe
|
||||||
|
mv cpuminer.exe cpuminer-aes-avx.exe
|
||||||
|
|
||||||
|
make clean || echo clean
|
||||||
|
rm -f config.status
|
||||||
|
./autogen.sh || echo done
|
||||||
|
CFLAGS="-O3 -maes -msse4.2 -Wall" CXXFLAGS="$CFLAGS -std=gnu++11 -fpermissive" ./configure --with-curl
|
||||||
|
make -j 4
|
||||||
|
strip -s cpuminer.exe
|
||||||
|
mv cpuminer.exe cpuminer-aes-sse42.exe
|
||||||
|
|
||||||
|
make clean || echo clean
|
||||||
|
rm -f config.status
|
||||||
|
./autogen.sh || echo done
|
||||||
|
CFLAGS="-O3 -march=corei7 -Wall" CXXFLAGS="$CFLAGS -std=gnu++11 -fpermissive" ./configure --with-curl
|
||||||
|
make -j 4
|
||||||
|
strip -s cpuminer.exe
|
||||||
|
mv cpuminer.exe cpuminer-sse42.exe
|
||||||
|
|
||||||
|
make clean || echo clean
|
||||||
|
rm -f config.status
|
||||||
|
./autogen.sh || echo done
|
||||||
|
CFLAGS="-O3 -march=core2 -Wall" CXXFLAGS="$CFLAGS -std=gnu++11 -fpermissive" ./configure --with-curl
|
||||||
|
make -j 4
|
||||||
|
strip -s cpuminer.exe
|
||||||
|
mv cpuminer.exe cpuminer-sse2.exe
|
||||||
|
|
||||||
|
make clean || echo done
|
||||||
|
|
||||||
|
|
@@ -20,6 +20,6 @@ rm -f config.status
|
|||||||
|
|
||||||
CFLAGS="-O3 -march=native -Wall" CXXFLAGS="$CFLAGS -std=gnu++11 -fpermissive" ./configure --with-curl
|
CFLAGS="-O3 -march=native -Wall" CXXFLAGS="$CFLAGS -std=gnu++11 -fpermissive" ./configure --with-curl
|
||||||
|
|
||||||
make -j 4
|
make
|
||||||
|
|
||||||
strip -s cpuminer
|
strip -s cpuminer
|
||||||
|
Reference in New Issue
Block a user