mirror of
https://github.com/JayDDee/cpuminer-opt.git
synced 2025-09-17 23:44:27 +00:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
bfd1c002f9 | ||
![]() |
9edc650042 |
2
AUTHORS
2
AUTHORS
@@ -29,3 +29,5 @@ Wolf0
|
|||||||
Optiminer
|
Optiminer
|
||||||
|
|
||||||
Jay D Dee
|
Jay D Dee
|
||||||
|
|
||||||
|
xcouiz@gmail.com
|
||||||
|
@@ -59,7 +59,8 @@ Supported Algorithms
|
|||||||
bmw BMW 256
|
bmw BMW 256
|
||||||
c11 Chaincoin
|
c11 Chaincoin
|
||||||
cryptolight Cryptonight-light
|
cryptolight Cryptonight-light
|
||||||
cryptonight cryptonote, Monero (XMR)
|
cryptonight
|
||||||
|
cryptonightv7 Monero (XMR)
|
||||||
decred
|
decred
|
||||||
deep Deepcoin (DCN)
|
deep Deepcoin (DCN)
|
||||||
dmd-gr Diamond-Groestl
|
dmd-gr Diamond-Groestl
|
||||||
|
@@ -27,7 +27,8 @@ Changes in v3.8.4 may have improved compatibility with some of these CPUs.
|
|||||||
Exe name Compile flags Arch name
|
Exe name Compile flags Arch name
|
||||||
|
|
||||||
cpuminer-sse2.exe "-msse2" Core2, Nehalem
|
cpuminer-sse2.exe "-msse2" Core2, Nehalem
|
||||||
cpuminer-aes-sse42.exe "-maes -msse4.2" Westmere, Sandy-Ivybridge
|
cpuminer-aes-sse42.exe "-march=westmere" Westmere, Sandy-Ivybridge
|
||||||
|
cpuminer-avx.exe "-march=corei7-avx" Sandy-Ivybridge
|
||||||
cpuminer-avx2.exe "-march=core-avx2" Haswell, Sky-Kaby-Coffeelake
|
cpuminer-avx2.exe "-march=core-avx2" Haswell, Sky-Kaby-Coffeelake
|
||||||
cpuminer-avx2-sha.exe "-march=core-avx2 -msha" Ryzen
|
cpuminer-avx2-sha.exe "-march=core-avx2 -msha" Ryzen
|
||||||
|
|
||||||
|
@@ -50,8 +50,7 @@ will give a clue as to the missing package.
|
|||||||
The following command should install everything you need on Debian based
|
The following command should install everything you need on Debian based
|
||||||
distributions such as Ubuntu:
|
distributions such as Ubuntu:
|
||||||
|
|
||||||
sudo apt-get install build-essential libssl-dev libcurl4-openssl-dev libjansson-dev libgmp-dev automake
|
sudo apt-get install build-essential libssl-dev libcurl4-openssl-dev libjansson-dev libgmp-dev automake zlib1g-dev
|
||||||
|
|
||||||
|
|
||||||
build-essential (for Ubuntu, Development Tools package group on Fedora)
|
build-essential (for Ubuntu, Development Tools package group on Fedora)
|
||||||
automake
|
automake
|
||||||
@@ -86,7 +85,7 @@ make
|
|||||||
|
|
||||||
Additional optional compile flags, add the following to CFLAGS to activate:
|
Additional optional compile flags, add the following to CFLAGS to activate:
|
||||||
|
|
||||||
-DUSE_SPH_SHA
|
-DUSE_SPH_SHA (deprecated)
|
||||||
|
|
||||||
SPH may give slightly better performance on algos that use sha256 when using
|
SPH may give slightly better performance on algos that use sha256 when using
|
||||||
openssl 1.0.1 or older. Openssl 1.0.2 adds AVX2 and 1.1 adds SHA and perform
|
openssl 1.0.1 or older. Openssl 1.0.2 adds AVX2 and 1.1 adds SHA and perform
|
||||||
@@ -160,6 +159,21 @@ Support for even older x86_64 without AES_NI or SSE2 is not availble.
|
|||||||
Change Log
|
Change Log
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
v3.8.8.1
|
||||||
|
|
||||||
|
Fixed x16r.
|
||||||
|
Removed cryptonight variant check due to false positives.
|
||||||
|
API displays hashrate before shares are submitted.
|
||||||
|
|
||||||
|
v3.8.8
|
||||||
|
|
||||||
|
Added cryptonightv7 for Monero.
|
||||||
|
|
||||||
|
v3.8.7.2
|
||||||
|
|
||||||
|
Fixed argon2d-dyn regression in v3.8.7.1.
|
||||||
|
Changed compile options for aes-sse42 Windows build to -march=westmere
|
||||||
|
|
||||||
v3.8.7.1
|
v3.8.7.1
|
||||||
|
|
||||||
Fixed argon2d-uis low difficulty rejects.
|
Fixed argon2d-uis low difficulty rejects.
|
||||||
|
69
aclocal.m4
vendored
69
aclocal.m4
vendored
@@ -1,6 +1,6 @@
|
|||||||
# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
|
# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
|
||||||
|
|
||||||
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This file is free software; the Free Software Foundation
|
# This file is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
@@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to.
|
|||||||
If you have problems, you may need to regenerate the build system entirely.
|
If you have problems, you may need to regenerate the build system entirely.
|
||||||
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
|
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
|
||||||
|
|
||||||
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2002-2017 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is free software; the Free Software Foundation
|
# This file is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
@@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
|
|||||||
# generated from the m4 files accompanying Automake X.Y.
|
# generated from the m4 files accompanying Automake X.Y.
|
||||||
# (This private macro should not be called outside this file.)
|
# (This private macro should not be called outside this file.)
|
||||||
AC_DEFUN([AM_AUTOMAKE_VERSION],
|
AC_DEFUN([AM_AUTOMAKE_VERSION],
|
||||||
[am__api_version='1.14'
|
[am__api_version='1.15'
|
||||||
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
|
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
|
||||||
dnl require some minimum version. Point them to the right macro.
|
dnl require some minimum version. Point them to the right macro.
|
||||||
m4_if([$1], [1.14.1], [],
|
m4_if([$1], [1.15.1], [],
|
||||||
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
|
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
|
|||||||
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
|
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
|
||||||
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
|
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
|
||||||
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
|
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
|
||||||
[AM_AUTOMAKE_VERSION([1.14.1])dnl
|
[AM_AUTOMAKE_VERSION([1.15.1])dnl
|
||||||
m4_ifndef([AC_AUTOCONF_VERSION],
|
m4_ifndef([AC_AUTOCONF_VERSION],
|
||||||
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
|
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
|
||||||
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
|
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
|
||||||
|
|
||||||
# Figure out how to run the assembler. -*- Autoconf -*-
|
# Figure out how to run the assembler. -*- Autoconf -*-
|
||||||
|
|
||||||
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is free software; the Free Software Foundation
|
# This file is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
@@ -78,7 +78,7 @@ _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl
|
|||||||
|
|
||||||
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
|
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
|
||||||
|
|
||||||
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is free software; the Free Software Foundation
|
# This file is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
@@ -123,15 +123,14 @@ _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl
|
|||||||
# configured tree to be moved without reconfiguration.
|
# configured tree to be moved without reconfiguration.
|
||||||
|
|
||||||
AC_DEFUN([AM_AUX_DIR_EXPAND],
|
AC_DEFUN([AM_AUX_DIR_EXPAND],
|
||||||
[dnl Rely on autoconf to set up CDPATH properly.
|
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
|
||||||
AC_PREREQ([2.50])dnl
|
# Expand $ac_aux_dir to an absolute path.
|
||||||
# expand $ac_aux_dir to an absolute path
|
am_aux_dir=`cd "$ac_aux_dir" && pwd`
|
||||||
am_aux_dir=`cd $ac_aux_dir && pwd`
|
|
||||||
])
|
])
|
||||||
|
|
||||||
# AM_CONDITIONAL -*- Autoconf -*-
|
# AM_CONDITIONAL -*- Autoconf -*-
|
||||||
|
|
||||||
# Copyright (C) 1997-2013 Free Software Foundation, Inc.
|
# Copyright (C) 1997-2017 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is free software; the Free Software Foundation
|
# This file is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
@@ -162,7 +161,7 @@ AC_CONFIG_COMMANDS_PRE(
|
|||||||
Usually this means the macro was only invoked conditionally.]])
|
Usually this means the macro was only invoked conditionally.]])
|
||||||
fi])])
|
fi])])
|
||||||
|
|
||||||
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
|
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is free software; the Free Software Foundation
|
# This file is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
@@ -353,7 +352,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
|
|||||||
|
|
||||||
# Generate code to set up dependency tracking. -*- Autoconf -*-
|
# Generate code to set up dependency tracking. -*- Autoconf -*-
|
||||||
|
|
||||||
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
|
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is free software; the Free Software Foundation
|
# This file is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
@@ -429,7 +428,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
|
|||||||
|
|
||||||
# Do all the work for Automake. -*- Autoconf -*-
|
# Do all the work for Automake. -*- Autoconf -*-
|
||||||
|
|
||||||
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is free software; the Free Software Foundation
|
# This file is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
@@ -519,8 +518,8 @@ AC_REQUIRE([AC_PROG_MKDIR_P])dnl
|
|||||||
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
|
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
|
||||||
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
|
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
|
||||||
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
|
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
|
||||||
# We need awk for the "check" target. The system "awk" is bad on
|
# We need awk for the "check" target (and possibly the TAP driver). The
|
||||||
# some platforms.
|
# system "awk" is bad on some platforms.
|
||||||
AC_REQUIRE([AC_PROG_AWK])dnl
|
AC_REQUIRE([AC_PROG_AWK])dnl
|
||||||
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
|
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
|
||||||
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
|
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
|
||||||
@@ -593,7 +592,11 @@ to "yes", and re-run configure.
|
|||||||
END
|
END
|
||||||
AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
|
AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
|
||||||
fi
|
fi
|
||||||
fi])
|
fi
|
||||||
|
dnl The trailing newline in this macro's definition is deliberate, for
|
||||||
|
dnl backward compatibility and to allow trailing 'dnl'-style comments
|
||||||
|
dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
|
||||||
|
])
|
||||||
|
|
||||||
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
|
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
|
||||||
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
|
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
|
||||||
@@ -622,7 +625,7 @@ for _am_header in $config_headers :; do
|
|||||||
done
|
done
|
||||||
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
|
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
|
||||||
|
|
||||||
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is free software; the Free Software Foundation
|
# This file is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
@@ -633,7 +636,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co
|
|||||||
# Define $install_sh.
|
# Define $install_sh.
|
||||||
AC_DEFUN([AM_PROG_INSTALL_SH],
|
AC_DEFUN([AM_PROG_INSTALL_SH],
|
||||||
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||||
if test x"${install_sh}" != xset; then
|
if test x"${install_sh+set}" != xset; then
|
||||||
case $am_aux_dir in
|
case $am_aux_dir in
|
||||||
*\ * | *\ *)
|
*\ * | *\ *)
|
||||||
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
|
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
|
||||||
@@ -643,7 +646,7 @@ if test x"${install_sh}" != xset; then
|
|||||||
fi
|
fi
|
||||||
AC_SUBST([install_sh])])
|
AC_SUBST([install_sh])])
|
||||||
|
|
||||||
# Copyright (C) 2003-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2003-2017 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is free software; the Free Software Foundation
|
# This file is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
@@ -665,7 +668,7 @@ AC_SUBST([am__leading_dot])])
|
|||||||
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
|
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
|
||||||
# From Jim Meyering
|
# From Jim Meyering
|
||||||
|
|
||||||
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is free software; the Free Software Foundation
|
# This file is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
@@ -700,7 +703,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
|
|||||||
|
|
||||||
# Check to see how 'make' treats includes. -*- Autoconf -*-
|
# Check to see how 'make' treats includes. -*- Autoconf -*-
|
||||||
|
|
||||||
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is free software; the Free Software Foundation
|
# This file is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
@@ -750,7 +753,7 @@ rm -f confinc confmf
|
|||||||
|
|
||||||
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
|
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
|
||||||
|
|
||||||
# Copyright (C) 1997-2013 Free Software Foundation, Inc.
|
# Copyright (C) 1997-2017 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is free software; the Free Software Foundation
|
# This file is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
@@ -789,7 +792,7 @@ fi
|
|||||||
|
|
||||||
# Helper functions for option handling. -*- Autoconf -*-
|
# Helper functions for option handling. -*- Autoconf -*-
|
||||||
|
|
||||||
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is free software; the Free Software Foundation
|
# This file is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
@@ -818,7 +821,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
|
|||||||
AC_DEFUN([_AM_IF_OPTION],
|
AC_DEFUN([_AM_IF_OPTION],
|
||||||
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
|
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
|
||||||
|
|
||||||
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
|
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is free software; the Free Software Foundation
|
# This file is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
@@ -865,7 +868,7 @@ AC_LANG_POP([C])])
|
|||||||
# For backward compatibility.
|
# For backward compatibility.
|
||||||
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
|
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
|
||||||
|
|
||||||
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is free software; the Free Software Foundation
|
# This file is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
@@ -884,7 +887,7 @@ AC_DEFUN([AM_RUN_LOG],
|
|||||||
|
|
||||||
# Check to make sure that the build environment is sane. -*- Autoconf -*-
|
# Check to make sure that the build environment is sane. -*- Autoconf -*-
|
||||||
|
|
||||||
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is free software; the Free Software Foundation
|
# This file is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
@@ -965,7 +968,7 @@ AC_CONFIG_COMMANDS_PRE(
|
|||||||
rm -f conftest.file
|
rm -f conftest.file
|
||||||
])
|
])
|
||||||
|
|
||||||
# Copyright (C) 2009-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2009-2017 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is free software; the Free Software Foundation
|
# This file is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
@@ -1025,7 +1028,7 @@ AC_SUBST([AM_BACKSLASH])dnl
|
|||||||
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
|
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is free software; the Free Software Foundation
|
# This file is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
@@ -1053,7 +1056,7 @@ fi
|
|||||||
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
|
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
|
||||||
AC_SUBST([INSTALL_STRIP_PROGRAM])])
|
AC_SUBST([INSTALL_STRIP_PROGRAM])])
|
||||||
|
|
||||||
# Copyright (C) 2006-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2006-2017 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is free software; the Free Software Foundation
|
# This file is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
@@ -1072,7 +1075,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
|
|||||||
|
|
||||||
# Check how to create a tarball. -*- Autoconf -*-
|
# Check how to create a tarball. -*- Autoconf -*-
|
||||||
|
|
||||||
# Copyright (C) 2004-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2004-2017 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is free software; the Free Software Foundation
|
# This file is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
|
@@ -160,7 +160,7 @@ bool register_algo_gate( int algo, algo_gate_t *gate )
|
|||||||
case ALGO_ALLIUM: register_allium_algo ( gate ); break;
|
case ALGO_ALLIUM: register_allium_algo ( gate ); break;
|
||||||
case ALGO_ANIME: register_anime_algo ( gate ); break;
|
case ALGO_ANIME: register_anime_algo ( gate ); break;
|
||||||
case ALGO_ARGON2: register_argon2_algo ( gate ); break;
|
case ALGO_ARGON2: register_argon2_algo ( gate ); break;
|
||||||
case ALGO_ARGON2D250: register_argon2d_crds_algo( gate ); break;
|
case ALGO_ARGON2D250: register_argon2d_crds_algo ( gate ); break;
|
||||||
case ALGO_ARGON2D500: register_argon2d_dyn_algo ( gate ); break;
|
case ALGO_ARGON2D500: register_argon2d_dyn_algo ( gate ); break;
|
||||||
case ALGO_ARGON2D4096: register_argon2d4096_algo ( gate ); break;
|
case ALGO_ARGON2D4096: register_argon2d4096_algo ( gate ); break;
|
||||||
case ALGO_AXIOM: register_axiom_algo ( gate ); break;
|
case ALGO_AXIOM: register_axiom_algo ( gate ); break;
|
||||||
@@ -172,6 +172,7 @@ bool register_algo_gate( int algo, algo_gate_t *gate )
|
|||||||
case ALGO_C11: register_c11_algo ( gate ); break;
|
case ALGO_C11: register_c11_algo ( gate ); break;
|
||||||
case ALGO_CRYPTOLIGHT: register_cryptolight_algo ( gate ); break;
|
case ALGO_CRYPTOLIGHT: register_cryptolight_algo ( gate ); break;
|
||||||
case ALGO_CRYPTONIGHT: register_cryptonight_algo ( gate ); break;
|
case ALGO_CRYPTONIGHT: register_cryptonight_algo ( gate ); break;
|
||||||
|
case ALGO_CRYPTONIGHTV7:register_cryptonightv7_algo( gate ); break;
|
||||||
case ALGO_DECRED: register_decred_algo ( gate ); break;
|
case ALGO_DECRED: register_decred_algo ( gate ); break;
|
||||||
case ALGO_DEEP: register_deep_algo ( gate ); break;
|
case ALGO_DEEP: register_deep_algo ( gate ); break;
|
||||||
case ALGO_DMD_GR: register_dmd_gr_algo ( gate ); break;
|
case ALGO_DMD_GR: register_dmd_gr_algo ( gate ); break;
|
||||||
@@ -210,7 +211,7 @@ bool register_algo_gate( int algo, algo_gate_t *gate )
|
|||||||
case ALGO_SKEIN2: register_skein2_algo ( gate ); break;
|
case ALGO_SKEIN2: register_skein2_algo ( gate ); break;
|
||||||
case ALGO_SKUNK: register_skunk_algo ( gate ); break;
|
case ALGO_SKUNK: register_skunk_algo ( gate ); break;
|
||||||
case ALGO_TIMETRAVEL: register_timetravel_algo ( gate ); break;
|
case ALGO_TIMETRAVEL: register_timetravel_algo ( gate ); break;
|
||||||
case ALGO_TIMETRAVEL10: register_timetravel10_algo( gate ); break;
|
case ALGO_TIMETRAVEL10: register_timetravel10_algo ( gate ); break;
|
||||||
case ALGO_TRIBUS: register_tribus_algo ( gate ); break;
|
case ALGO_TRIBUS: register_tribus_algo ( gate ); break;
|
||||||
case ALGO_VANILLA: register_vanilla_algo ( gate ); break;
|
case ALGO_VANILLA: register_vanilla_algo ( gate ); break;
|
||||||
case ALGO_VELTOR: register_veltor_algo ( gate ); break;
|
case ALGO_VELTOR: register_veltor_algo ( gate ); break;
|
||||||
|
@@ -28,6 +28,7 @@ void argon2d_crds_hash( void *output, const void *input )
|
|||||||
context.lanes = 4; // Degree of Parallelism
|
context.lanes = 4; // Degree of Parallelism
|
||||||
context.threads = 1; // Threads
|
context.threads = 1; // Threads
|
||||||
context.t_cost = 1; // Iterations
|
context.t_cost = 1; // Iterations
|
||||||
|
context.version = ARGON2_VERSION_10;
|
||||||
|
|
||||||
argon2_ctx( &context, Argon2_d );
|
argon2_ctx( &context, Argon2_d );
|
||||||
}
|
}
|
||||||
@@ -71,7 +72,6 @@ bool register_argon2d_crds_algo( algo_gate_t* gate )
|
|||||||
gate->hash = (void*)&argon2d_crds_hash;
|
gate->hash = (void*)&argon2d_crds_hash;
|
||||||
gate->set_target = (void*)&scrypt_set_target;
|
gate->set_target = (void*)&scrypt_set_target;
|
||||||
gate->optimizations = SSE2_OPT | AVX2_OPT | AVX512_OPT;
|
gate->optimizations = SSE2_OPT | AVX2_OPT | AVX512_OPT;
|
||||||
ARGON2_VERSION_NUMBER = ARGON2_VERSION_10;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,6 +98,7 @@ void argon2d_dyn_hash( void *output, const void *input )
|
|||||||
context.lanes = 8; // Degree of Parallelism
|
context.lanes = 8; // Degree of Parallelism
|
||||||
context.threads = 1; // Threads
|
context.threads = 1; // Threads
|
||||||
context.t_cost = 2; // Iterations
|
context.t_cost = 2; // Iterations
|
||||||
|
context.version = ARGON2_VERSION_10;
|
||||||
|
|
||||||
argon2_ctx( &context, Argon2_d );
|
argon2_ctx( &context, Argon2_d );
|
||||||
}
|
}
|
||||||
@@ -141,10 +142,11 @@ bool register_argon2d_dyn_algo( algo_gate_t* gate )
|
|||||||
gate->hash = (void*)&argon2d_dyn_hash;
|
gate->hash = (void*)&argon2d_dyn_hash;
|
||||||
gate->set_target = (void*)&scrypt_set_target;
|
gate->set_target = (void*)&scrypt_set_target;
|
||||||
gate->optimizations = SSE2_OPT | AVX2_OPT | AVX512_OPT;
|
gate->optimizations = SSE2_OPT | AVX2_OPT | AVX512_OPT;
|
||||||
ARGON2_VERSION_NUMBER = ARGON2_VERSION_10;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Unitus
|
||||||
|
|
||||||
int scanhash_argon2d4096( int thr_id, struct work *work, uint32_t max_nonce,
|
int scanhash_argon2d4096( int thr_id, struct work *work, uint32_t max_nonce,
|
||||||
uint64_t *hashes_done)
|
uint64_t *hashes_done)
|
||||||
{
|
{
|
||||||
@@ -166,7 +168,7 @@ int scanhash_argon2d4096( int thr_id, struct work *work, uint32_t max_nonce,
|
|||||||
do {
|
do {
|
||||||
be32enc( &endiandata[19], n );
|
be32enc( &endiandata[19], n );
|
||||||
argon2d_hash_raw( t_cost, m_cost, parallelism, (char*) endiandata, 80,
|
argon2d_hash_raw( t_cost, m_cost, parallelism, (char*) endiandata, 80,
|
||||||
(char*) endiandata, 80, (char*) vhash, 32 );
|
(char*) endiandata, 80, (char*) vhash, 32, ARGON2_VERSION_13 );
|
||||||
if ( vhash[7] < Htarg && fulltest( vhash, ptarget ) )
|
if ( vhash[7] < Htarg && fulltest( vhash, ptarget ) )
|
||||||
{
|
{
|
||||||
*hashes_done = n - first_nonce + 1;
|
*hashes_done = n - first_nonce + 1;
|
||||||
@@ -191,7 +193,6 @@ bool register_argon2d4096_algo( algo_gate_t* gate )
|
|||||||
gate->set_target = (void*)&scrypt_set_target;
|
gate->set_target = (void*)&scrypt_set_target;
|
||||||
gate->get_max64 = (void*)&get_max64_0x1ff;
|
gate->get_max64 = (void*)&get_max64_0x1ff;
|
||||||
gate->optimizations = SSE2_OPT | AVX2_OPT | AVX512_OPT;
|
gate->optimizations = SSE2_OPT | AVX2_OPT | AVX512_OPT;
|
||||||
ARGON2_VERSION_NUMBER = ARGON2_VERSION_13;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
#include "algo-gate-api.h"
|
#include "algo-gate-api.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
// Credits
|
// Credits: version = 0x10, m_cost = 250.
|
||||||
bool register_argon2d_crds_algo( algo_gate_t* gate );
|
bool register_argon2d_crds_algo( algo_gate_t* gate );
|
||||||
|
|
||||||
void argon2d_crds_hash( void *state, const void *input );
|
void argon2d_crds_hash( void *state, const void *input );
|
||||||
@@ -12,7 +12,7 @@ void argon2d_crds_hash( void *state, const void *input );
|
|||||||
int scanhash_argon2d_crds( int thr_id, struct work *work, uint32_t max_nonce,
|
int scanhash_argon2d_crds( int thr_id, struct work *work, uint32_t max_nonce,
|
||||||
uint64_t *hashes_done );
|
uint64_t *hashes_done );
|
||||||
|
|
||||||
// Dynamic
|
// Dynamic: version = 0x10, m_cost = 500.
|
||||||
bool register_argon2d_dyn_algo( algo_gate_t* gate );
|
bool register_argon2d_dyn_algo( algo_gate_t* gate );
|
||||||
|
|
||||||
void argon2d_dyn_hash( void *state, const void *input );
|
void argon2d_dyn_hash( void *state, const void *input );
|
||||||
@@ -21,5 +21,11 @@ int scanhash_argon2d_dyn( int thr_id, struct work *work, uint32_t max_nonce,
|
|||||||
uint64_t *hashes_done );
|
uint64_t *hashes_done );
|
||||||
|
|
||||||
|
|
||||||
|
// Unitus: version = 0x13, m_cost = 4096.
|
||||||
|
bool register_argon2d4096_algo( algo_gate_t* gate );
|
||||||
|
|
||||||
|
int scanhash_argon2d4096( int thr_id, struct work *work, uint32_t max_nonce,
|
||||||
|
uint64_t *hashes_done );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -180,60 +180,65 @@ int argon2i_hash_encoded(const uint32_t t_cost, const uint32_t m_cost,
|
|||||||
const uint32_t parallelism, const void *pwd,
|
const uint32_t parallelism, const void *pwd,
|
||||||
const size_t pwdlen, const void *salt,
|
const size_t pwdlen, const void *salt,
|
||||||
const size_t saltlen, const size_t hashlen,
|
const size_t saltlen, const size_t hashlen,
|
||||||
char *encoded, const size_t encodedlen) {
|
char *encoded, const size_t encodedlen,
|
||||||
|
const uint32_t version) {
|
||||||
|
|
||||||
return argon2_hash(t_cost, m_cost, parallelism, pwd, pwdlen, salt, saltlen,
|
return argon2_hash(t_cost, m_cost, parallelism, pwd, pwdlen, salt, saltlen,
|
||||||
NULL, hashlen, encoded, encodedlen, Argon2_i,
|
NULL, hashlen, encoded, encodedlen, Argon2_i,
|
||||||
ARGON2_VERSION_NUMBER);
|
version );
|
||||||
}
|
}
|
||||||
|
|
||||||
int argon2i_hash_raw(const uint32_t t_cost, const uint32_t m_cost,
|
int argon2i_hash_raw(const uint32_t t_cost, const uint32_t m_cost,
|
||||||
const uint32_t parallelism, const void *pwd,
|
const uint32_t parallelism, const void *pwd,
|
||||||
const size_t pwdlen, const void *salt,
|
const size_t pwdlen, const void *salt,
|
||||||
const size_t saltlen, void *hash, const size_t hashlen) {
|
const size_t saltlen, void *hash, const size_t hashlen,
|
||||||
|
const uint32_t version ) {
|
||||||
|
|
||||||
return argon2_hash(t_cost, m_cost, parallelism, pwd, pwdlen, salt, saltlen,
|
return argon2_hash(t_cost, m_cost, parallelism, pwd, pwdlen, salt, saltlen,
|
||||||
hash, hashlen, NULL, 0, Argon2_i, ARGON2_VERSION_NUMBER);
|
hash, hashlen, NULL, 0, Argon2_i, version );
|
||||||
}
|
}
|
||||||
|
|
||||||
int argon2d_hash_encoded(const uint32_t t_cost, const uint32_t m_cost,
|
int argon2d_hash_encoded(const uint32_t t_cost, const uint32_t m_cost,
|
||||||
const uint32_t parallelism, const void *pwd,
|
const uint32_t parallelism, const void *pwd,
|
||||||
const size_t pwdlen, const void *salt,
|
const size_t pwdlen, const void *salt,
|
||||||
const size_t saltlen, const size_t hashlen,
|
const size_t saltlen, const size_t hashlen,
|
||||||
char *encoded, const size_t encodedlen) {
|
char *encoded, const size_t encodedlen,
|
||||||
|
const uint32_t version ) {
|
||||||
|
|
||||||
return argon2_hash(t_cost, m_cost, parallelism, pwd, pwdlen, salt, saltlen,
|
return argon2_hash(t_cost, m_cost, parallelism, pwd, pwdlen, salt, saltlen,
|
||||||
NULL, hashlen, encoded, encodedlen, Argon2_d,
|
NULL, hashlen, encoded, encodedlen, Argon2_d,
|
||||||
ARGON2_VERSION_NUMBER);
|
version );
|
||||||
}
|
}
|
||||||
|
|
||||||
int argon2d_hash_raw(const uint32_t t_cost, const uint32_t m_cost,
|
int argon2d_hash_raw(const uint32_t t_cost, const uint32_t m_cost,
|
||||||
const uint32_t parallelism, const void *pwd,
|
const uint32_t parallelism, const void *pwd,
|
||||||
const size_t pwdlen, const void *salt,
|
const size_t pwdlen, const void *salt,
|
||||||
const size_t saltlen, void *hash, const size_t hashlen) {
|
const size_t saltlen, void *hash, const size_t hashlen,
|
||||||
|
const uint32_t version ) {
|
||||||
|
|
||||||
return argon2_hash(t_cost, m_cost, parallelism, pwd, pwdlen, salt, saltlen,
|
return argon2_hash(t_cost, m_cost, parallelism, pwd, pwdlen, salt, saltlen,
|
||||||
hash, hashlen, NULL, 0, Argon2_d, ARGON2_VERSION_NUMBER);
|
hash, hashlen, NULL, 0, Argon2_d, version );
|
||||||
}
|
}
|
||||||
|
|
||||||
int argon2id_hash_encoded(const uint32_t t_cost, const uint32_t m_cost,
|
int argon2id_hash_encoded(const uint32_t t_cost, const uint32_t m_cost,
|
||||||
const uint32_t parallelism, const void *pwd,
|
const uint32_t parallelism, const void *pwd,
|
||||||
const size_t pwdlen, const void *salt,
|
const size_t pwdlen, const void *salt,
|
||||||
const size_t saltlen, const size_t hashlen,
|
const size_t saltlen, const size_t hashlen,
|
||||||
char *encoded, const size_t encodedlen) {
|
char *encoded, const size_t encodedlen,
|
||||||
|
const uint32_t version ) {
|
||||||
|
|
||||||
return argon2_hash(t_cost, m_cost, parallelism, pwd, pwdlen, salt, saltlen,
|
return argon2_hash(t_cost, m_cost, parallelism, pwd, pwdlen, salt, saltlen,
|
||||||
NULL, hashlen, encoded, encodedlen, Argon2_id,
|
NULL, hashlen, encoded, encodedlen, Argon2_id,
|
||||||
ARGON2_VERSION_NUMBER);
|
version);
|
||||||
}
|
}
|
||||||
|
|
||||||
int argon2id_hash_raw(const uint32_t t_cost, const uint32_t m_cost,
|
int argon2id_hash_raw(const uint32_t t_cost, const uint32_t m_cost,
|
||||||
const uint32_t parallelism, const void *pwd,
|
const uint32_t parallelism, const void *pwd,
|
||||||
const size_t pwdlen, const void *salt,
|
const size_t pwdlen, const void *salt,
|
||||||
const size_t saltlen, void *hash, const size_t hashlen) {
|
const size_t saltlen, void *hash, const size_t hashlen,
|
||||||
|
const uint32_t version ) {
|
||||||
return argon2_hash(t_cost, m_cost, parallelism, pwd, pwdlen, salt, saltlen,
|
return argon2_hash(t_cost, m_cost, parallelism, pwd, pwdlen, salt, saltlen,
|
||||||
hash, hashlen, NULL, 0, Argon2_id,
|
hash, hashlen, NULL, 0, Argon2_id, version );
|
||||||
ARGON2_VERSION_NUMBER);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int argon2_compare(const uint8_t *b1, const uint8_t *b2, size_t len) {
|
static int argon2_compare(const uint8_t *b1, const uint8_t *b2, size_t len) {
|
||||||
@@ -443,10 +448,11 @@ const char *argon2_error_message(int error_code) {
|
|||||||
return "Unknown error code";
|
return "Unknown error code";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
size_t argon2_encodedlen(uint32_t t_cost, uint32_t m_cost, uint32_t parallelism,
|
size_t argon2_encodedlen(uint32_t t_cost, uint32_t m_cost, uint32_t parallelism,
|
||||||
uint32_t saltlen, uint32_t hashlen, argon2_type type) {
|
uint32_t saltlen, uint32_t hashlen, argon2_type type) {
|
||||||
return strlen("$$v=$m=,t=,p=$$") + strlen(argon2_type2string(type, 0)) +
|
return strlen("$$v=$m=,t=,p=$$") + strlen(argon2_type2string(type, 0)) +
|
||||||
numlen(t_cost) + numlen(m_cost) + numlen(parallelism) +
|
numlen(t_cost) + numlen(m_cost) + numlen(parallelism) +
|
||||||
b64len(saltlen) + b64len(hashlen) + numlen(ARGON2_VERSION_NUMBER) + 1;
|
b64len(saltlen) + b64len(hashlen) + numlen(ARGON2_VERSION_NUMBER) + 1;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
@@ -224,22 +224,9 @@ typedef enum Argon2_type {
|
|||||||
Argon2_id = 2
|
Argon2_id = 2
|
||||||
} argon2_type;
|
} argon2_type;
|
||||||
|
|
||||||
// Version implementation sucks, needs to be changed.
|
|
||||||
// It should be set in the ctx before calling the argon2_ctx.
|
|
||||||
// It should be a function arg of *hash_raw & *hash_encoded.
|
|
||||||
// Then remove initialization from gate register function.
|
|
||||||
/* Version of the algorithm */
|
/* Version of the algorithm */
|
||||||
/*
|
|
||||||
typedef enum Argon2_version {
|
|
||||||
ARGON2_VERSION_10 = 0x10,
|
|
||||||
ARGON2_VERSION_13 = 0x13,
|
|
||||||
ARGON2_VERSION_NUMBER = ARGON2_VERSION_10
|
|
||||||
} argon2_version;
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define ARGON2_VERSION_10 0x10
|
#define ARGON2_VERSION_10 0x10
|
||||||
#define ARGON2_VERSION_13 0x13
|
#define ARGON2_VERSION_13 0x13
|
||||||
uint32_t ARGON2_VERSION_NUMBER;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Function that gives the string representation of an argon2_type.
|
* Function that gives the string representation of an argon2_type.
|
||||||
@@ -277,7 +264,8 @@ ARGON2_PUBLIC int argon2i_hash_encoded(const uint32_t t_cost,
|
|||||||
const void *pwd, const size_t pwdlen,
|
const void *pwd, const size_t pwdlen,
|
||||||
const void *salt, const size_t saltlen,
|
const void *salt, const size_t saltlen,
|
||||||
const size_t hashlen, char *encoded,
|
const size_t hashlen, char *encoded,
|
||||||
const size_t encodedlen);
|
const size_t encodedlen,
|
||||||
|
const uint32_t version );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hashes a password with Argon2i, producing a raw hash at @hash
|
* Hashes a password with Argon2i, producing a raw hash at @hash
|
||||||
@@ -297,7 +285,8 @@ ARGON2_PUBLIC int argon2i_hash_raw(const uint32_t t_cost, const uint32_t m_cost,
|
|||||||
const uint32_t parallelism, const void *pwd,
|
const uint32_t parallelism, const void *pwd,
|
||||||
const size_t pwdlen, const void *salt,
|
const size_t pwdlen, const void *salt,
|
||||||
const size_t saltlen, void *hash,
|
const size_t saltlen, void *hash,
|
||||||
const size_t hashlen);
|
const size_t hashlen,
|
||||||
|
const uint32_t version );
|
||||||
|
|
||||||
ARGON2_PUBLIC int argon2d_hash_encoded(const uint32_t t_cost,
|
ARGON2_PUBLIC int argon2d_hash_encoded(const uint32_t t_cost,
|
||||||
const uint32_t m_cost,
|
const uint32_t m_cost,
|
||||||
@@ -305,13 +294,15 @@ ARGON2_PUBLIC int argon2d_hash_encoded(const uint32_t t_cost,
|
|||||||
const void *pwd, const size_t pwdlen,
|
const void *pwd, const size_t pwdlen,
|
||||||
const void *salt, const size_t saltlen,
|
const void *salt, const size_t saltlen,
|
||||||
const size_t hashlen, char *encoded,
|
const size_t hashlen, char *encoded,
|
||||||
const size_t encodedlen);
|
const size_t encodedlen,
|
||||||
|
const uint32_t version );
|
||||||
|
|
||||||
ARGON2_PUBLIC int argon2d_hash_raw(const uint32_t t_cost, const uint32_t m_cost,
|
ARGON2_PUBLIC int argon2d_hash_raw(const uint32_t t_cost, const uint32_t m_cost,
|
||||||
const uint32_t parallelism, const void *pwd,
|
const uint32_t parallelism, const void *pwd,
|
||||||
const size_t pwdlen, const void *salt,
|
const size_t pwdlen, const void *salt,
|
||||||
const size_t saltlen, void *hash,
|
const size_t saltlen, void *hash,
|
||||||
const size_t hashlen);
|
const size_t hashlen,
|
||||||
|
const uint32_t version );
|
||||||
|
|
||||||
ARGON2_PUBLIC int argon2id_hash_encoded(const uint32_t t_cost,
|
ARGON2_PUBLIC int argon2id_hash_encoded(const uint32_t t_cost,
|
||||||
const uint32_t m_cost,
|
const uint32_t m_cost,
|
||||||
@@ -319,14 +310,16 @@ ARGON2_PUBLIC int argon2id_hash_encoded(const uint32_t t_cost,
|
|||||||
const void *pwd, const size_t pwdlen,
|
const void *pwd, const size_t pwdlen,
|
||||||
const void *salt, const size_t saltlen,
|
const void *salt, const size_t saltlen,
|
||||||
const size_t hashlen, char *encoded,
|
const size_t hashlen, char *encoded,
|
||||||
const size_t encodedlen);
|
const size_t encodedlen,
|
||||||
|
const uint32_t version );
|
||||||
|
|
||||||
ARGON2_PUBLIC int argon2id_hash_raw(const uint32_t t_cost,
|
ARGON2_PUBLIC int argon2id_hash_raw(const uint32_t t_cost,
|
||||||
const uint32_t m_cost,
|
const uint32_t m_cost,
|
||||||
const uint32_t parallelism, const void *pwd,
|
const uint32_t parallelism, const void *pwd,
|
||||||
const size_t pwdlen, const void *salt,
|
const size_t pwdlen, const void *salt,
|
||||||
const size_t saltlen, void *hash,
|
const size_t saltlen, void *hash,
|
||||||
const size_t hashlen);
|
const size_t hashlen,
|
||||||
|
const uint32_t version );
|
||||||
|
|
||||||
/* generic function underlying the above ones */
|
/* generic function underlying the above ones */
|
||||||
ARGON2_PUBLIC int argon2_hash(const uint32_t t_cost, const uint32_t m_cost,
|
ARGON2_PUBLIC int argon2_hash(const uint32_t t_cost, const uint32_t m_cost,
|
||||||
@@ -335,7 +328,7 @@ ARGON2_PUBLIC int argon2_hash(const uint32_t t_cost, const uint32_t m_cost,
|
|||||||
const size_t saltlen, void *hash,
|
const size_t saltlen, void *hash,
|
||||||
const size_t hashlen, char *encoded,
|
const size_t hashlen, char *encoded,
|
||||||
const size_t encodedlen, argon2_type type,
|
const size_t encodedlen, argon2_type type,
|
||||||
const uint32_t version);
|
const uint32_t version );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verifies a password against an encoded string
|
* Verifies a password against an encoded string
|
||||||
|
@@ -544,7 +544,8 @@ void initial_hash(uint8_t *blockhash, argon2_context *context,
|
|||||||
store32(&value, context->t_cost);
|
store32(&value, context->t_cost);
|
||||||
blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value));
|
blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value));
|
||||||
|
|
||||||
store32(&value, ARGON2_VERSION_NUMBER);
|
// store32(&value, ARGON2_VERSION_NUMBER);
|
||||||
|
store32(&value, context->version);
|
||||||
blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value));
|
blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value));
|
||||||
|
|
||||||
store32(&value, (uint32_t)type);
|
store32(&value, (uint32_t)type);
|
||||||
|
@@ -325,7 +325,7 @@ int scanhash_cryptolight(int thr_id, struct work *work,
|
|||||||
|
|
||||||
struct cryptonight_ctx *ctx = (struct cryptonight_ctx*)malloc(sizeof(struct cryptonight_ctx));
|
struct cryptonight_ctx *ctx = (struct cryptonight_ctx*)malloc(sizeof(struct cryptonight_ctx));
|
||||||
|
|
||||||
#ifndef NO_AES_NI
|
#if defined(__AES__)
|
||||||
do {
|
do {
|
||||||
*nonceptr = ++n;
|
*nonceptr = ++n;
|
||||||
cryptolight_hash_ctx_aes_ni(hash, pdata, 76, ctx);
|
cryptolight_hash_ctx_aes_ni(hash, pdata, 76, ctx);
|
||||||
|
@@ -1,14 +1,11 @@
|
|||||||
|
#if defined(__AES__)
|
||||||
|
|
||||||
#include <x86intrin.h>
|
#include <x86intrin.h>
|
||||||
#include <memory.h>
|
#include <memory.h>
|
||||||
#include "cryptonight.h"
|
#include "cryptonight.h"
|
||||||
#include "miner.h"
|
#include "miner.h"
|
||||||
#include "crypto/c_keccak.h"
|
#include "crypto/c_keccak.h"
|
||||||
#include <immintrin.h>
|
#include <immintrin.h>
|
||||||
//#include "avxdefs.h"
|
|
||||||
|
|
||||||
void aesni_parallel_noxor(uint8_t *long_state, uint8_t *text, uint8_t *ExpandedKey);
|
|
||||||
void aesni_parallel_xor(uint8_t *text, uint8_t *ExpandedKey, uint8_t *long_state);
|
|
||||||
void that_fucking_loop(uint8_t a[16], uint8_t b[16], uint8_t *long_state);
|
|
||||||
|
|
||||||
static inline void ExpandAESKey256_sub1(__m128i *tmp1, __m128i *tmp2)
|
static inline void ExpandAESKey256_sub1(__m128i *tmp1, __m128i *tmp2)
|
||||||
{
|
{
|
||||||
@@ -25,7 +22,6 @@ static inline void ExpandAESKey256_sub1(__m128i *tmp1, __m128i *tmp2)
|
|||||||
|
|
||||||
static inline void ExpandAESKey256_sub2(__m128i *tmp1, __m128i *tmp3)
|
static inline void ExpandAESKey256_sub2(__m128i *tmp1, __m128i *tmp3)
|
||||||
{
|
{
|
||||||
#ifndef NO_AES_NI
|
|
||||||
__m128i tmp2, tmp4;
|
__m128i tmp2, tmp4;
|
||||||
|
|
||||||
tmp4 = _mm_aeskeygenassist_si128(*tmp1, 0x00);
|
tmp4 = _mm_aeskeygenassist_si128(*tmp1, 0x00);
|
||||||
@@ -37,14 +33,12 @@ static inline void ExpandAESKey256_sub2(__m128i *tmp1, __m128i *tmp3)
|
|||||||
tmp4 = _mm_slli_si128(tmp4, 0x04);
|
tmp4 = _mm_slli_si128(tmp4, 0x04);
|
||||||
*tmp3 = _mm_xor_si128(*tmp3, tmp4);
|
*tmp3 = _mm_xor_si128(*tmp3, tmp4);
|
||||||
*tmp3 = _mm_xor_si128(*tmp3, tmp2);
|
*tmp3 = _mm_xor_si128(*tmp3, tmp2);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Special thanks to Intel for helping me
|
// Special thanks to Intel for helping me
|
||||||
// with ExpandAESKey256() and its subroutines
|
// with ExpandAESKey256() and its subroutines
|
||||||
static inline void ExpandAESKey256(char *keybuf)
|
static inline void ExpandAESKey256(char *keybuf)
|
||||||
{
|
{
|
||||||
#ifndef NO_AES_NI
|
|
||||||
__m128i tmp1, tmp2, tmp3, *keys;
|
__m128i tmp1, tmp2, tmp3, *keys;
|
||||||
|
|
||||||
keys = (__m128i *)keybuf;
|
keys = (__m128i *)keybuf;
|
||||||
@@ -91,7 +85,6 @@ static inline void ExpandAESKey256(char *keybuf)
|
|||||||
tmp2 = _mm_aeskeygenassist_si128(tmp3, 0x40);
|
tmp2 = _mm_aeskeygenassist_si128(tmp3, 0x40);
|
||||||
ExpandAESKey256_sub1(&tmp1, &tmp2);
|
ExpandAESKey256_sub1(&tmp1, &tmp2);
|
||||||
keys[14] = tmp1;
|
keys[14] = tmp1;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// align to 64 byte cache line
|
// align to 64 byte cache line
|
||||||
@@ -109,13 +102,19 @@ static __thread cryptonight_ctx ctx;
|
|||||||
|
|
||||||
void cryptonight_hash_aes( void *restrict output, const void *input, int len )
|
void cryptonight_hash_aes( void *restrict output, const void *input, int len )
|
||||||
{
|
{
|
||||||
#ifndef NO_AES_NI
|
|
||||||
|
|
||||||
uint8_t ExpandedKey[256] __attribute__((aligned(64)));
|
uint8_t ExpandedKey[256] __attribute__((aligned(64)));
|
||||||
__m128i *longoutput, *expkey, *xmminput;
|
__m128i *longoutput, *expkey, *xmminput;
|
||||||
size_t i, j;
|
size_t i, j;
|
||||||
|
|
||||||
keccak( (const uint8_t*)input, 76, (char*)&ctx.state.hs.b, 200 );
|
keccak( (const uint8_t*)input, 76, (char*)&ctx.state.hs.b, 200 );
|
||||||
|
|
||||||
|
if ( cryptonightV7 && len < 43 )
|
||||||
|
return;
|
||||||
|
|
||||||
|
const uint64_t tweak = cryptonightV7
|
||||||
|
? *((const uint64_t*) (((const uint8_t*)input) + 35))
|
||||||
|
^ ctx.state.hs.w[24] : 0;
|
||||||
|
|
||||||
memcpy( ExpandedKey, ctx.state.hs.b, AES_KEY_SIZE );
|
memcpy( ExpandedKey, ctx.state.hs.b, AES_KEY_SIZE );
|
||||||
ExpandAESKey256( ExpandedKey );
|
ExpandAESKey256( ExpandedKey );
|
||||||
memcpy( ctx.text, ctx.state.init, INIT_SIZE_BYTE );
|
memcpy( ctx.text, ctx.state.init, INIT_SIZE_BYTE );
|
||||||
@@ -215,6 +214,14 @@ void cryptonight_hash_aes( void *restrict output, const void *input, int len )
|
|||||||
b_x = _mm_xor_si128( b_x, c_x );
|
b_x = _mm_xor_si128( b_x, c_x );
|
||||||
nextblock = (uint64_t *)&ctx.long_state[c[0] & 0x1FFFF0];
|
nextblock = (uint64_t *)&ctx.long_state[c[0] & 0x1FFFF0];
|
||||||
_mm_store_si128( lsa, b_x );
|
_mm_store_si128( lsa, b_x );
|
||||||
|
|
||||||
|
if ( cryptonightV7 )
|
||||||
|
{
|
||||||
|
const uint8_t tmp = ( (const uint8_t*)(lsa) )[11];
|
||||||
|
const uint8_t index = ( ( (tmp >> 3) & 6 ) | (tmp & 1) ) << 1;
|
||||||
|
((uint8_t*)(lsa))[11] = tmp ^ ( ( 0x75310 >> index) & 0x30 );
|
||||||
|
}
|
||||||
|
|
||||||
b[0] = nextblock[0];
|
b[0] = nextblock[0];
|
||||||
b[1] = nextblock[1];
|
b[1] = nextblock[1];
|
||||||
|
|
||||||
@@ -227,10 +234,14 @@ void cryptonight_hash_aes( void *restrict output, const void *input, int len )
|
|||||||
: "cc" );
|
: "cc" );
|
||||||
|
|
||||||
b_x = c_x;
|
b_x = c_x;
|
||||||
nextblock[0] = a[0] + hi;
|
|
||||||
nextblock[1] = a[1] + lo;
|
a[0] += hi;
|
||||||
a[0] = b[0] ^ nextblock[0];
|
a[1] += lo;
|
||||||
a[1] = b[1] ^ nextblock[1];
|
nextblock[0] = a[0];
|
||||||
|
nextblock[1] = cryptonightV7 ? a[1] ^ tweak : a[1];
|
||||||
|
a[0] ^= b[0];
|
||||||
|
a[1] ^= b[1];
|
||||||
|
|
||||||
lsa = (__m128i*)&ctx.long_state[ a[0] & 0x1FFFF0 ];
|
lsa = (__m128i*)&ctx.long_state[ a[0] & 0x1FFFF0 ];
|
||||||
a_x = _mm_load_si128( (__m128i*)a );
|
a_x = _mm_load_si128( (__m128i*)a );
|
||||||
c_x = _mm_load_si128( lsa );
|
c_x = _mm_load_si128( lsa );
|
||||||
@@ -241,6 +252,14 @@ void cryptonight_hash_aes( void *restrict output, const void *input, int len )
|
|||||||
b_x = _mm_xor_si128( b_x, c_x );
|
b_x = _mm_xor_si128( b_x, c_x );
|
||||||
nextblock = (uint64_t *)&ctx.long_state[c[0] & 0x1FFFF0];
|
nextblock = (uint64_t *)&ctx.long_state[c[0] & 0x1FFFF0];
|
||||||
_mm_store_si128( lsa, b_x );
|
_mm_store_si128( lsa, b_x );
|
||||||
|
|
||||||
|
if ( cryptonightV7 )
|
||||||
|
{
|
||||||
|
const uint8_t tmp = ( (const uint8_t*)(lsa) )[11];
|
||||||
|
const uint8_t index = ( ( (tmp >> 3) & 6 ) | (tmp & 1) ) << 1;
|
||||||
|
((uint8_t*)(lsa))[11] = tmp ^ ( ( 0x75310 >> index) & 0x30 );
|
||||||
|
}
|
||||||
|
|
||||||
b[0] = nextblock[0];
|
b[0] = nextblock[0];
|
||||||
b[1] = nextblock[1];
|
b[1] = nextblock[1];
|
||||||
|
|
||||||
@@ -251,8 +270,12 @@ void cryptonight_hash_aes( void *restrict output, const void *input, int len )
|
|||||||
"rm" ( b[0] )
|
"rm" ( b[0] )
|
||||||
: "cc" );
|
: "cc" );
|
||||||
|
|
||||||
nextblock[0] = a[0] + hi;
|
a[0] += hi;
|
||||||
nextblock[1] = a[1] + lo;
|
a[1] += lo;
|
||||||
|
nextblock[0] = a[0];
|
||||||
|
nextblock[1] = cryptonightV7 ? a[1] ^ tweak : a[1];
|
||||||
|
a[0] ^= b[0];
|
||||||
|
a[1] ^= b[1];
|
||||||
|
|
||||||
memcpy( ExpandedKey, &ctx.state.hs.b[32], AES_KEY_SIZE );
|
memcpy( ExpandedKey, &ctx.state.hs.b[32], AES_KEY_SIZE );
|
||||||
ExpandAESKey256( ExpandedKey );
|
ExpandAESKey256( ExpandedKey );
|
||||||
@@ -330,5 +353,5 @@ void cryptonight_hash_aes( void *restrict output, const void *input, int len )
|
|||||||
keccakf( (uint64_t*)&ctx.state.hs.w, 24 );
|
keccakf( (uint64_t*)&ctx.state.hs.w, 24 );
|
||||||
extra_hashes[ctx.state.hs.b[0] & 3](&ctx.state, 200, output);
|
extra_hashes[ctx.state.hs.b[0] & 3](&ctx.state, 200, output);
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
@@ -7,11 +7,11 @@
|
|||||||
#include "cpuminer-config.h"
|
#include "cpuminer-config.h"
|
||||||
#include "algo-gate-api.h"
|
#include "algo-gate-api.h"
|
||||||
|
|
||||||
#ifndef NO_AES_NI
|
#if defined(__AES__)
|
||||||
#include "algo/groestl/aes_ni/hash-groestl256.h"
|
#include "algo/groestl/aes_ni/hash-groestl256.h"
|
||||||
#endif
|
#else
|
||||||
|
|
||||||
#include "crypto/c_groestl.h"
|
#include "crypto/c_groestl.h"
|
||||||
|
#endif
|
||||||
#include "crypto/c_blake256.h"
|
#include "crypto/c_blake256.h"
|
||||||
#include "crypto/c_jh.h"
|
#include "crypto/c_jh.h"
|
||||||
#include "crypto/c_skein.h"
|
#include "crypto/c_skein.h"
|
||||||
@@ -30,12 +30,12 @@ void do_blake_hash(const void* input, size_t len, char* output) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void do_groestl_hash(const void* input, size_t len, char* output) {
|
void do_groestl_hash(const void* input, size_t len, char* output) {
|
||||||
#ifdef NO_AES_NI
|
#if defined(__AES__)
|
||||||
groestl(input, len * 8, (uint8_t*)output);
|
|
||||||
#else
|
|
||||||
hashState_groestl256 ctx;
|
hashState_groestl256 ctx;
|
||||||
init_groestl256( &ctx, 32 );
|
init_groestl256( &ctx, 32 );
|
||||||
update_and_final_groestl256( &ctx, output, input, len * 8 );
|
update_and_final_groestl256( &ctx, output, input, len * 8 );
|
||||||
|
#else
|
||||||
|
groestl(input, len * 8, (uint8_t*)output);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,23 +52,24 @@ void (* const extra_hashes[4])( const void *, size_t, char *) =
|
|||||||
|
|
||||||
void cryptonight_hash( void *restrict output, const void *input, int len )
|
void cryptonight_hash( void *restrict output, const void *input, int len )
|
||||||
{
|
{
|
||||||
|
#if defined(__AES__)
|
||||||
#ifdef NO_AES_NI
|
|
||||||
cryptonight_hash_ctx ( output, input, len );
|
|
||||||
#else
|
|
||||||
cryptonight_hash_aes( output, input, len );
|
cryptonight_hash_aes( output, input, len );
|
||||||
|
#else
|
||||||
|
cryptonight_hash_ctx ( output, input, len );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void cryptonight_hash_suw( void *restrict output, const void *input )
|
void cryptonight_hash_suw( void *restrict output, const void *input )
|
||||||
{
|
{
|
||||||
#ifdef NO_AES_NI
|
#if defined(__AES__)
|
||||||
cryptonight_hash_ctx ( output, input, 76 );
|
|
||||||
#else
|
|
||||||
cryptonight_hash_aes( output, input, 76 );
|
cryptonight_hash_aes( output, input, 76 );
|
||||||
|
#else
|
||||||
|
cryptonight_hash_ctx ( output, input, 76 );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool cryptonightV7 = false;
|
||||||
|
|
||||||
int scanhash_cryptonight( int thr_id, struct work *work, uint32_t max_nonce,
|
int scanhash_cryptonight( int thr_id, struct work *work, uint32_t max_nonce,
|
||||||
uint64_t *hashes_done )
|
uint64_t *hashes_done )
|
||||||
{
|
{
|
||||||
@@ -80,6 +81,11 @@ int scanhash_cryptonight( int thr_id, struct work *work, uint32_t max_nonce,
|
|||||||
const uint32_t first_nonce = n + 1;
|
const uint32_t first_nonce = n + 1;
|
||||||
const uint32_t Htarg = ptarget[7];
|
const uint32_t Htarg = ptarget[7];
|
||||||
uint32_t hash[32 / 4] __attribute__((aligned(32)));
|
uint32_t hash[32 / 4] __attribute__((aligned(32)));
|
||||||
|
|
||||||
|
// if ( ( cryptonightV7 && ( *(uint8_t*)pdata < 7 ) )
|
||||||
|
// || ( !cryptonightV7 && ( *(uint8_t*)pdata == 7 ) ) )
|
||||||
|
// applog(LOG_WARNING,"Cryptonight variant mismatch, shares may be rejected.");
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
*nonceptr = ++n;
|
*nonceptr = ++n;
|
||||||
@@ -87,6 +93,7 @@ int scanhash_cryptonight( int thr_id, struct work *work, uint32_t max_nonce,
|
|||||||
if (unlikely( hash[7] < Htarg ))
|
if (unlikely( hash[7] < Htarg ))
|
||||||
{
|
{
|
||||||
*hashes_done = n - first_nonce + 1;
|
*hashes_done = n - first_nonce + 1;
|
||||||
|
// work_set_target_ratio( work, hash );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} while (likely((n <= max_nonce && !work_restart[thr_id].restart)));
|
} while (likely((n <= max_nonce && !work_restart[thr_id].restart)));
|
||||||
@@ -97,6 +104,19 @@ int scanhash_cryptonight( int thr_id, struct work *work, uint32_t max_nonce,
|
|||||||
|
|
||||||
bool register_cryptonight_algo( algo_gate_t* gate )
|
bool register_cryptonight_algo( algo_gate_t* gate )
|
||||||
{
|
{
|
||||||
|
cryptonightV7 = false;
|
||||||
|
register_json_rpc2( gate );
|
||||||
|
gate->optimizations = SSE2_OPT | AES_OPT;
|
||||||
|
gate->scanhash = (void*)&scanhash_cryptonight;
|
||||||
|
gate->hash = (void*)&cryptonight_hash;
|
||||||
|
gate->hash_suw = (void*)&cryptonight_hash_suw;
|
||||||
|
gate->get_max64 = (void*)&get_max64_0x40LL;
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
bool register_cryptonightv7_algo( algo_gate_t* gate )
|
||||||
|
{
|
||||||
|
cryptonightV7 = true;
|
||||||
register_json_rpc2( gate );
|
register_json_rpc2( gate );
|
||||||
gate->optimizations = SSE2_OPT | AES_OPT;
|
gate->optimizations = SSE2_OPT | AES_OPT;
|
||||||
gate->scanhash = (void*)&scanhash_cryptonight;
|
gate->scanhash = (void*)&scanhash_cryptonight;
|
||||||
|
@@ -20,8 +20,8 @@
|
|||||||
#include "crypto/c_jh.h"
|
#include "crypto/c_jh.h"
|
||||||
#include "crypto/c_skein.h"
|
#include "crypto/c_skein.h"
|
||||||
#include "crypto/int-util.h"
|
#include "crypto/int-util.h"
|
||||||
#include "crypto/hash-ops.h"
|
//#include "crypto/hash-ops.h"
|
||||||
//#include "cryptonight.h"
|
#include "cryptonight.h"
|
||||||
|
|
||||||
#if USE_INT128
|
#if USE_INT128
|
||||||
|
|
||||||
@@ -51,6 +51,7 @@ typedef __uint128_t uint128_t;
|
|||||||
#define INIT_SIZE_BLK 8
|
#define INIT_SIZE_BLK 8
|
||||||
#define INIT_SIZE_BYTE (INIT_SIZE_BLK * AES_BLOCK_SIZE)
|
#define INIT_SIZE_BYTE (INIT_SIZE_BLK * AES_BLOCK_SIZE)
|
||||||
|
|
||||||
|
/*
|
||||||
#pragma pack(push, 1)
|
#pragma pack(push, 1)
|
||||||
union cn_slow_hash_state {
|
union cn_slow_hash_state {
|
||||||
union hash_state hs;
|
union hash_state hs;
|
||||||
@@ -78,6 +79,7 @@ static void do_skein_hash(const void* input, size_t len, char* output) {
|
|||||||
int r = skein_hash(8 * HASH_SIZE, input, 8 * len, (uint8_t*)output);
|
int r = skein_hash(8 * HASH_SIZE, input, 8 * len, (uint8_t*)output);
|
||||||
assert(likely(SKEIN_SUCCESS == r));
|
assert(likely(SKEIN_SUCCESS == r));
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
extern int aesb_single_round(const uint8_t *in, uint8_t*out, const uint8_t *expandedKey);
|
extern int aesb_single_round(const uint8_t *in, uint8_t*out, const uint8_t *expandedKey);
|
||||||
extern int aesb_pseudo_round_mut(uint8_t *val, uint8_t *expandedKey);
|
extern int aesb_pseudo_round_mut(uint8_t *val, uint8_t *expandedKey);
|
||||||
@@ -120,9 +122,11 @@ static uint64_t mul128(uint64_t multiplier, uint64_t multiplicand, uint64_t* pro
|
|||||||
extern uint64_t mul128(uint64_t multiplier, uint64_t multiplicand, uint64_t* product_hi);
|
extern uint64_t mul128(uint64_t multiplier, uint64_t multiplicand, uint64_t* product_hi);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
static void (* const extra_hashes[4])(const void *, size_t, char *) = {
|
static void (* const extra_hashes[4])(const void *, size_t, char *) = {
|
||||||
do_blake_hash, do_groestl_hash, do_jh_hash, do_skein_hash
|
do_blake_hash, do_groestl_hash, do_jh_hash, do_skein_hash
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
static inline size_t e2i(const uint8_t* a) {
|
static inline size_t e2i(const uint8_t* a) {
|
||||||
#if !LITE
|
#if !LITE
|
||||||
@@ -132,14 +136,16 @@ static inline size_t e2i(const uint8_t* a) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void mul_sum_xor_dst(const uint8_t* a, uint8_t* c, uint8_t* dst) {
|
static inline void mul_sum_xor_dst( const uint8_t* a, uint8_t* c, uint8_t* dst,
|
||||||
|
const uint64_t tweak )
|
||||||
|
{
|
||||||
uint64_t hi, lo = mul128(((uint64_t*) a)[0], ((uint64_t*) dst)[0], &hi) + ((uint64_t*) c)[1];
|
uint64_t hi, lo = mul128(((uint64_t*) a)[0], ((uint64_t*) dst)[0], &hi) + ((uint64_t*) c)[1];
|
||||||
hi += ((uint64_t*) c)[0];
|
hi += ((uint64_t*) c)[0];
|
||||||
|
|
||||||
((uint64_t*) c)[0] = ((uint64_t*) dst)[0] ^ hi;
|
((uint64_t*) c)[0] = ((uint64_t*) dst)[0] ^ hi;
|
||||||
((uint64_t*) c)[1] = ((uint64_t*) dst)[1] ^ lo;
|
((uint64_t*) c)[1] = ((uint64_t*) dst)[1] ^ lo;
|
||||||
((uint64_t*) dst)[0] = hi;
|
((uint64_t*) dst)[0] = hi;
|
||||||
((uint64_t*) dst)[1] = lo;
|
((uint64_t*) dst)[1] = cryptonightV7 ? lo ^ tweak : lo;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void xor_blocks(uint8_t* a, const uint8_t* b) {
|
static inline void xor_blocks(uint8_t* a, const uint8_t* b) {
|
||||||
@@ -174,7 +180,15 @@ static __thread cryptonight_ctx ctx;
|
|||||||
|
|
||||||
void cryptonight_hash_ctx(void* output, const void* input, int len)
|
void cryptonight_hash_ctx(void* output, const void* input, int len)
|
||||||
{
|
{
|
||||||
hash_process(&ctx.state.hs, (const uint8_t*) input, len);
|
// hash_process(&ctx.state.hs, (const uint8_t*) input, len);
|
||||||
|
keccak( (const uint8_t*)input, 76, (char*)&ctx.state.hs.b, 200 );
|
||||||
|
|
||||||
|
if ( cryptonightV7 && len < 43 )
|
||||||
|
return;
|
||||||
|
const uint64_t tweak = cryptonightV7
|
||||||
|
? *((const uint64_t*) (((const uint8_t*)input) + 35))
|
||||||
|
^ ctx.state.hs.w[24] : 0;
|
||||||
|
|
||||||
ctx.aes_ctx = (oaes_ctx*) oaes_alloc();
|
ctx.aes_ctx = (oaes_ctx*) oaes_alloc();
|
||||||
|
|
||||||
__builtin_prefetch( ctx.text, 0, 3 );
|
__builtin_prefetch( ctx.text, 0, 3 );
|
||||||
@@ -211,7 +225,8 @@ void cryptonight_hash_ctx(void* output, const void* input, int len)
|
|||||||
xor_blocks_dst(&ctx.state.k[0], &ctx.state.k[32], ctx.a);
|
xor_blocks_dst(&ctx.state.k[0], &ctx.state.k[32], ctx.a);
|
||||||
xor_blocks_dst(&ctx.state.k[16], &ctx.state.k[48], ctx.b);
|
xor_blocks_dst(&ctx.state.k[16], &ctx.state.k[48], ctx.b);
|
||||||
|
|
||||||
for (i = 0; likely(i < ITER / 4); ++i) {
|
for (i = 0; likely(i < ITER / 4); ++i)
|
||||||
|
{
|
||||||
/* Dependency chain: address -> read value ------+
|
/* Dependency chain: address -> read value ------+
|
||||||
* written value <-+ hard function (AES or MUL) <+
|
* written value <-+ hard function (AES or MUL) <+
|
||||||
* next address <-+
|
* next address <-+
|
||||||
@@ -220,14 +235,34 @@ void cryptonight_hash_ctx(void* output, const void* input, int len)
|
|||||||
j = e2i(ctx.a);
|
j = e2i(ctx.a);
|
||||||
aesb_single_round(&ctx.long_state[j], ctx.c, ctx.a);
|
aesb_single_round(&ctx.long_state[j], ctx.c, ctx.a);
|
||||||
xor_blocks_dst(ctx.c, ctx.b, &ctx.long_state[j]);
|
xor_blocks_dst(ctx.c, ctx.b, &ctx.long_state[j]);
|
||||||
|
|
||||||
|
if ( cryptonightV7 )
|
||||||
|
{
|
||||||
|
uint8_t *lsa = (uint8_t*)&ctx.long_state[((uint64_t *)(ctx.a))[0] & 0x1FFFF0];
|
||||||
|
const uint8_t tmp = lsa[11];
|
||||||
|
const uint8_t index = ( ( (tmp >> 3) & 6 ) | (tmp & 1) ) << 1;
|
||||||
|
lsa[11] = tmp ^ ( ( 0x75310 >> index) & 0x30 );
|
||||||
|
}
|
||||||
|
|
||||||
/* Iteration 2 */
|
/* Iteration 2 */
|
||||||
mul_sum_xor_dst(ctx.c, ctx.a, &ctx.long_state[e2i(ctx.c)]);
|
mul_sum_xor_dst(ctx.c, ctx.a, &ctx.long_state[e2i(ctx.c)], tweak );
|
||||||
|
|
||||||
/* Iteration 3 */
|
/* Iteration 3 */
|
||||||
j = e2i(ctx.a);
|
j = e2i(ctx.a);
|
||||||
aesb_single_round(&ctx.long_state[j], ctx.b, ctx.a);
|
aesb_single_round(&ctx.long_state[j], ctx.b, ctx.a);
|
||||||
xor_blocks_dst(ctx.b, ctx.c, &ctx.long_state[j]);
|
xor_blocks_dst(ctx.b, ctx.c, &ctx.long_state[j]);
|
||||||
|
|
||||||
|
if ( cryptonightV7 )
|
||||||
|
{
|
||||||
|
uint8_t *lsa = (uint8_t*)&ctx.long_state[((uint64_t *)(ctx.a))[0] & 0x1FFFF0];
|
||||||
|
const uint8_t tmp = lsa[11];
|
||||||
|
const uint8_t index = ( ( (tmp >> 3) & 6 ) | (tmp & 1) ) << 1;
|
||||||
|
lsa[11] = tmp ^ ( ( 0x75310 >> index) & 0x30 );
|
||||||
|
}
|
||||||
|
|
||||||
/* Iteration 4 */
|
/* Iteration 4 */
|
||||||
mul_sum_xor_dst(ctx.b, ctx.a, &ctx.long_state[e2i(ctx.b)]);
|
mul_sum_xor_dst(ctx.b, ctx.a, &ctx.long_state[e2i(ctx.b)], tweak );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
__builtin_prefetch( ctx.text, 0, 3 );
|
__builtin_prefetch( ctx.text, 0, 3 );
|
||||||
@@ -266,7 +301,8 @@ void cryptonight_hash_ctx(void* output, const void* input, int len)
|
|||||||
aesb_pseudo_round_mut(&ctx.text[7 * AES_BLOCK_SIZE], ctx.aes_ctx->key->exp_data);
|
aesb_pseudo_round_mut(&ctx.text[7 * AES_BLOCK_SIZE], ctx.aes_ctx->key->exp_data);
|
||||||
}
|
}
|
||||||
memcpy(ctx.state.init, ctx.text, INIT_SIZE_BYTE);
|
memcpy(ctx.state.init, ctx.text, INIT_SIZE_BYTE);
|
||||||
hash_permutation(&ctx.state.hs);
|
// hash_permutation(&ctx.state.hs);
|
||||||
|
keccakf( (uint64_t*)&ctx.state.hs.w, 24 );
|
||||||
/*memcpy(hash, &state, 32);*/
|
/*memcpy(hash, &state, 32);*/
|
||||||
extra_hashes[ctx.state.hs.b[0] & 3](&ctx.state, 200, output);
|
extra_hashes[ctx.state.hs.b[0] & 3](&ctx.state, 200, output);
|
||||||
oaes_free((OAES_CTX **) &ctx.aes_ctx);
|
oaes_free((OAES_CTX **) &ctx.aes_ctx);
|
||||||
|
@@ -45,5 +45,7 @@ int scanhash_cryptonight( int thr_id, struct work *work, uint32_t max_nonce,
|
|||||||
|
|
||||||
void cryptonight_hash_aes( void *restrict output, const void *input, int len );
|
void cryptonight_hash_aes( void *restrict output, const void *input, int len );
|
||||||
|
|
||||||
|
extern bool cryptonightV7;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -67,7 +67,7 @@ int scanhash_lyra2h_4way( int thr_id, struct work *work, uint32_t max_nonce,
|
|||||||
if ( opt_benchmark )
|
if ( opt_benchmark )
|
||||||
ptarget[7] = 0x0000ff;
|
ptarget[7] = 0x0000ff;
|
||||||
|
|
||||||
for ( int i=0; i < 19; i++ )
|
for ( int i=0; i < 20; i++ )
|
||||||
be32enc( &edata[i], pdata[i] );
|
be32enc( &edata[i], pdata[i] );
|
||||||
|
|
||||||
mm_interleave_4x32( vdata, edata, edata, edata, edata, 640 );
|
mm_interleave_4x32( vdata, edata, edata, edata, edata, 640 );
|
||||||
|
@@ -67,7 +67,7 @@ int scanhash_lyra2z_4way( int thr_id, struct work *work, uint32_t max_nonce,
|
|||||||
if ( opt_benchmark )
|
if ( opt_benchmark )
|
||||||
ptarget[7] = 0x0000ff;
|
ptarget[7] = 0x0000ff;
|
||||||
|
|
||||||
for ( int i=0; i < 19; i++ )
|
for ( int i=0; i < 20; i++ )
|
||||||
be32enc( &edata[i], pdata[i] );
|
be32enc( &edata[i], pdata[i] );
|
||||||
|
|
||||||
mm_interleave_4x32( vdata, edata, edata, edata, edata, 640 );
|
mm_interleave_4x32( vdata, edata, edata, edata, edata, 640 );
|
||||||
|
@@ -60,7 +60,7 @@ int scanhash_sha256t_8way( int thr_id, struct work *work,
|
|||||||
0xFFFF0000,
|
0xFFFF0000,
|
||||||
0 };
|
0 };
|
||||||
|
|
||||||
for ( int k = 0; k < 19; k++ )
|
for ( int k = 0; k < 20; k++ )
|
||||||
be32enc( &edata[k], pdata[k] );
|
be32enc( &edata[k], pdata[k] );
|
||||||
|
|
||||||
mm256_interleave_8x32( vdata, edata, edata, edata, edata,
|
mm256_interleave_8x32( vdata, edata, edata, edata, edata,
|
||||||
|
@@ -34,8 +34,10 @@ int nextPerm( uint8_t n[], uint32_t count )
|
|||||||
tail = i;
|
tail = i;
|
||||||
|
|
||||||
if ( tail > 0 )
|
if ( tail > 0 )
|
||||||
|
{
|
||||||
for ( j = count - 1; j>tail && n[j] <= n[tail - 1]; j-- );
|
for ( j = count - 1; j>tail && n[j] <= n[tail - 1]; j-- );
|
||||||
evo_swap( &n[tail - 1], &n[j] );
|
evo_swap( &n[tail - 1], &n[j] );
|
||||||
|
}
|
||||||
|
|
||||||
for ( i = tail, j = count - 1; i<j; i++, j-- )
|
for ( i = tail, j = count - 1; i<j; i++, j-- )
|
||||||
evo_swap( &n[i], &n[j] );
|
evo_swap( &n[i], &n[j] );
|
||||||
|
@@ -68,13 +68,7 @@ void x16r_4way_hash( void* output, const void* input )
|
|||||||
uint32_t hash2[24] __attribute__ ((aligned (64)));
|
uint32_t hash2[24] __attribute__ ((aligned (64)));
|
||||||
uint32_t hash3[24] __attribute__ ((aligned (64)));
|
uint32_t hash3[24] __attribute__ ((aligned (64)));
|
||||||
uint32_t vhash[24*4] __attribute__ ((aligned (64)));
|
uint32_t vhash[24*4] __attribute__ ((aligned (64)));
|
||||||
// uint32_t inp0[24] __attribute__ ((aligned (64)));
|
|
||||||
// uint32_t inp1[24] __attribute__ ((aligned (64)));
|
|
||||||
// uint32_t inp2[24] __attribute__ ((aligned (64)));
|
|
||||||
// uint32_t inp3[24] __attribute__ ((aligned (64)));
|
|
||||||
|
|
||||||
x16r_4way_ctx_holder ctx;
|
x16r_4way_ctx_holder ctx;
|
||||||
|
|
||||||
void *in0 = (void*) hash0;
|
void *in0 = (void*) hash0;
|
||||||
void *in1 = (void*) hash1;
|
void *in1 = (void*) hash1;
|
||||||
void *in2 = (void*) hash2;
|
void *in2 = (void*) hash2;
|
||||||
@@ -290,10 +284,6 @@ void x16r_4way_hash( void* output, const void* input )
|
|||||||
mm256_deinterleave_4x64( hash0, hash1, hash2, hash3, vhash, 512 );
|
mm256_deinterleave_4x64( hash0, hash1, hash2, hash3, vhash, 512 );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// in0 = (void*) hash0;
|
|
||||||
// in1 = (void*) hash1;
|
|
||||||
// in2 = (void*) hash2;
|
|
||||||
// in3 = (void*) hash3;
|
|
||||||
size = 64;
|
size = 64;
|
||||||
}
|
}
|
||||||
memcpy( output, hash0, 32 );
|
memcpy( output, hash0, 32 );
|
||||||
@@ -325,7 +315,7 @@ int scanhash_x16r_4way( int thr_id, struct work *work, uint32_t max_nonce,
|
|||||||
if ( s_ntime != endiandata[17] )
|
if ( s_ntime != endiandata[17] )
|
||||||
{
|
{
|
||||||
uint32_t ntime = swab32(pdata[17]);
|
uint32_t ntime = swab32(pdata[17]);
|
||||||
x16_r_s_getAlgoString( (const char*) (&endiandata[1]), hashOrder );
|
x16_r_s_getAlgoString( (const uint8_t*) (&endiandata[1]), hashOrder );
|
||||||
s_ntime = ntime;
|
s_ntime = ntime;
|
||||||
if ( opt_debug && !thr_id )
|
if ( opt_debug && !thr_id )
|
||||||
applog( LOG_DEBUG, "hash order %s (%08x)", hashOrder, ntime );
|
applog( LOG_DEBUG, "hash order %s (%08x)", hashOrder, ntime );
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
#include "x16r-gate.h"
|
#include "x16r-gate.h"
|
||||||
|
|
||||||
void x16r_getAlgoString( const char* prevblock, char *output )
|
void x16r_getAlgoString( const uint8_t* prevblock, char *output )
|
||||||
{
|
{
|
||||||
char *sptr = output;
|
char *sptr = output;
|
||||||
for ( int j = 0; j < X16R_HASH_FUNC_COUNT; j++ )
|
for ( int j = 0; j < X16R_HASH_FUNC_COUNT; j++ )
|
||||||
@@ -16,14 +16,13 @@ void x16r_getAlgoString( const char* prevblock, char *output )
|
|||||||
*sptr = '\0';
|
*sptr = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
void x16s_getAlgoString( const char* prevblock, char *output )
|
void x16s_getAlgoString( const uint8_t* prevblock, char *output )
|
||||||
{
|
{
|
||||||
uint8_t* data = (uint8_t*)prevblock;
|
|
||||||
strcpy( output, "0123456789ABCDEF" );
|
strcpy( output, "0123456789ABCDEF" );
|
||||||
for ( int i = 0; i < 16; i++ )
|
for ( int i = 0; i < 16; i++ )
|
||||||
{
|
{
|
||||||
uint8_t b = (15 - i) >> 1; // 16 ascii hex chars, reversed
|
uint8_t b = (15 - i) >> 1; // 16 ascii hex chars, reversed
|
||||||
uint8_t algoDigit = (i & 1) ? data[b] & 0xF : data[b] >> 4;
|
uint8_t algoDigit = (i & 1) ? prevblock[b] & 0xF : prevblock[b] >> 4;
|
||||||
int offset = algoDigit;
|
int offset = algoDigit;
|
||||||
// insert the nth character at the front
|
// insert the nth character at the front
|
||||||
char oldVal = output[offset];
|
char oldVal = output[offset];
|
||||||
|
@@ -29,9 +29,9 @@ enum x16r_Algo {
|
|||||||
X16R_HASH_FUNC_COUNT
|
X16R_HASH_FUNC_COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
bool (*x16_r_s_getAlgoString) ( const char*, char* );
|
void (*x16_r_s_getAlgoString) ( const uint8_t*, char* );
|
||||||
void x16r_getAlgoString( const char* prevblock, char *output );
|
void x16r_getAlgoString( const uint8_t* prevblock, char *output );
|
||||||
void x16s_getAlgoString( const char* prevblock, char *output );
|
void x16s_getAlgoString( const uint8_t* prevblock, char *output );
|
||||||
|
|
||||||
bool register_x16r_algo( algo_gate_t* gate );
|
bool register_x16r_algo( algo_gate_t* gate );
|
||||||
bool register_x16s_algo( algo_gate_t* gate );
|
bool register_x16s_algo( algo_gate_t* gate );
|
||||||
|
@@ -205,7 +205,7 @@ int scanhash_x16r( int thr_id, struct work *work, uint32_t max_nonce,
|
|||||||
if ( s_ntime != pdata[17] )
|
if ( s_ntime != pdata[17] )
|
||||||
{
|
{
|
||||||
uint32_t ntime = swab32(pdata[17]);
|
uint32_t ntime = swab32(pdata[17]);
|
||||||
x16_r_s_getAlgoString( (const char*) (&endiandata[1]), hashOrder );
|
x16_r_s_getAlgoString( (const uint8_t*) (&endiandata[1]), hashOrder );
|
||||||
s_ntime = ntime;
|
s_ntime = ntime;
|
||||||
if ( opt_debug && !thr_id )
|
if ( opt_debug && !thr_id )
|
||||||
applog( LOG_DEBUG, "hash order %s (%08x)", hashOrder, ntime );
|
applog( LOG_DEBUG, "hash order %s (%08x)", hashOrder, ntime );
|
||||||
|
@@ -156,7 +156,7 @@ static inline __m128i foo()
|
|||||||
// _mm_setzero_si128 uses pxor instruction, it's unclear what _mm_set_epi does.
|
// _mm_setzero_si128 uses pxor instruction, it's unclear what _mm_set_epi does.
|
||||||
// If a pseudo constant is used repeatedly in a function it may be worthwhile
|
// If a pseudo constant is used repeatedly in a function it may be worthwhile
|
||||||
// to define a register variable to represent that constant.
|
// to define a register variable to represent that constant.
|
||||||
// register __m128i zero = mm_zero;
|
// register __m128i zero = mm_setzero_si128();
|
||||||
|
|
||||||
// Constant zero
|
// Constant zero
|
||||||
#define m128_zero _mm_setzero_si128()
|
#define m128_zero _mm_setzero_si128()
|
||||||
@@ -1018,7 +1018,8 @@ inline __m256i mm256_aesenc_nokey_2x128_obs( __m256i x )
|
|||||||
|
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#if defined(__AVX512F__) && defined(__AVX512DQ__) && defined(__AVX512BW__) && defined(__AVX512VBMI__)
|
#if defined(__AVX512F__)
|
||||||
|
//#if defined(__AVX512F__) && defined(__AVX512DQ__) && defined(__AVX512BW__) && defined(__AVX512VBMI__)
|
||||||
|
|
||||||
// Experimental, not tested.
|
// Experimental, not tested.
|
||||||
|
|
||||||
|
@@ -3,10 +3,30 @@
|
|||||||
make distclean || echo clean
|
make distclean || echo clean
|
||||||
rm -f config.status
|
rm -f config.status
|
||||||
./autogen.sh || echo done
|
./autogen.sh || echo done
|
||||||
|
CFLAGS="-O3 -march=core-avx2 -msha -Wall" ./configure --with-curl
|
||||||
|
make -j 4
|
||||||
|
strip -s cpuminer.exe
|
||||||
|
mv cpuminer.exe cpuminer-avx2-sha.exe
|
||||||
|
strip -s cpuminer
|
||||||
|
mv cpuminer cpuminer-avx2-sha
|
||||||
|
|
||||||
|
make clean || echo clean
|
||||||
|
rm -f config.status
|
||||||
|
./autogen.sh || echo done
|
||||||
|
CFLAGS="-O3 -march=skylake-avx512 -Wall" ./configure --with-curl
|
||||||
|
make -j 4
|
||||||
|
strip -s cpuminer.exe
|
||||||
|
mv cpuminer.exe cpuminer-avx512.exe
|
||||||
|
strip -s cpuminer
|
||||||
|
mv cpuminer cpuminer-avx512
|
||||||
|
|
||||||
|
make clean || echo clean
|
||||||
|
rm -f config.status
|
||||||
|
./autogen.sh || echo done
|
||||||
CFLAGS="-O3 -march=core-avx2 -Wall" ./configure --with-curl
|
CFLAGS="-O3 -march=core-avx2 -Wall" ./configure --with-curl
|
||||||
make -j 4
|
make -j 4
|
||||||
strip -s cpuminer.exe
|
strip -s cpuminer.exe
|
||||||
mv cpuminer.exe cpuminer-aes-avx2.exe
|
mv cpuminer.exe cpuminer-avx2.exe
|
||||||
strip -s cpuminer
|
strip -s cpuminer
|
||||||
mv cpuminer cpuminer-avx2
|
mv cpuminer cpuminer-avx2
|
||||||
|
|
||||||
|
47
configure
vendored
47
configure
vendored
@@ -1,6 +1,6 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Guess values for system-dependent variables and create Makefiles.
|
# Guess values for system-dependent variables and create Makefiles.
|
||||||
# Generated by GNU Autoconf 2.69 for cpuminer-opt 3.8.7.1.
|
# Generated by GNU Autoconf 2.69 for cpuminer-opt 3.8.8.1.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
|
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
|
||||||
@@ -577,8 +577,8 @@ MAKEFLAGS=
|
|||||||
# Identity of this package.
|
# Identity of this package.
|
||||||
PACKAGE_NAME='cpuminer-opt'
|
PACKAGE_NAME='cpuminer-opt'
|
||||||
PACKAGE_TARNAME='cpuminer-opt'
|
PACKAGE_TARNAME='cpuminer-opt'
|
||||||
PACKAGE_VERSION='3.8.7.1'
|
PACKAGE_VERSION='3.8.8.1'
|
||||||
PACKAGE_STRING='cpuminer-opt 3.8.7.1'
|
PACKAGE_STRING='cpuminer-opt 3.8.8.1'
|
||||||
PACKAGE_BUGREPORT=''
|
PACKAGE_BUGREPORT=''
|
||||||
PACKAGE_URL=''
|
PACKAGE_URL=''
|
||||||
|
|
||||||
@@ -738,6 +738,7 @@ infodir
|
|||||||
docdir
|
docdir
|
||||||
oldincludedir
|
oldincludedir
|
||||||
includedir
|
includedir
|
||||||
|
runstatedir
|
||||||
localstatedir
|
localstatedir
|
||||||
sharedstatedir
|
sharedstatedir
|
||||||
sysconfdir
|
sysconfdir
|
||||||
@@ -819,6 +820,7 @@ datadir='${datarootdir}'
|
|||||||
sysconfdir='${prefix}/etc'
|
sysconfdir='${prefix}/etc'
|
||||||
sharedstatedir='${prefix}/com'
|
sharedstatedir='${prefix}/com'
|
||||||
localstatedir='${prefix}/var'
|
localstatedir='${prefix}/var'
|
||||||
|
runstatedir='${localstatedir}/run'
|
||||||
includedir='${prefix}/include'
|
includedir='${prefix}/include'
|
||||||
oldincludedir='/usr/include'
|
oldincludedir='/usr/include'
|
||||||
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
|
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
|
||||||
@@ -1071,6 +1073,15 @@ do
|
|||||||
| -silent | --silent | --silen | --sile | --sil)
|
| -silent | --silent | --silen | --sile | --sil)
|
||||||
silent=yes ;;
|
silent=yes ;;
|
||||||
|
|
||||||
|
-runstatedir | --runstatedir | --runstatedi | --runstated \
|
||||||
|
| --runstate | --runstat | --runsta | --runst | --runs \
|
||||||
|
| --run | --ru | --r)
|
||||||
|
ac_prev=runstatedir ;;
|
||||||
|
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
|
||||||
|
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
|
||||||
|
| --run=* | --ru=* | --r=*)
|
||||||
|
runstatedir=$ac_optarg ;;
|
||||||
|
|
||||||
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
|
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
|
||||||
ac_prev=sbindir ;;
|
ac_prev=sbindir ;;
|
||||||
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
|
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
|
||||||
@@ -1208,7 +1219,7 @@ fi
|
|||||||
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
|
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
|
||||||
datadir sysconfdir sharedstatedir localstatedir includedir \
|
datadir sysconfdir sharedstatedir localstatedir includedir \
|
||||||
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
|
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
|
||||||
libdir localedir mandir
|
libdir localedir mandir runstatedir
|
||||||
do
|
do
|
||||||
eval ac_val=\$$ac_var
|
eval ac_val=\$$ac_var
|
||||||
# Remove trailing slashes.
|
# Remove trailing slashes.
|
||||||
@@ -1321,7 +1332,7 @@ if test "$ac_init_help" = "long"; then
|
|||||||
# Omit some internal or obsolete options to make the list less imposing.
|
# Omit some internal or obsolete options to make the list less imposing.
|
||||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||||
cat <<_ACEOF
|
cat <<_ACEOF
|
||||||
\`configure' configures cpuminer-opt 3.8.7.1 to adapt to many kinds of systems.
|
\`configure' configures cpuminer-opt 3.8.8.1 to adapt to many kinds of systems.
|
||||||
|
|
||||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||||
|
|
||||||
@@ -1361,6 +1372,7 @@ Fine tuning of the installation directories:
|
|||||||
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
|
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
|
||||||
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
|
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
|
||||||
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
|
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
|
||||||
|
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
|
||||||
--libdir=DIR object code libraries [EPREFIX/lib]
|
--libdir=DIR object code libraries [EPREFIX/lib]
|
||||||
--includedir=DIR C header files [PREFIX/include]
|
--includedir=DIR C header files [PREFIX/include]
|
||||||
--oldincludedir=DIR C header files for non-gcc [/usr/include]
|
--oldincludedir=DIR C header files for non-gcc [/usr/include]
|
||||||
@@ -1392,7 +1404,7 @@ fi
|
|||||||
|
|
||||||
if test -n "$ac_init_help"; then
|
if test -n "$ac_init_help"; then
|
||||||
case $ac_init_help in
|
case $ac_init_help in
|
||||||
short | recursive ) echo "Configuration of cpuminer-opt 3.8.7.1:";;
|
short | recursive ) echo "Configuration of cpuminer-opt 3.8.8.1:";;
|
||||||
esac
|
esac
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
|
|
||||||
@@ -1497,7 +1509,7 @@ fi
|
|||||||
test -n "$ac_init_help" && exit $ac_status
|
test -n "$ac_init_help" && exit $ac_status
|
||||||
if $ac_init_version; then
|
if $ac_init_version; then
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
cpuminer-opt configure 3.8.7.1
|
cpuminer-opt configure 3.8.8.1
|
||||||
generated by GNU Autoconf 2.69
|
generated by GNU Autoconf 2.69
|
||||||
|
|
||||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||||
@@ -2000,7 +2012,7 @@ cat >config.log <<_ACEOF
|
|||||||
This file contains any messages produced by compilers while
|
This file contains any messages produced by compilers while
|
||||||
running configure, to aid debugging if configure makes a mistake.
|
running configure, to aid debugging if configure makes a mistake.
|
||||||
|
|
||||||
It was created by cpuminer-opt $as_me 3.8.7.1, which was
|
It was created by cpuminer-opt $as_me 3.8.8.1, which was
|
||||||
generated by GNU Autoconf 2.69. Invocation command line was
|
generated by GNU Autoconf 2.69. Invocation command line was
|
||||||
|
|
||||||
$ $0 $@
|
$ $0 $@
|
||||||
@@ -2495,7 +2507,7 @@ ac_config_headers="$ac_config_headers cpuminer-config.h"
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
am__api_version='1.14'
|
am__api_version='1.15'
|
||||||
|
|
||||||
# Find a good install program. We prefer a C program (faster),
|
# Find a good install program. We prefer a C program (faster),
|
||||||
# so one script is as good as another. But avoid the broken or
|
# so one script is as good as another. But avoid the broken or
|
||||||
@@ -2667,8 +2679,8 @@ test "$program_suffix" != NONE &&
|
|||||||
ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
|
ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
|
||||||
program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
|
program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
|
||||||
|
|
||||||
# expand $ac_aux_dir to an absolute path
|
# Expand $ac_aux_dir to an absolute path.
|
||||||
am_aux_dir=`cd $ac_aux_dir && pwd`
|
am_aux_dir=`cd "$ac_aux_dir" && pwd`
|
||||||
|
|
||||||
if test x"${MISSING+set}" != xset; then
|
if test x"${MISSING+set}" != xset; then
|
||||||
case $am_aux_dir in
|
case $am_aux_dir in
|
||||||
@@ -2687,7 +2699,7 @@ else
|
|||||||
$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
|
$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test x"${install_sh}" != xset; then
|
if test x"${install_sh+set}" != xset; then
|
||||||
case $am_aux_dir in
|
case $am_aux_dir in
|
||||||
*\ * | *\ *)
|
*\ * | *\ *)
|
||||||
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
|
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
|
||||||
@@ -2981,7 +2993,7 @@ fi
|
|||||||
|
|
||||||
# Define the identity of the package.
|
# Define the identity of the package.
|
||||||
PACKAGE='cpuminer-opt'
|
PACKAGE='cpuminer-opt'
|
||||||
VERSION='3.8.7.1'
|
VERSION='3.8.8.1'
|
||||||
|
|
||||||
|
|
||||||
cat >>confdefs.h <<_ACEOF
|
cat >>confdefs.h <<_ACEOF
|
||||||
@@ -3015,8 +3027,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
|
|||||||
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
|
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
|
||||||
mkdir_p='$(MKDIR_P)'
|
mkdir_p='$(MKDIR_P)'
|
||||||
|
|
||||||
# We need awk for the "check" target. The system "awk" is bad on
|
# We need awk for the "check" target (and possibly the TAP driver). The
|
||||||
# some platforms.
|
# system "awk" is bad on some platforms.
|
||||||
# Always define AMTAR for backward compatibility. Yes, it's still used
|
# Always define AMTAR for backward compatibility. Yes, it's still used
|
||||||
# in the wild :-( We should find a proper way to deprecate it ...
|
# in the wild :-( We should find a proper way to deprecate it ...
|
||||||
AMTAR='$${TAR-tar}'
|
AMTAR='$${TAR-tar}'
|
||||||
@@ -3075,6 +3087,7 @@ END
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
|
||||||
$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
|
$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
|
||||||
# Check whether --enable-maintainer-mode was given.
|
# Check whether --enable-maintainer-mode was given.
|
||||||
@@ -6677,7 +6690,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
|||||||
# report actual input values of CONFIG_FILES etc. instead of their
|
# report actual input values of CONFIG_FILES etc. instead of their
|
||||||
# values after options handling.
|
# values after options handling.
|
||||||
ac_log="
|
ac_log="
|
||||||
This file was extended by cpuminer-opt $as_me 3.8.7.1, which was
|
This file was extended by cpuminer-opt $as_me 3.8.8.1, which was
|
||||||
generated by GNU Autoconf 2.69. Invocation command line was
|
generated by GNU Autoconf 2.69. Invocation command line was
|
||||||
|
|
||||||
CONFIG_FILES = $CONFIG_FILES
|
CONFIG_FILES = $CONFIG_FILES
|
||||||
@@ -6743,7 +6756,7 @@ _ACEOF
|
|||||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||||
ac_cs_version="\\
|
ac_cs_version="\\
|
||||||
cpuminer-opt config.status 3.8.7.1
|
cpuminer-opt config.status 3.8.8.1
|
||||||
configured by $0, generated by GNU Autoconf 2.69,
|
configured by $0, generated by GNU Autoconf 2.69,
|
||||||
with options \\"\$ac_cs_config\\"
|
with options \\"\$ac_cs_config\\"
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
AC_INIT([cpuminer-opt], [3.8.7.1])
|
AC_INIT([cpuminer-opt], [3.8.8.1])
|
||||||
|
|
||||||
AC_PREREQ([2.59c])
|
AC_PREREQ([2.59c])
|
||||||
AC_CANONICAL_SYSTEM
|
AC_CANONICAL_SYSTEM
|
||||||
|
20
cpu-miner.c
20
cpu-miner.c
@@ -98,7 +98,7 @@ static int opt_fail_pause = 10;
|
|||||||
static int opt_time_limit = 0;
|
static int opt_time_limit = 0;
|
||||||
int opt_timeout = 300;
|
int opt_timeout = 300;
|
||||||
static int opt_scantime = 5;
|
static int opt_scantime = 5;
|
||||||
static const bool opt_time = true;
|
//static const bool opt_time = true;
|
||||||
enum algos opt_algo = ALGO_NULL;
|
enum algos opt_algo = ALGO_NULL;
|
||||||
int opt_scrypt_n = 0;
|
int opt_scrypt_n = 0;
|
||||||
int opt_pluck_n = 128;
|
int opt_pluck_n = 128;
|
||||||
@@ -1988,7 +1988,9 @@ static void *miner_thread( void *userdata )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Display benchmark total
|
// Display benchmark total
|
||||||
if ( opt_benchmark && thr_id == opt_n_threads - 1 )
|
// Update hashrate for API if no shares accepted yet.
|
||||||
|
if ( ( opt_benchmark || !accepted_count )
|
||||||
|
&& thr_id == opt_n_threads - 1 )
|
||||||
{
|
{
|
||||||
double hashrate = 0.;
|
double hashrate = 0.;
|
||||||
double hashcount = 0.;
|
double hashcount = 0.;
|
||||||
@@ -1998,13 +2000,15 @@ static void *miner_thread( void *userdata )
|
|||||||
hashcount += thr_hashcount[i];
|
hashcount += thr_hashcount[i];
|
||||||
}
|
}
|
||||||
if ( hashcount )
|
if ( hashcount )
|
||||||
|
{
|
||||||
|
global_hashcount = hashcount;
|
||||||
|
global_hashrate = hashrate;
|
||||||
|
if ( opt_benchmark )
|
||||||
{
|
{
|
||||||
char hc[16];
|
char hc[16];
|
||||||
char hc_units[2] = {0,0};
|
char hc_units[2] = {0,0};
|
||||||
char hr[16];
|
char hr[16];
|
||||||
char hr_units[2] = {0,0};
|
char hr_units[2] = {0,0};
|
||||||
global_hashcount = hashcount;
|
|
||||||
global_hashrate = hashrate;
|
|
||||||
scale_hash_for_display( &hashcount, hc_units );
|
scale_hash_for_display( &hashcount, hc_units );
|
||||||
scale_hash_for_display( &hashrate, hr_units );
|
scale_hash_for_display( &hashrate, hr_units );
|
||||||
if ( hc_units[0] )
|
if ( hc_units[0] )
|
||||||
@@ -2021,6 +2025,7 @@ static void *miner_thread( void *userdata )
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} // miner_thread loop
|
} // miner_thread loop
|
||||||
|
|
||||||
out:
|
out:
|
||||||
@@ -3002,11 +3007,13 @@ bool check_cpu_capability ()
|
|||||||
bool cpu_has_sse2 = has_sse2();
|
bool cpu_has_sse2 = has_sse2();
|
||||||
bool cpu_has_aes = has_aes_ni();
|
bool cpu_has_aes = has_aes_ni();
|
||||||
bool cpu_has_sse42 = has_sse42();
|
bool cpu_has_sse42 = has_sse42();
|
||||||
|
bool cpu_has_avx = has_avx1();
|
||||||
bool cpu_has_avx2 = has_avx2();
|
bool cpu_has_avx2 = has_avx2();
|
||||||
bool cpu_has_sha = has_sha();
|
bool cpu_has_sha = has_sha();
|
||||||
bool cpu_has_avx512 = has_avx512f();
|
bool cpu_has_avx512 = has_avx512f();
|
||||||
bool sw_has_aes = false;
|
bool sw_has_aes = false;
|
||||||
bool sw_has_sse42 = false;
|
bool sw_has_sse42 = false;
|
||||||
|
bool sw_has_avx = false;
|
||||||
bool sw_has_avx2 = false;
|
bool sw_has_avx2 = false;
|
||||||
bool sw_has_avx512 = false;
|
bool sw_has_avx512 = false;
|
||||||
bool sw_has_sha = false;
|
bool sw_has_sha = false;
|
||||||
@@ -3031,6 +3038,9 @@ bool check_cpu_capability ()
|
|||||||
#ifdef __SSE4_2__
|
#ifdef __SSE4_2__
|
||||||
sw_has_sse42 = true;
|
sw_has_sse42 = true;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef __AVX__
|
||||||
|
sw_has_avx = true;
|
||||||
|
#endif
|
||||||
#ifdef __AVX2__
|
#ifdef __AVX2__
|
||||||
sw_has_avx2 = true;
|
sw_has_avx2 = true;
|
||||||
#endif
|
#endif
|
||||||
@@ -3062,6 +3072,7 @@ bool check_cpu_capability ()
|
|||||||
if ( cpu_has_sse2 ) printf( " SSE2" );
|
if ( cpu_has_sse2 ) printf( " SSE2" );
|
||||||
if ( cpu_has_aes ) printf( " AES" );
|
if ( cpu_has_aes ) printf( " AES" );
|
||||||
if ( cpu_has_sse42 ) printf( " SSE4.2" );
|
if ( cpu_has_sse42 ) printf( " SSE4.2" );
|
||||||
|
if ( cpu_has_avx ) printf( " AVX" );
|
||||||
if ( cpu_has_avx2 ) printf( " AVX2" );
|
if ( cpu_has_avx2 ) printf( " AVX2" );
|
||||||
if ( cpu_has_avx512 ) printf( " AVX512" );
|
if ( cpu_has_avx512 ) printf( " AVX512" );
|
||||||
if ( cpu_has_sha ) printf( " SHA" );
|
if ( cpu_has_sha ) printf( " SHA" );
|
||||||
@@ -3069,6 +3080,7 @@ bool check_cpu_capability ()
|
|||||||
printf(".\nSW features: SSE2");
|
printf(".\nSW features: SSE2");
|
||||||
if ( sw_has_aes ) printf( " AES" );
|
if ( sw_has_aes ) printf( " AES" );
|
||||||
if ( sw_has_sse42 ) printf( " SSE4.2" );
|
if ( sw_has_sse42 ) printf( " SSE4.2" );
|
||||||
|
if ( sw_has_avx ) printf( " AVX" );
|
||||||
if ( sw_has_avx2 ) printf( " AVX2" );
|
if ( sw_has_avx2 ) printf( " AVX2" );
|
||||||
if ( sw_has_avx512 ) printf( " AVX512" );
|
if ( sw_has_avx512 ) printf( " AVX512" );
|
||||||
if ( sw_has_sha ) printf( " SHA" );
|
if ( sw_has_sha ) printf( " SHA" );
|
||||||
|
32
interleave.h
32
interleave.h
@@ -789,8 +789,8 @@ static inline void mm_reinterleave_4x32( void *dst, void *src, int bit_len )
|
|||||||
|
|
||||||
#endif // __AVX2__
|
#endif // __AVX2__
|
||||||
|
|
||||||
//#if defined(__AVX512F__)
|
#if defined(__AVX512F__)
|
||||||
#if 0
|
//#if 0
|
||||||
|
|
||||||
// Macro functions returning vector.
|
// Macro functions returning vector.
|
||||||
// Abstracted typecasting, avoid temp pointers.
|
// Abstracted typecasting, avoid temp pointers.
|
||||||
@@ -804,7 +804,7 @@ static inline void mm_reinterleave_4x32( void *dst, void *src, int bit_len )
|
|||||||
|
|
||||||
#define mm512_put_32( s00, s01, s02, s03, s04, s05, s06, s07, \
|
#define mm512_put_32( s00, s01, s02, s03, s04, s05, s06, s07, \
|
||||||
s08, s09, s10, s11, s12, s13, s14, s15 ) \
|
s08, s09, s10, s11, s12, s13, s14, s15 ) \
|
||||||
_mm512_set_epi64( *((const uint32_t*)(s15)), *((const uint32_t*)(s14)), \
|
_mm512_set_epi32( *((const uint32_t*)(s15)), *((const uint32_t*)(s14)), \
|
||||||
*((const uint32_t*)(s13)), *((const uint32_t*)(s12)), \
|
*((const uint32_t*)(s13)), *((const uint32_t*)(s12)), \
|
||||||
*((const uint32_t*)(s11)), *((const uint32_t*)(s10)), \
|
*((const uint32_t*)(s11)), *((const uint32_t*)(s10)), \
|
||||||
*((const uint32_t*)(s09)), *((const uint32_t*)(s08)), \
|
*((const uint32_t*)(s09)), *((const uint32_t*)(s08)), \
|
||||||
@@ -931,9 +931,8 @@ static inline void mm256_deinterleave_8x64x256( void *d0, void *d1, void *d2,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 8 lanes of 512 bits using 64 bit interleaving (typical intermediate hash)
|
// 8 lanes of 512 bits using 64 bit interleaving (typical intermediate hash)
|
||||||
static inline void mm512_deinterleave_8x64x512( void *d00, void *d01,
|
static inline void mm512_deinterleave_8x64x512( void *d0, void *d1, void *d2,
|
||||||
void *d02, void *d03, void *d04, void *d05, void *d06,
|
void *d3, void *d4, void *d5, void *d6, void *d7, const void *s )
|
||||||
void *d07, const void *s )
|
|
||||||
{
|
{
|
||||||
cast_m512i( d0 ) = mm512_get_64( s, 56, 48, 40, 32, 24, 16, 8, 0 );
|
cast_m512i( d0 ) = mm512_get_64( s, 56, 48, 40, 32, 24, 16, 8, 0 );
|
||||||
cast_m512i( d1 ) = mm512_get_64( s, 57, 49, 41, 33, 25, 17, 9, 1 );
|
cast_m512i( d1 ) = mm512_get_64( s, 57, 49, 41, 33, 25, 17, 9, 1 );
|
||||||
@@ -941,7 +940,7 @@ static inline void mm512_deinterleave_8x64x512( void *d00, void *d01,
|
|||||||
cast_m512i( d3 ) = mm512_get_64( s, 59, 51, 43, 35, 27, 19, 11, 3 );
|
cast_m512i( d3 ) = mm512_get_64( s, 59, 51, 43, 35, 27, 19, 11, 3 );
|
||||||
cast_m512i( d4 ) = mm512_get_64( s, 60, 52, 44, 36, 28, 20, 12, 4 );
|
cast_m512i( d4 ) = mm512_get_64( s, 60, 52, 44, 36, 28, 20, 12, 4 );
|
||||||
cast_m512i( d5 ) = mm512_get_64( s, 61, 53, 45, 37, 29, 21, 13, 5 );
|
cast_m512i( d5 ) = mm512_get_64( s, 61, 53, 45, 37, 29, 21, 13, 5 );
|
||||||
cast_m512i( d7 ) = mm512_get_64( s, 62, 54, 46, 38, 30, 22, 14, 6 );
|
cast_m512i( d6 ) = mm512_get_64( s, 62, 54, 46, 38, 30, 22, 14, 6 );
|
||||||
cast_m512i( d7 ) = mm512_get_64( s, 63, 55, 47, 39, 31, 23, 15, 7 );
|
cast_m512i( d7 ) = mm512_get_64( s, 63, 55, 47, 39, 31, 23, 15, 7 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -953,7 +952,7 @@ static inline void mm512_deinterleave_8x64( void *dst0, void *dst1, void *dst2,
|
|||||||
{
|
{
|
||||||
mm256_deinterleave_8x64x256( dst0, dst1, dst2, dst3,
|
mm256_deinterleave_8x64x256( dst0, dst1, dst2, dst3,
|
||||||
dst4, dst5, dst6, dst7, src );
|
dst4, dst5, dst6, dst7, src );
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mm512_deinterleave_8x64x512( dst0, dst1, dst2, dst3,
|
mm512_deinterleave_8x64x512( dst0, dst1, dst2, dst3,
|
||||||
@@ -976,7 +975,6 @@ static inline void mm512_deinterleave_8x64( void *dst0, void *dst1, void *dst2,
|
|||||||
static inline void mm512_extract_lane_8x64( void *dst, const void *src,
|
static inline void mm512_extract_lane_8x64( void *dst, const void *src,
|
||||||
const int lane, const int bit_len )
|
const int lane, const int bit_len )
|
||||||
{
|
{
|
||||||
const uint64_t *s = (const uint64_t*)src;
|
|
||||||
|
|
||||||
if ( bit_len <= 256 )
|
if ( bit_len <= 256 )
|
||||||
{
|
{
|
||||||
@@ -992,7 +990,7 @@ static inline void mm512_extract_lane_8x64( void *dst, const void *src,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline void mm512_interleave_16x32( void *dst, const void *s00,
|
static inline void mm512_interleave_16x32( void *d, const void *s00,
|
||||||
const void *s01, const void *s02, const void *s03, const void *s04,
|
const void *s01, const void *s02, const void *s03, const void *s04,
|
||||||
const void *s05, const void *s06, const void *s07, const void *s08,
|
const void *s05, const void *s06, const void *s07, const void *s08,
|
||||||
const void *s09, const void *s10, const void *s11, const void *s12,
|
const void *s09, const void *s10, const void *s11, const void *s12,
|
||||||
@@ -1233,7 +1231,7 @@ static inline void mm512_deinterleave_16x32( void *d00, void *d01, void *d02,
|
|||||||
mm256_deinterleave_16x32x256( d00, d01, d02, d03, d04, d05, d06, d07,
|
mm256_deinterleave_16x32x256( d00, d01, d02, d03, d04, d05, d06, d07,
|
||||||
d08, d09, d10, d11, d12, d13, d14, d15,
|
d08, d09, d10, d11, d12, d13, d14, d15,
|
||||||
src );
|
src );
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
mm512_deinterleave_16x32x512( d00, d01, d02, d03, d04, d05, d06, d07,
|
mm512_deinterleave_16x32x512( d00, d01, d02, d03, d04, d05, d06, d07,
|
||||||
d08, d09, d10, d11, d12, d13, d14, d15,
|
d08, d09, d10, d11, d12, d13, d14, d15,
|
||||||
@@ -1303,7 +1301,7 @@ static inline void mm512_interleave_4x128( void *d, const void *s0,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline void mm512_deinterleave_4x128x128( void *d0, void *d1, void *d2,
|
static inline void mm512_deinterleave_4x128x128( void *d0, void *d1, void *d2,
|
||||||
void *d3, const void *src, const int bit_len )
|
void *d3, const void *s )
|
||||||
{
|
{
|
||||||
cast_m128i( d0 ) = mm_get_64( s, 1, 0 );
|
cast_m128i( d0 ) = mm_get_64( s, 1, 0 );
|
||||||
cast_m128i( d1 ) = mm_get_64( s, 3, 2 );
|
cast_m128i( d1 ) = mm_get_64( s, 3, 2 );
|
||||||
@@ -1312,7 +1310,7 @@ static inline void mm512_deinterleave_4x128x128( void *d0, void *d1, void *d2,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline void mm512_deinterleave_4x128x256( void *d0, void *d1, void *d2,
|
static inline void mm512_deinterleave_4x128x256( void *d0, void *d1, void *d2,
|
||||||
void *d3, const void *src, const int bit_len )
|
void *d3, const void *s )
|
||||||
{
|
{
|
||||||
cast_m256i( d0 ) = mm256_get_64( s, 9, 8, 1, 0 );
|
cast_m256i( d0 ) = mm256_get_64( s, 9, 8, 1, 0 );
|
||||||
cast_m256i( d1 ) = mm256_get_64( s, 11, 10, 3, 2 );
|
cast_m256i( d1 ) = mm256_get_64( s, 11, 10, 3, 2 );
|
||||||
@@ -1321,7 +1319,7 @@ static inline void mm512_deinterleave_4x128x256( void *d0, void *d1, void *d2,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline void mm512_deinterleave_4x128x512( void *d0, void *d1, void *d2,
|
static inline void mm512_deinterleave_4x128x512( void *d0, void *d1, void *d2,
|
||||||
void *d3, const void *src, const int bit_len )
|
void *d3, const void *s )
|
||||||
{
|
{
|
||||||
cast_m512i( d0 ) = mm512_get_64( s, 25, 24, 17, 16, 9, 8, 1, 0 );
|
cast_m512i( d0 ) = mm512_get_64( s, 25, 24, 17, 16, 9, 8, 1, 0 );
|
||||||
cast_m512i( d1 ) = mm512_get_64( s, 27, 26, 19, 18, 11, 10, 3, 2 );
|
cast_m512i( d1 ) = mm512_get_64( s, 27, 26, 19, 18, 11, 10, 3, 2 );
|
||||||
@@ -1334,8 +1332,8 @@ static inline void mm512_deinterleave_4x128( void *dst0, void *dst1, void *dst2,
|
|||||||
{
|
{
|
||||||
if ( bit_len <= 256 )
|
if ( bit_len <= 256 )
|
||||||
{
|
{
|
||||||
mm256_deinterleave_4x128x256( dst0, dst1, dst2, dst3, src );
|
mm512_deinterleave_4x128x256( dst0, dst1, dst2, dst3, src );
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mm512_deinterleave_4x128x512( dst0, dst1, dst2, dst3, src );
|
mm512_deinterleave_4x128x512( dst0, dst1, dst2, dst3, src );
|
||||||
@@ -1343,7 +1341,7 @@ static inline void mm512_deinterleave_4x128( void *dst0, void *dst1, void *dst2,
|
|||||||
|
|
||||||
if ( bit_len <= 640 )
|
if ( bit_len <= 640 )
|
||||||
{
|
{
|
||||||
mm_deinterleave_4x128x128( dst0+128, dst1+128, dst2+128, dst3+128,
|
mm512_deinterleave_4x128x128( dst0+128, dst1+128, dst2+128, dst3+128,
|
||||||
src+512 );
|
src+512 );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
5
miner.h
5
miner.h
@@ -499,6 +499,7 @@ enum algos {
|
|||||||
ALGO_C11,
|
ALGO_C11,
|
||||||
ALGO_CRYPTOLIGHT,
|
ALGO_CRYPTOLIGHT,
|
||||||
ALGO_CRYPTONIGHT,
|
ALGO_CRYPTONIGHT,
|
||||||
|
ALGO_CRYPTONIGHTV7,
|
||||||
ALGO_DECRED,
|
ALGO_DECRED,
|
||||||
ALGO_DEEP,
|
ALGO_DEEP,
|
||||||
ALGO_DMD_GR,
|
ALGO_DMD_GR,
|
||||||
@@ -580,6 +581,7 @@ static const char* const algo_names[] = {
|
|||||||
"c11",
|
"c11",
|
||||||
"cryptolight",
|
"cryptolight",
|
||||||
"cryptonight",
|
"cryptonight",
|
||||||
|
"cryptonightv7",
|
||||||
"decred",
|
"decred",
|
||||||
"deep",
|
"deep",
|
||||||
"dmd-gr",
|
"dmd-gr",
|
||||||
@@ -718,7 +720,8 @@ Options:\n\
|
|||||||
bmw BMW 256\n\
|
bmw BMW 256\n\
|
||||||
c11 Chaincoin\n\
|
c11 Chaincoin\n\
|
||||||
cryptolight Cryptonight-light\n\
|
cryptolight Cryptonight-light\n\
|
||||||
cryptonight cryptonote, Monero (XMR)\n\
|
cryptonight Cryptonote legacy\n\
|
||||||
|
cryptonightv7 variant 7, Monero (XMR)\n\
|
||||||
decred Blake256r14dcr\n\
|
decred Blake256r14dcr\n\
|
||||||
deep Deepcoin (DCN)\n\
|
deep Deepcoin (DCN)\n\
|
||||||
dmd-gr Diamond\n\
|
dmd-gr Diamond\n\
|
||||||
|
@@ -46,16 +46,18 @@ mv cpuminer.exe release/cpuminer-avx2.exe
|
|||||||
#mv cpuminer.exe release/cpuminer-aes-sha.exe
|
#mv cpuminer.exe release/cpuminer-aes-sha.exe
|
||||||
|
|
||||||
|
|
||||||
#make clean || echo clean
|
|
||||||
#rm -f config.status
|
|
||||||
#CFLAGS="-O3 -march=corei7-avx -Wall" ./configure $F
|
|
||||||
#make
|
|
||||||
#strip -s cpuminer.exe
|
|
||||||
#mv cpuminer.exe release/cpuminer-aes-avx.exe
|
|
||||||
|
|
||||||
make clean || echo clean
|
make clean || echo clean
|
||||||
rm -f config.status
|
rm -f config.status
|
||||||
CFLAGS="-O3 -maes -msse4.2 -Wall" ./configure $F
|
CFLAGS="-O3 -march=corei7-avx -Wall" ./configure $F
|
||||||
|
make
|
||||||
|
strip -s cpuminer.exe
|
||||||
|
mv cpuminer.exe release/cpuminer-avx.exe
|
||||||
|
|
||||||
|
# -march=westmere is supported in gcc5
|
||||||
|
make clean || echo clean
|
||||||
|
rm -f config.status
|
||||||
|
CFLAGS="-O3 -march=westmere -Wall" ./configure $F
|
||||||
|
#CFLAGS="-O3 -maes -msse4.2 -Wall" ./configure $F
|
||||||
make
|
make
|
||||||
strip -s cpuminer.exe
|
strip -s cpuminer.exe
|
||||||
mv cpuminer.exe release/cpuminer-aes-sse42.exe
|
mv cpuminer.exe release/cpuminer-aes-sse42.exe
|
||||||
|
Reference in New Issue
Block a user