├── .DS_Store ├── MacMiner.app-1.5.42.zip ├── README.md ├── amdminer_win.cmd ├── amdminer_win ├── API-README.txt ├── API.class ├── ASIC-README.txt ├── AUTHORS.txt ├── COPYING.txt ├── ChangeLog.txt ├── FPGA-README.txt ├── GPU-README.txt ├── MCast.class ├── NEWS.txt ├── README.txt ├── SCRYPT-README.txt ├── api-example.c ├── api-example.php ├── api-example.py ├── cgminer-nogpu.exe ├── cgminer.exe ├── diablo130302.cl ├── diakgcn121016.cl ├── example.conf ├── libcurl-4.dll ├── libeay32.dll ├── libidn-11.dll ├── librtmp.dll ├── libssh2.dll ├── linux-usb-cgminer.txt ├── miner.php ├── phatk121016.cl ├── poclbm130302.cl ├── scrypt130511.cl ├── ssleay32.dll ├── windows-build.txt └── zlib1.dll ├── ccminer-x64-2.2.1-cuda9rc.7z ├── ccminer-x64-2.2.1-cuda9rc └── ccminer-x64-2.2.1 │ ├── README.txt │ ├── RUN-DCR-YIIMP.cmd │ ├── RUN-DNR-YIIMP.bat │ ├── RUN-KMD-YIIMP.bat │ ├── RUN-SIGT-YIIMP.bat │ ├── api │ ├── hwinfo.pl │ ├── index.php │ ├── local-sample.php │ ├── summary.pl │ └── websocket.htm │ ├── ccminer-x64.exe │ ├── ccminer.conf │ └── msvcr120.dll ├── ccminer_win.cmd ├── cg_mac.sh ├── cg_win.cmd ├── cgminer-4.10.0-windows ├── API-README.txt ├── API.class ├── ASIC-README.txt ├── AUTHORS.txt ├── COPYING.txt ├── ChangeLog.txt ├── FPGA-README.txt ├── MCast.class ├── NEWS.txt ├── README.txt ├── api-example.c ├── api-example.php ├── api-example.py ├── api-example.rb ├── cgminer.exe ├── example.conf ├── linux-usb-cgminer.txt ├── miner.php └── windows-build.txt ├── cgminer_366_keccak_win32 ├── cgminer.conf ├── cgminer.exe ├── diablo130302.cl ├── diakgcn121016.cl ├── keccak130718.cl ├── libcurl.dll ├── libeay32.dll ├── libidn-11.dll ├── libpdcurses.dll ├── phatk121016.cl ├── poclbm130302.cl ├── pthreadGC2.dll ├── scrypt130511.cl ├── ssleay32.dll └── zlib1.dll ├── cudamin_win.cmd ├── cudamin_win86.cmd ├── cudaminer ├── .DS_Store ├── LICENSE.txt ├── README.txt ├── cudaminer-src-2014.02.28.zip ├── x64 │ ├── CUDAMINER-START.bat │ ├── cudaminer.exe │ ├── cudart64_55.dll │ └── pthreadVC2.dll └── x86 │ ├── CUDAMINER-START.bat │ ├── cudaminer.exe │ ├── cudart32_55.dll │ └── pthreadVC2.dll ├── epc_minerd_mac.sh ├── linux └── minerd ├── linuxsgminer561 ├── aes_helper.cl ├── alexkarnew.cl ├── alexkarold.cl ├── animecoin.cl ├── arebyp.cl ├── bitblock.cl ├── bitblockold.cl ├── blake.cl ├── blake256.cl ├── blake256r14.cl ├── blake256r8.cl ├── bmw.cl ├── bmw256.cl ├── bufius.cl ├── ckolivas.cl ├── credits.cl ├── cubehash.cl ├── cubehash256.cl ├── darkcoin-mod.cl ├── darkcoin.cl ├── decred.cl ├── diamond.cl ├── echo.cl ├── fresh.cl ├── fugue.cl ├── fuguecoin.cl ├── gost-mod.cl ├── gost.cl ├── groestl.cl ├── groestl256.cl ├── groestlcoin-v1.cl ├── groestlcoin.cl ├── hamsi.cl ├── hamsi_helper.cl ├── hamsi_helper_big.cl ├── inkcoin.cl ├── jh.cl ├── keccak.cl ├── keccak1600.cl ├── lbry.cl ├── luffa.cl ├── lyra2.cl ├── lyra2re.cl ├── lyra2rev2.cl ├── lyra2v2.cl ├── marucoin-mod.cl ├── marucoin-modold.cl ├── marucoin.cl ├── maxcoin.cl ├── myriadcoin-groestl.cl ├── neoscrypt.cl ├── panama.cl ├── pascal.cl ├── pluck.cl ├── psw.cl ├── quarkcoin.cl ├── qubitcoin.cl ├── ripemd160.cl ├── sgminer ├── sha256.cl ├── shabal.cl ├── shavite.cl ├── sia.cl ├── sibcoin-mod.cl ├── sibcoin.cl ├── sifcoin.cl ├── simd.cl ├── skein.cl ├── skein256.cl ├── talkcoin-mod.cl ├── twecoin.cl ├── vanilla.cl ├── whirlcoin.cl ├── whirlpool.cl ├── whirlpoolx.cl ├── wolf-sha512.cl ├── x14.cl ├── x14old.cl ├── yescrypt-multi.cl ├── yescrypt.cl ├── yescrypt_essential.cl └── zuikkis.cl ├── mac └── minerd ├── mac_cgminer-4.3.3 ├── .DS_Store ├── COPYING (cgminer for Mac OS X).txt ├── COPYING (cgminer).txt ├── COPYING (curl).txt ├── COPYING (jansson).txt ├── COPYING (libusb).txt ├── README - mac.rtf ├── cgminer ├── curl ├── curl-config ├── docs │ ├── API-README │ ├── ASIC-README │ ├── AUTHORS │ ├── ChangeLog │ ├── FPGA-README │ ├── INSTALL │ ├── NEWS │ └── README └── lib │ ├── libcurl.4.dylib │ ├── libcurl.a │ ├── libcurl.dylib │ ├── libcurl.la │ ├── libjansson.4.dylib │ ├── libjansson.a │ ├── libjansson.dylib │ ├── libjansson.la │ ├── libusb-1.0.2.dylib │ ├── libusb-1.0.a │ ├── libusb-1.0.dylib │ └── libusb-1.0.la ├── max_cg_win.cmd ├── max_cudamin_win.cmd ├── max_minerd_win.cmd ├── maxcpuminer-win64 ├── README.txt ├── libcurl-4.dll ├── libeay32.dll ├── minerd.exe ├── pthreadGC2.dll ├── ssleay32.dll └── zlib1.dll ├── minerd_linux.sh ├── minerd_mac.sh ├── minerd_win.cmd ├── pooler-cpuminer-2.4.5-win64 ├── libcurl-4.dll ├── libwinpthread-1.dll ├── minerd.exe └── zlib1.dll ├── sgminer_win.cmd ├── sh3cgminer-3.7.3-kalrothmax ├── cgminer.conf ├── cgminer.exe ├── diablo130302.cl ├── diakgcn121016.cl ├── gpumax-cgminer.bat ├── kalroth-changes.txt ├── libcurl.dll ├── libeay32.dll ├── libidn-11.dll ├── libpdcurses.dll ├── phatk121016.cl ├── poclbm130302.cl ├── pthreadGC2.dll ├── scrypt130511.cl ├── scrypt130511_original.cl ├── ssleay32.dll └── zlib1.dll ├── winsgminer561 ├── .DS_Store ├── aes_helper.cl ├── alexkarnew.cl ├── alexkarold.cl ├── animecoin.cl ├── arebyp.cl ├── bitblock.cl ├── bitblockold.cl ├── blake.cl ├── blake256.cl ├── blake256r14.cl ├── blake256r8.cl ├── bmw.cl ├── bmw256.cl ├── bufius.cl ├── ckolivas.cl ├── credits.cl ├── cubehash.cl ├── cubehash256.cl ├── darkcoin-mod.cl ├── darkcoin.cl ├── decred.cl ├── diamond.cl ├── echo.cl ├── fresh.cl ├── fugue.cl ├── fuguecoin.cl ├── gost-mod.cl ├── gost.cl ├── groestl.cl ├── groestl256.cl ├── groestlcoin-v1.cl ├── groestlcoin.cl ├── hamsi.cl ├── hamsi_helper.cl ├── hamsi_helper_big.cl ├── inkcoin.cl ├── jh.cl ├── keccak.cl ├── keccak1600.cl ├── lbry.cl ├── luffa.cl ├── lyra2.cl ├── lyra2re.cl ├── lyra2rev2.cl ├── lyra2v2.cl ├── marucoin-mod.cl ├── marucoin-modold.cl ├── marucoin.cl ├── maxcoin.cl ├── myriadcoin-groestl.cl ├── neoscrypt.cl ├── panama.cl ├── pascal.cl ├── pluck.cl ├── psw.cl ├── quarkcoin.cl ├── qubitcoin.cl ├── ripemd160.cl ├── sgminer.exe ├── sha256.cl ├── shabal.cl ├── shavite.cl ├── sia.cl ├── sibcoin-mod.cl ├── sibcoin.cl ├── sifcoin.cl ├── simd.cl ├── skein.cl ├── skein256.cl ├── talkcoin-mod.cl ├── twecoin.cl ├── vanilla.cl ├── whirlcoin.cl ├── whirlpool.cl ├── whirlpoolx.cl ├── wolf-sha512.cl ├── x14.cl ├── x14old.cl ├── yescrypt-multi.cl ├── yescrypt.cl ├── yescrypt_essential.cl └── zuikkis.cl ├── x11_sgminer_linux.cmd └── x11_sgminer_win.cmd /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/.DS_Store -------------------------------------------------------------------------------- /MacMiner.app-1.5.42.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/MacMiner.app-1.5.42.zip -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #MinerPool 2 | 3 | 虚拟货币三种常用的矿池挖矿方法总结脚本: 4 | 5 | 1 CPU 挖矿 minerd 6 | 7 | sh minerd_linux.sh 8 | minerd_win.cmd 9 | sh minerd_mac.sh 10 | 11 | 12 | 2 A卡挖矿 13 | amdminer_win.cm //cgminer 14 | sgminer_win.cmd 15 | 16 | 17 | 3 N卡挖矿 18 | 19 | cudamin_win.cmd 20 | 21 | 22 | 23 | 4. MAC 电脑上挖矿软件 24 | 25 | MacMiner.app-1.5.42.zip MacMiner需要解压缩安装 26 | 27 | 28 | 在使用以上脚本时,需要修改矿池的地址和矿工 29 | 比如:minerd.exe --timeout=6 --url=stratum+tcp://stratum.aikapool.com:7912 --userpass=aohas.aohas7:888888 30 | 31 | 欢迎访问www.aohas.com 32 | 欢迎来邮件沟通: aohas@outlook.com 33 | -------------------------------------------------------------------------------- /amdminer_win.cmd: -------------------------------------------------------------------------------- 1 | cd cgminer-4.10.0-windows 2 | cgminer --scrypt -I 13 -o stratum+tcp://stratum.aikapool.com:7912 -u aohas.aohas5 -p 888888 -------------------------------------------------------------------------------- /amdminer_win/API.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/amdminer_win/API.class -------------------------------------------------------------------------------- /amdminer_win/AUTHORS.txt: -------------------------------------------------------------------------------- 1 | Current maintainers and active developers: 2 | Main code+ASIC+GPU+SCRYPT+maintainer: Con Kolivas 15qSxP1SQcUX3o4nhkfdbgyoWEFMomJ4rZ 3 | API+USB+FPGA+ASIC: Andrew Smith 1Jjk2LmktEQKnv8r2cZ9MvLiZwZ9gxabKm 4 | 5 | Legacy: 6 | Original CPU mining software: Jeff Garzik 7 | BitFORCE FPGA mining and refactor: Luke Dashjr 1NbRmS6a4dniwHHoSS9v3tEYUpP1Z5VVdL 8 | -------------------------------------------------------------------------------- /amdminer_win/ChangeLog.txt: -------------------------------------------------------------------------------- 1 | See git repository ('git log') for full changelog. 2 | 3 | Git repo can be found at: 4 | https://github.com/ckolivas/cgminer 5 | 6 | The NEWS file contains most of the changelog 7 | -------------------------------------------------------------------------------- /amdminer_win/MCast.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/amdminer_win/MCast.class -------------------------------------------------------------------------------- /amdminer_win/api-example.php: -------------------------------------------------------------------------------- 1 | 0) 71 | { 72 | $items = explode(',', $obj); 73 | $item = $items[0]; 74 | $id = explode('=', $items[0], 2); 75 | if (count($id) == 1 or !ctype_digit($id[1])) 76 | $name = $id[0]; 77 | else 78 | $name = $id[0].$id[1]; 79 | 80 | if (strlen($name) == 0) 81 | $name = 'null'; 82 | 83 | if (isset($data[$name])) 84 | { 85 | $num = 1; 86 | while (isset($data[$name.$num])) 87 | $num++; 88 | $name .= $num; 89 | } 90 | 91 | $counter = 0; 92 | foreach ($items as $item) 93 | { 94 | $id = explode('=', $item, 2); 95 | if (count($id) == 2) 96 | $data[$name][$id[0]] = $id[1]; 97 | else 98 | $data[$name][$counter] = $id[0]; 99 | 100 | $counter++; 101 | } 102 | } 103 | } 104 | 105 | return $data; 106 | } 107 | 108 | return null; 109 | } 110 | # 111 | if (isset($argv) and count($argv) > 1) 112 | $r = request($argv[1]); 113 | else 114 | $r = request('summary'); 115 | # 116 | echo print_r($r, true)."\n"; 117 | # 118 | ?> 119 | -------------------------------------------------------------------------------- /amdminer_win/api-example.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2.7 2 | 3 | # Copyright 2013 Setkeh Mkfr 4 | # 5 | # This program is free software; you can redistribute it and/or modify it under 6 | # the terms of the GNU General Public License as published by the Free Software 7 | # Foundation; either version 3 of the License, or (at your option) any later 8 | # version. See COPYING for more details. 9 | 10 | #Short Python Example for connecting to The Cgminer API 11 | #Written By: setkeh 12 | #Thanks to Jezzz for all his Support. 13 | #NOTE: When adding a param with a pipe | in bash or ZSH you must wrap the arg in quotes 14 | #E.G "pga|0" 15 | 16 | import socket 17 | import json 18 | import sys 19 | 20 | def linesplit(socket): 21 | buffer = socket.recv(4096) 22 | done = False 23 | while not done: 24 | more = socket.recv(4096) 25 | if not more: 26 | done = True 27 | else: 28 | buffer = buffer+more 29 | if buffer: 30 | return buffer 31 | 32 | api_command = sys.argv[1].split('|') 33 | 34 | if len(sys.argv) < 3: 35 | api_ip = '127.0.0.1' 36 | api_port = 4028 37 | else: 38 | api_ip = sys.argv[2] 39 | api_port = sys.argv[3] 40 | 41 | s = socket.socket(socket.AF_INET,socket.SOCK_STREAM) 42 | s.connect((api_ip,int(api_port))) 43 | if len(api_command) == 2: 44 | s.send(json.dumps({"command":api_command[0],"parameter":api_command[1]})) 45 | else: 46 | s.send(json.dumps({"command":api_command[0]})) 47 | 48 | response = linesplit(s) 49 | response = response.replace('\x00','') 50 | response = json.loads(response) 51 | print response 52 | s.close() 53 | -------------------------------------------------------------------------------- /amdminer_win/cgminer-nogpu.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/amdminer_win/cgminer-nogpu.exe -------------------------------------------------------------------------------- /amdminer_win/cgminer.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/amdminer_win/cgminer.exe -------------------------------------------------------------------------------- /amdminer_win/example.conf: -------------------------------------------------------------------------------- 1 | { 2 | "pools" : [ 3 | { 4 | "url" : "http://url1:8332", 5 | "user" : "user1", 6 | "pass" : "pass1" 7 | }, 8 | { 9 | "url" : "http://url2:8344", 10 | "user" : "user2", 11 | "pass" : "pass2" 12 | }, 13 | { 14 | "url" : "http://url3:8332", 15 | "user" : "user3", 16 | "pass" : "pass3" 17 | } 18 | ], 19 | 20 | "intensity" : "d,9,9,9", 21 | "gpu-engine" : "0-985,0-950,0-960,0-1000", 22 | "gpu-fan" : "0-85,0-85,0-85,0-85", 23 | "gpu-memclock" : "860,825,835,875", 24 | "gpu-powertune" : "20,20,20,20", 25 | "temp-cutoff" : "95,95,95,95", 26 | "temp-overheat" : "85,85,85,85", 27 | "temp-target" : "75,75,75,75", 28 | 29 | "auto-fan" : true, 30 | "auto-gpu" : true, 31 | "expiry" : "120", 32 | "failover-only" : true, 33 | "gpu-threads" : "2", 34 | "log" : "5", 35 | "queue" : "1", 36 | "scan-time" : "60", 37 | "temp-hysteresis" : "3", 38 | 39 | "kernel-path" : "/usr/local/bin" 40 | } 41 | -------------------------------------------------------------------------------- /amdminer_win/libcurl-4.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/amdminer_win/libcurl-4.dll -------------------------------------------------------------------------------- /amdminer_win/libeay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/amdminer_win/libeay32.dll -------------------------------------------------------------------------------- /amdminer_win/libidn-11.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/amdminer_win/libidn-11.dll -------------------------------------------------------------------------------- /amdminer_win/librtmp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/amdminer_win/librtmp.dll -------------------------------------------------------------------------------- /amdminer_win/libssh2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/amdminer_win/libssh2.dll -------------------------------------------------------------------------------- /amdminer_win/ssleay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/amdminer_win/ssleay32.dll -------------------------------------------------------------------------------- /amdminer_win/zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/amdminer_win/zlib1.dll -------------------------------------------------------------------------------- /ccminer-x64-2.2.1-cuda9rc.7z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/ccminer-x64-2.2.1-cuda9rc.7z -------------------------------------------------------------------------------- /ccminer-x64-2.2.1-cuda9rc/ccminer-x64-2.2.1/RUN-DCR-YIIMP.cmd: -------------------------------------------------------------------------------- 1 | ccminer-x64 -a decred -o stratum+tcp://yiimp.ccminer.org:4252 -u DsUCcACGcyP8McNMRXQwbtpDxaVUYLDQDeU -p donate,stats,d=8 --cpu-priority 3 --max-log-rate 30 2 | 3 | pause 4 | -------------------------------------------------------------------------------- /ccminer-x64-2.2.1-cuda9rc/ccminer-x64-2.2.1/RUN-DNR-YIIMP.bat: -------------------------------------------------------------------------------- 1 | ccminer-x64 -a tribus -o stratum+tcp://yiimp.ccminer.org:8533 -u DSBX1EZwuqMv5jiqphVLiaMsgSzBHLXgXF -p donate --cpu-priority=3 2 | pause -------------------------------------------------------------------------------- /ccminer-x64-2.2.1-cuda9rc/ccminer-x64-2.2.1/RUN-KMD-YIIMP.bat: -------------------------------------------------------------------------------- 1 | ccminer-x64 -a equihash -o stratum+tcp://yiimp.ccminer.org:2142 -u RLz5eeiuwDi7nz7owbMButBz8rCMZPbxb4 -p c=KMD,d=32 --cpu-priority=3 2 | pause -------------------------------------------------------------------------------- /ccminer-x64-2.2.1-cuda9rc/ccminer-x64-2.2.1/RUN-SIGT-YIIMP.bat: -------------------------------------------------------------------------------- 1 | ccminer-x64 -a skunk -o stratum+tcp://yiimp.ccminer.org:8433 -u B8UDvo5JwTdUh4yPwpA61hGrWhdbGsPfGd -p donate --cpu-priority=3 2 | pause -------------------------------------------------------------------------------- /ccminer-x64-2.2.1-cuda9rc/ccminer-x64-2.2.1/api/hwinfo.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # sample script to query ccminer API 4 | 5 | my $command = "hwinfo|"; 6 | 7 | use Socket; 8 | use IO::Socket::INET; 9 | 10 | my $sock = new IO::Socket::INET ( 11 | PeerAddr => '127.0.0.1', 12 | PeerPort => 4068, 13 | Proto => 'tcp', 14 | ReuseAddr => 1, 15 | Timeout => 10, 16 | ); 17 | 18 | if ($sock) { 19 | 20 | print $sock $command; 21 | my $res = ""; 22 | 23 | while(<$sock>) { 24 | $res .= $_; 25 | } 26 | 27 | close($sock); 28 | print("$res\n"); 29 | 30 | } else { 31 | 32 | print("ccminer socket failed\n"); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /ccminer-x64-2.2.1-cuda9rc/ccminer-x64-2.2.1/api/local-sample.php: -------------------------------------------------------------------------------- 1 | 0) { 27 | $err = socket_last_error($socket); 28 | echo "."; 29 | if ($timeout > 1 && ($err == 115 || $err == 114)) { 30 | $timeout--; 31 | usleep(50); 32 | $res = socket_connect($socket, API_HOST, $port); 33 | continue; 34 | } 35 | $error = socket_strerror($err); 36 | $msg = "socket connect($port) failed"; 37 | echo "ERR: $msg '$error'\n"; 38 | socket_close($socket); 39 | return NULL; 40 | } 41 | 42 | socket_set_block($socket); 43 | 44 | return $socket; 45 | } 46 | 47 | function readsockline($socket) 48 | { 49 | $line = ''; 50 | while (true) { 51 | $byte = socket_read($socket, 1); 52 | if ($byte === false || $byte === '') 53 | break; 54 | if ($byte === "\0") 55 | break; 56 | $line .= $byte; 57 | } 58 | return $line; 59 | } 60 | 61 | 62 | function request($cmd) 63 | { 64 | $socket = getsock(API_PORT); 65 | if ($socket == null) 66 | return NULL; 67 | 68 | socket_write($socket, $cmd, strlen($cmd)); 69 | $line = readsockline($socket); 70 | socket_close($socket); 71 | 72 | if (strlen($line) == 0) { 73 | echo "WARN: '$cmd' returned nothing\n"; 74 | return $line; 75 | } 76 | 77 | echo "$cmd returned '$line'\n"; 78 | 79 | $data = array(); 80 | 81 | $objs = explode('|', $line); 82 | foreach ($objs as $obj) 83 | { 84 | if (strlen($obj) > 0) 85 | { 86 | $items = explode(';', $obj); 87 | $item = $items[0]; 88 | $id = explode('=', $items[0], 2); 89 | if (count($id) == 1) 90 | $name = $id[0]; 91 | else 92 | $name = $id[0].$id[1]; 93 | 94 | if (strlen($name) == 0) 95 | $name = 'null'; 96 | 97 | if (isset($data[$name])) { 98 | $num = 1; 99 | while (isset($data[$name.$num])) 100 | $num++; 101 | $name .= $num; 102 | } 103 | 104 | $counter = 0; 105 | foreach ($items as $item) 106 | { 107 | $id = explode('=', $item, 2); 108 | if (count($id) == 2) 109 | $data[$name][$id[0]] = $id[1]; 110 | else 111 | $data[$name][$counter] = $id[0]; 112 | 113 | $counter++; 114 | } 115 | 116 | } 117 | } 118 | if ($cmd == 'summary') 119 | return array_pop($data); 120 | else 121 | return $data; 122 | } 123 | 124 | ob_start(); 125 | 126 | error_reporting(0); 127 | 128 | $summary = request('summary'); 129 | $threads = request('threads'); 130 | $pool = request('pool'); 131 | 132 | ob_end_clean(); /* swap to debug */ 133 | //echo ob_get_clean()."\n"; 134 | 135 | header("Content-Type: application/json"); 136 | echo json_encode(compact('summary', 'threads', 'pool'))."\n"; 137 | ?> 138 | -------------------------------------------------------------------------------- /ccminer-x64-2.2.1-cuda9rc/ccminer-x64-2.2.1/api/summary.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # sample script to query ccminer API 4 | 5 | my $command = "summary|"; 6 | 7 | use Socket; 8 | use IO::Socket::INET; 9 | 10 | my $sock = new IO::Socket::INET ( 11 | PeerAddr => '127.0.0.1', 12 | PeerPort => 4068, 13 | Proto => 'tcp', 14 | ReuseAddr => 1, 15 | Timeout => 10, 16 | ); 17 | 18 | if ($sock) { 19 | 20 | print $sock $command; 21 | my $res = ""; 22 | 23 | while(<$sock>) { 24 | $res .= $_; 25 | } 26 | 27 | close($sock); 28 | print("$res\n"); 29 | 30 | } else { 31 | 32 | print("ccminer socket failed\n"); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /ccminer-x64-2.2.1-cuda9rc/ccminer-x64-2.2.1/api/websocket.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 129 | 130 | 131 | -------------------------------------------------------------------------------- /ccminer-x64-2.2.1-cuda9rc/ccminer-x64-2.2.1/ccminer-x64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/ccminer-x64-2.2.1-cuda9rc/ccminer-x64-2.2.1/ccminer-x64.exe -------------------------------------------------------------------------------- /ccminer-x64-2.2.1-cuda9rc/ccminer-x64-2.2.1/ccminer.conf: -------------------------------------------------------------------------------- 1 | { 2 | "_comment1" : "Possible keys are the long options (ccminer --help)", 3 | "_comment2" : "todo: support /* comments */", 4 | 5 | "api-bind": "127.0.0.1:4068", 6 | "statsavg": 20, 7 | 8 | "quiet" : false, 9 | "debug" : false, 10 | "protocol" : false, 11 | "cpu-priority" : 3, 12 | 13 | "algo" : "cryptonight", 14 | 15 | "launch-config" : "32x16", 16 | 17 | "url" : "stratum+tcp://xmr.suprnova.cc:5222", 18 | "user" : "tpruvot.donate", 19 | "pass" : "x" 20 | } 21 | -------------------------------------------------------------------------------- /ccminer-x64-2.2.1-cuda9rc/ccminer-x64-2.2.1/msvcr120.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/ccminer-x64-2.2.1-cuda9rc/ccminer-x64-2.2.1/msvcr120.dll -------------------------------------------------------------------------------- /ccminer_win.cmd: -------------------------------------------------------------------------------- 1 | cd ccminer-x64-2.2.1-cuda9rc/ccminer-x64-2.2.1 2 | ccminer-x64 -o stratum+tcp://stratum.aikapool.com:7917 -u aohas.aohas11 -p 888888 3 | -------------------------------------------------------------------------------- /cg_mac.sh: -------------------------------------------------------------------------------- 1 | cd mac_cgminer-4.3.3 2 | ./cgminer -o stratum+tcp://stratum.aikapool.com:7912 -u aohas.aohas3 -p 888888 -------------------------------------------------------------------------------- /cg_win.cmd: -------------------------------------------------------------------------------- 1 | cd cgminer-4.10.0-windows 2 | cgminer -o stratum+tcp://stratum.aikapool.com:7917 -u aohas.aohas3 -p 888888 -------------------------------------------------------------------------------- /cgminer-4.10.0-windows/API.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/cgminer-4.10.0-windows/API.class -------------------------------------------------------------------------------- /cgminer-4.10.0-windows/AUTHORS.txt: -------------------------------------------------------------------------------- 1 | Current maintainers and active developers: 2 | Main code+USB+ASIC+maintainer: Con Kolivas 15qSxP1SQcUX3o4nhkfdbgyoWEFMomJ4rZ 3 | API+USB+FPGA+ASIC: Andrew Smith 1Jjk2LmktEQKnv8r2cZ9MvLiZwZ9gxabKm 4 | 5 | Legacy: 6 | Original CPU mining software: Jeff Garzik 7 | BitFORCE FPGA mining and refactor: Luke Dashjr 1NbRmS6a4dniwHHoSS9v3tEYUpP1Z5VVdL 8 | -------------------------------------------------------------------------------- /cgminer-4.10.0-windows/ChangeLog.txt: -------------------------------------------------------------------------------- 1 | See git repository ('git log') for full changelog. 2 | 3 | Git repo can be found at: 4 | https://github.com/ckolivas/cgminer 5 | 6 | The NEWS file contains most of the changelog 7 | -------------------------------------------------------------------------------- /cgminer-4.10.0-windows/MCast.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/cgminer-4.10.0-windows/MCast.class -------------------------------------------------------------------------------- /cgminer-4.10.0-windows/api-example.php: -------------------------------------------------------------------------------- 1 | 0) 71 | { 72 | $items = explode(',', $obj); 73 | $item = $items[0]; 74 | $id = explode('=', $items[0], 2); 75 | if (count($id) == 1 or !ctype_digit($id[1])) 76 | $name = $id[0]; 77 | else 78 | $name = $id[0].$id[1]; 79 | 80 | if (strlen($name) == 0) 81 | $name = 'null'; 82 | 83 | if (isset($data[$name])) 84 | { 85 | $num = 1; 86 | while (isset($data[$name.$num])) 87 | $num++; 88 | $name .= $num; 89 | } 90 | 91 | $counter = 0; 92 | foreach ($items as $item) 93 | { 94 | $id = explode('=', $item, 2); 95 | if (count($id) == 2) 96 | $data[$name][$id[0]] = $id[1]; 97 | else 98 | $data[$name][$counter] = $id[0]; 99 | 100 | $counter++; 101 | } 102 | } 103 | } 104 | 105 | return $data; 106 | } 107 | 108 | return null; 109 | } 110 | # 111 | if (isset($argv) and count($argv) > 1) 112 | $r = request($argv[1]); 113 | else 114 | $r = request('summary'); 115 | # 116 | echo print_r($r, true)."\n"; 117 | # 118 | ?> 119 | -------------------------------------------------------------------------------- /cgminer-4.10.0-windows/api-example.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2.7 2 | 3 | # Copyright 2013 Setkeh Mkfr 4 | # 5 | # This program is free software; you can redistribute it and/or modify it under 6 | # the terms of the GNU General Public License as published by the Free Software 7 | # Foundation; either version 3 of the License, or (at your option) any later 8 | # version. See COPYING for more details. 9 | 10 | #Short Python Example for connecting to The Cgminer API 11 | #Written By: setkeh 12 | #Thanks to Jezzz for all his Support. 13 | #NOTE: When adding a param with a pipe | in bash or ZSH you must wrap the arg in quotes 14 | #E.G "pga|0" 15 | 16 | import socket 17 | import json 18 | import sys 19 | 20 | def linesplit(socket): 21 | buffer = socket.recv(4096) 22 | done = False 23 | while not done: 24 | more = socket.recv(4096) 25 | if not more: 26 | done = True 27 | else: 28 | buffer = buffer+more 29 | if buffer: 30 | return buffer 31 | 32 | api_command = sys.argv[1].split('|') 33 | 34 | if len(sys.argv) < 3: 35 | api_ip = '127.0.0.1' 36 | api_port = 4028 37 | else: 38 | api_ip = sys.argv[2] 39 | api_port = sys.argv[3] 40 | 41 | s = socket.socket(socket.AF_INET,socket.SOCK_STREAM) 42 | s.connect((api_ip,int(api_port))) 43 | if len(api_command) == 2: 44 | s.send(json.dumps({"command":api_command[0],"parameter":api_command[1]})) 45 | else: 46 | s.send(json.dumps({"command":api_command[0]})) 47 | 48 | response = linesplit(s) 49 | response = response.replace('\x00','') 50 | response = json.loads(response) 51 | print response 52 | s.close() 53 | -------------------------------------------------------------------------------- /cgminer-4.10.0-windows/api-example.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # Copyright 2014 James Hilliard 4 | # 5 | # This program is free software; you can redistribute it and/or modify it under 6 | # the terms of the GNU General Public License as published by the Free Software 7 | # Foundation; either version 3 of the License, or (at your option) any later 8 | # version. See COPYING for more details. 9 | 10 | require 'socket' 11 | require 'json' 12 | 13 | api_command = ARGV[0].split(":") 14 | 15 | if ARGV.length == 3 16 | api_ip = ARGV[1] 17 | api_port = ARGV[2] 18 | elsif ARGV.length == 2 19 | api_ip = ARGV[1] 20 | api_port = 4028 21 | else 22 | api_ip = "127.0.0.1" 23 | api_port = 4028 24 | end 25 | 26 | s = TCPSocket.open(api_ip, api_port) 27 | 28 | if api_command.count == 2 29 | s.write({ :command => api_command[0], :parameter => api_command[1]}.to_json) 30 | else 31 | s.write({ :command => api_command[0]}.to_json) 32 | end 33 | 34 | response = s.read.strip 35 | response = JSON.parse(response) 36 | 37 | puts response 38 | s.close 39 | -------------------------------------------------------------------------------- /cgminer-4.10.0-windows/cgminer.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/cgminer-4.10.0-windows/cgminer.exe -------------------------------------------------------------------------------- /cgminer-4.10.0-windows/example.conf: -------------------------------------------------------------------------------- 1 | { 2 | "pools" : [ 3 | { 4 | "url" : "http://url1:8332", 5 | "user" : "user1", 6 | "pass" : "pass1" 7 | }, 8 | { 9 | "url" : "http://url2:8344", 10 | "user" : "user2", 11 | "pass" : "pass2" 12 | }, 13 | { 14 | "url" : "http://url3:8332", 15 | "user" : "user3", 16 | "pass" : "pass3" 17 | } 18 | ], 19 | 20 | "failover-only" : true, 21 | "no-submit-stale" : true, 22 | "api-listen" : true, 23 | "api-port" : "4028", 24 | "api-allow" : "W:192.168.1.0/24,W:127.0.0.1" 25 | } 26 | -------------------------------------------------------------------------------- /cgminer_366_keccak_win32/cgminer.conf: -------------------------------------------------------------------------------- 1 | { 2 | "pools" : [ 3 | { 4 | "name" : "miningpoolhub", 5 | "url" : "stratum+tcp://hub.miningpoolhub.com:20461", 6 | "user" : "aohas.aohas4", 7 | "pass" : "888888" 8 | } 9 | ], 10 | "gpu-threads" : "1", 11 | "intensity" : "9", 12 | "temp-cutoff" : "90", 13 | "worksize" : "64", 14 | "keccak" : true 15 | } -------------------------------------------------------------------------------- /cgminer_366_keccak_win32/cgminer.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/cgminer_366_keccak_win32/cgminer.exe -------------------------------------------------------------------------------- /cgminer_366_keccak_win32/keccak130718.cl: -------------------------------------------------------------------------------- 1 | #define ARGS_25(x) x ## 0, x ## 1, x ## 2, x ## 3, x ## 4, x ## 5, x ## 6, x ## 7, x ## 8, x ## 9, x ## 10, x ## 11, x ## 12, x ## 13, x ## 14, x ## 15, x ## 16, x ## 17, x ## 18, x ## 19, x ## 20, x ## 21, x ## 22, x ## 23, x ## 24 2 | #define FOUND (0x0F) 3 | #define SETFOUND(Xnonce) output[output[FOUND]++] = Xnonce 4 | 5 | __constant uint2 keccak_round_constants[24] = 6 | { 7 | (uint2)(0x00000001,0x00000000), (uint2)(0x00008082,0x00000000), 8 | (uint2)(0x0000808a,0x80000000), (uint2)(0x80008000,0x80000000), 9 | (uint2)(0x0000808b,0x00000000), (uint2)(0x80000001,0x00000000), 10 | (uint2)(0x80008081,0x80000000), (uint2)(0x00008009,0x80000000), 11 | (uint2)(0x0000008a,0x00000000), (uint2)(0x00000088,0x00000000), 12 | (uint2)(0x80008009,0x00000000), (uint2)(0x8000000a,0x00000000), 13 | (uint2)(0x8000808b,0x00000000), (uint2)(0x0000008b,0x80000000), 14 | (uint2)(0x00008089,0x80000000), (uint2)(0x00008003,0x80000000), 15 | (uint2)(0x00008002,0x80000000), (uint2)(0x00000080,0x80000000), 16 | (uint2)(0x0000800a,0x00000000), (uint2)(0x8000000a,0x80000000), 17 | (uint2)(0x80008081,0x80000000), (uint2)(0x00008080,0x80000000), 18 | (uint2)(0x80000001,0x00000000), (uint2)(0x80008008,0x80000000) 19 | }; 20 | 21 | uint2 ROTL64_1(const uint2 x, const uint y) 22 | { 23 | return (uint2)((x.x<>(32-y)),(x.y<>(32-y))); 24 | } 25 | uint2 ROTL64_2(const uint2 x, const uint y) 26 | { 27 | return (uint2)((x.y<>(32-y)),(x.x<>(32-y))); 28 | } 29 | 30 | #define RND(i) \ 31 | m0 = *s0 ^ *s5 ^ *s10 ^ *s15 ^ *s20 ^ ROTL64_1(*s2 ^ *s7 ^ *s12 ^ *s17 ^ *s22, 1);\ 32 | m1 = *s1 ^ *s6 ^ *s11 ^ *s16 ^ *s21 ^ ROTL64_1(*s3 ^ *s8 ^ *s13 ^ *s18 ^ *s23, 1);\ 33 | m2 = *s2 ^ *s7 ^ *s12 ^ *s17 ^ *s22 ^ ROTL64_1(*s4 ^ *s9 ^ *s14 ^ *s19 ^ *s24, 1);\ 34 | m3 = *s3 ^ *s8 ^ *s13 ^ *s18 ^ *s23 ^ ROTL64_1(*s0 ^ *s5 ^ *s10 ^ *s15 ^ *s20, 1);\ 35 | m4 = *s4 ^ *s9 ^ *s14 ^ *s19 ^ *s24 ^ ROTL64_1(*s1 ^ *s6 ^ *s11 ^ *s16 ^ *s21, 1);\ 36 | m5 = *s1^m0;\ 37 | \ 38 | *s0 ^= m4;\ 39 | *s1 = ROTL64_2(*s6^m0, 12);\ 40 | *s6 = ROTL64_1(*s9^m3, 20);\ 41 | *s9 = ROTL64_2(*s22^m1, 29);\ 42 | *s22 = ROTL64_2(*s14^m3, 7);\ 43 | *s14 = ROTL64_1(*s20^m4, 18);\ 44 | *s20 = ROTL64_2(*s2^m1, 30);\ 45 | *s2 = ROTL64_2(*s12^m1, 11);\ 46 | *s12 = ROTL64_1(*s13^m2, 25);\ 47 | *s13 = ROTL64_1(*s19^m3, 8);\ 48 | *s19 = ROTL64_2(*s23^m2, 24);\ 49 | *s23 = ROTL64_2(*s15^m4, 9);\ 50 | *s15 = ROTL64_1(*s4^m3, 27);\ 51 | *s4 = ROTL64_1(*s24^m3, 14);\ 52 | *s24 = ROTL64_1(*s21^m0, 2);\ 53 | *s21 = ROTL64_2(*s8^m2, 23);\ 54 | *s8 = ROTL64_2(*s16^m0, 13);\ 55 | *s16 = ROTL64_2(*s5^m4, 4);\ 56 | *s5 = ROTL64_1(*s3^m2, 28);\ 57 | *s3 = ROTL64_1(*s18^m2, 21);\ 58 | *s18 = ROTL64_1(*s17^m1, 15);\ 59 | *s17 = ROTL64_1(*s11^m0, 10);\ 60 | *s11 = ROTL64_1(*s7^m1, 6);\ 61 | *s7 = ROTL64_1(*s10^m4, 3);\ 62 | *s10 = ROTL64_1(m5, 1);\ 63 | \ 64 | m5 = *s0; m6 = *s1; *s0 = bitselect(*s0^*s2,*s0,*s1); *s1 = bitselect(*s1^*s3,*s1,*s2); *s2 = bitselect(*s2^*s4,*s2,*s3); *s3 = bitselect(*s3^m5,*s3,*s4); *s4 = bitselect(*s4^m6,*s4,m5);\ 65 | m5 = *s5; m6 = *s6; *s5 = bitselect(*s5^*s7,*s5,*s6); *s6 = bitselect(*s6^*s8,*s6,*s7); *s7 = bitselect(*s7^*s9,*s7,*s8); *s8 = bitselect(*s8^m5,*s8,*s9); *s9 = bitselect(*s9^m6,*s9,m5);\ 66 | m5 = *s10; m6 = *s11; *s10 = bitselect(*s10^*s12,*s10,*s11); *s11 = bitselect(*s11^*s13,*s11,*s12); *s12 = bitselect(*s12^*s14,*s12,*s13); *s13 = bitselect(*s13^m5,*s13,*s14); *s14 = bitselect(*s14^m6,*s14,m5);\ 67 | m5 = *s15; m6 = *s16; *s15 = bitselect(*s15^*s17,*s15,*s16); *s16 = bitselect(*s16^*s18,*s16,*s17); *s17 = bitselect(*s17^*s19,*s17,*s18); *s18 = bitselect(*s18^m5,*s18,*s19); *s19 = bitselect(*s19^m6,*s19,m5);\ 68 | m5 = *s20; m6 = *s21; *s20 = bitselect(*s20^*s22,*s20,*s21); *s21 = bitselect(*s21^*s23,*s21,*s22); *s22 = bitselect(*s22^*s24,*s22,*s23); *s23 = bitselect(*s23^m5,*s23,*s24); *s24 = bitselect(*s24^m6,*s24,m5);\ 69 | \ 70 | *s0 ^= keccak_round_constants[i]; 71 | 72 | void keccak_block_noabsorb(ARGS_25(uint2* s)) 73 | { 74 | uint2 m0,m1,m2,m3,m4,m5,m6; 75 | RND(0); 76 | RND(1); 77 | RND(2); 78 | RND(3); 79 | RND(4); 80 | RND(5); 81 | RND(6); 82 | RND(7); 83 | RND(8); 84 | RND(9); 85 | RND(10); 86 | RND(11); 87 | RND(12); 88 | RND(13); 89 | RND(14); 90 | RND(15); 91 | RND(16); 92 | RND(17); 93 | RND(18); 94 | RND(19); 95 | RND(20); 96 | RND(21); 97 | RND(22); 98 | RND(23); 99 | } 100 | 101 | __attribute__((reqd_work_group_size(WORKSIZE, 1, 1))) 102 | __kernel void search(__global const uint2*restrict in, __global uint*restrict output) 103 | { 104 | uint2 ARGS_25(state); 105 | 106 | state0 = in[0]; 107 | state1 = in[1]; 108 | state2 = in[2]; 109 | state3 = in[3]; 110 | state4 = in[4]; 111 | state5 = in[5]; 112 | state6 = in[6]; 113 | state7 = in[7]; 114 | state8 = in[8]; 115 | state9 = (uint2)(in[9].x,get_global_id(0)); 116 | state10 = (uint2)(1,0); 117 | state11 = 0; 118 | state12 = 0; 119 | state13 = 0; 120 | state14 = 0; 121 | state15 = 0; 122 | state16 = (uint2)(0,0x80000000U); 123 | state17 = 0; 124 | state18 = 0; 125 | state19 = 0; 126 | state20 = 0; 127 | state21 = 0; 128 | state22 = 0; 129 | state23 = 0; 130 | state24 = 0; 131 | 132 | keccak_block_noabsorb(ARGS_25(&state)); 133 | 134 | state4 = (uint2)(1,0); 135 | state5 = 0; 136 | state6 = 0; 137 | state7 = 0; 138 | state8 = 0; 139 | state9 = 0; 140 | state10 = 0; 141 | state11 = 0; 142 | state12 = 0; 143 | state13 = 0; 144 | state14 = 0; 145 | state15 = 0; 146 | state16 = (uint2)(0,0x80000000U); 147 | state17 = 0; 148 | state18 = 0; 149 | state19 = 0; 150 | state20 = 0; 151 | state21 = 0; 152 | state22 = 0; 153 | state23 = 0; 154 | state24 = 0; 155 | 156 | keccak_block_noabsorb(ARGS_25(&state)); 157 | 158 | if (state3.y == 0) 159 | { 160 | SETFOUND(get_global_id(0)); 161 | } 162 | } -------------------------------------------------------------------------------- /cgminer_366_keccak_win32/libcurl.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/cgminer_366_keccak_win32/libcurl.dll -------------------------------------------------------------------------------- /cgminer_366_keccak_win32/libeay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/cgminer_366_keccak_win32/libeay32.dll -------------------------------------------------------------------------------- /cgminer_366_keccak_win32/libidn-11.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/cgminer_366_keccak_win32/libidn-11.dll -------------------------------------------------------------------------------- /cgminer_366_keccak_win32/libpdcurses.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/cgminer_366_keccak_win32/libpdcurses.dll -------------------------------------------------------------------------------- /cgminer_366_keccak_win32/pthreadGC2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/cgminer_366_keccak_win32/pthreadGC2.dll -------------------------------------------------------------------------------- /cgminer_366_keccak_win32/ssleay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/cgminer_366_keccak_win32/ssleay32.dll -------------------------------------------------------------------------------- /cgminer_366_keccak_win32/zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/cgminer_366_keccak_win32/zlib1.dll -------------------------------------------------------------------------------- /cudamin_win.cmd: -------------------------------------------------------------------------------- 1 | cd cudaminer/x64 2 | cudaminer -o stratum+tcp://stratum.aikapool.com:7917 -u aohas.aohas5 -p 888888 3 | -------------------------------------------------------------------------------- /cudamin_win86.cmd: -------------------------------------------------------------------------------- 1 | cd cudaminer/x86 2 | cudaminer -o stratum+tcp://stratum.aikapool.com:7917 -u aohas.aohas5 -p 888888 3 | -------------------------------------------------------------------------------- /cudaminer/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/cudaminer/.DS_Store -------------------------------------------------------------------------------- /cudaminer/cudaminer-src-2014.02.28.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/cudaminer/cudaminer-src-2014.02.28.zip -------------------------------------------------------------------------------- /cudaminer/x64/CUDAMINER-START.bat: -------------------------------------------------------------------------------- 1 | cudaminer.exe --algo=scrypt:2048 -o stratum+tcp://scryptnf.eu.nicehash.com:3335 -u 14vZ4DHDzhttzKyNAmLzpRq6VLmCGb16vX -p password -i 0 -l T10x20 -C 1 -H 2 -------------------------------------------------------------------------------- /cudaminer/x64/cudaminer.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/cudaminer/x64/cudaminer.exe -------------------------------------------------------------------------------- /cudaminer/x64/cudart64_55.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/cudaminer/x64/cudart64_55.dll -------------------------------------------------------------------------------- /cudaminer/x64/pthreadVC2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/cudaminer/x64/pthreadVC2.dll -------------------------------------------------------------------------------- /cudaminer/x86/CUDAMINER-START.bat: -------------------------------------------------------------------------------- 1 | cudaminer.exe --algo=scrypt:2048 -o stratum+tcp://scryptnf.eu.nicehash.com:3335 -u 14vZ4DHDzhttzKyNAmLzpRq6VLmCGb16vX -p password -i 0 -l T10x20 -C 1 -H 2 -------------------------------------------------------------------------------- /cudaminer/x86/cudaminer.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/cudaminer/x86/cudaminer.exe -------------------------------------------------------------------------------- /cudaminer/x86/cudart32_55.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/cudaminer/x86/cudart32_55.dll -------------------------------------------------------------------------------- /cudaminer/x86/pthreadVC2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/cudaminer/x86/pthreadVC2.dll -------------------------------------------------------------------------------- /epc_minerd_mac.sh: -------------------------------------------------------------------------------- 1 | mac/minerd --timeout=6 --url=stratum+tcp://epcmining.com:3333 --userpass=aohas.aohas5:888888 2 | -------------------------------------------------------------------------------- /linux/minerd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/linux/minerd -------------------------------------------------------------------------------- /linuxsgminer561/blake256.cl: -------------------------------------------------------------------------------- 1 | /* 2 | * blake256 kernel implementation. 3 | * 4 | * ==========================(LICENSE BEGIN)============================ 5 | * Copyright (c) 2014 djm34 6 | * Copyright (c) 2014 tpruvot 7 | * Permission is hereby granted, free of charge, to any person obtaining 8 | * a copy of this software and associated documentation files (the 9 | * "Software"), to deal in the Software without restriction, including 10 | * without limitation the rights to use, copy, modify, merge, publish, 11 | * distribute, sublicense, and/or sell copies of the Software, and to 12 | * permit persons to whom the Software is furnished to do so, subject to 13 | * the following conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be 16 | * included in all copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | * 26 | * ===========================(LICENSE END)============================= 27 | * 28 | * @author djm34 29 | */ 30 | __constant static const int sigma[16][16] = { 31 | { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, 32 | { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, 33 | { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, 34 | { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, 35 | { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, 36 | { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 }, 37 | { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 }, 38 | { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 }, 39 | { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 }, 40 | { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0 }, 41 | { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, 42 | { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, 43 | { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, 44 | { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, 45 | { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, 46 | { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } 47 | }; 48 | 49 | 50 | __constant static const sph_u32 c_IV256[8] = { 51 | 0x6A09E667, 0xBB67AE85, 52 | 0x3C6EF372, 0xA54FF53A, 53 | 0x510E527F, 0x9B05688C, 54 | 0x1F83D9AB, 0x5BE0CD19 55 | }; 56 | 57 | /* Second part (64-80) msg never change, store it */ 58 | __constant static const sph_u32 c_Padding[16] = { 59 | 0, 0, 0, 0, 60 | 0x80000000, 0, 0, 0, 61 | 0, 0, 0, 0, 62 | 0, 1, 0, 640, 63 | }; 64 | __constant static const sph_u32 c_u256[16] = { 65 | 0x243F6A88, 0x85A308D3, 66 | 0x13198A2E, 0x03707344, 67 | 0xA4093822, 0x299F31D0, 68 | 0x082EFA98, 0xEC4E6C89, 69 | 0x452821E6, 0x38D01377, 70 | 0xBE5466CF, 0x34E90C6C, 71 | 0xC0AC29B7, 0xC97C50DD, 72 | 0x3F84D5B5, 0xB5470917 73 | }; 74 | 75 | #define GS(a,b,c,d,x) { \ 76 | const sph_u32 idx1 = sigma[r][x]; \ 77 | const sph_u32 idx2 = sigma[r][x+1]; \ 78 | v[a] += (m[idx1] ^ c_u256[idx2]) + v[b]; \ 79 | v[d] ^= v[a]; \ 80 | v[d] = SPH_ROTR32(v[d], 16); \ 81 | v[c] += v[d]; \ 82 | v[b] ^= v[c]; \ 83 | v[b] = SPH_ROTR32(v[b], 12); \ 84 | \ 85 | v[a] += (m[idx2] ^ c_u256[idx1]) + v[b]; \ 86 | v[d] ^= v[a]; \ 87 | v[d] = SPH_ROTR32(v[d], 8); \ 88 | v[c] += v[d]; \ 89 | v[b] ^= v[c]; \ 90 | v[b] = SPH_ROTR32(v[b], 7); \ 91 | } 92 | 93 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /linuxsgminer561/cubehash256.cl: -------------------------------------------------------------------------------- 1 | // cubehash256 2 | // djm34 2015 based on ccminer cubehash512 3 | 4 | #define CUBEHASH_ROUNDS 16 /* this is r for CubeHashr/b */ 5 | #define CUBEHASH_BLOCKBYTES 32 /* this is b for CubeHashr/b */ 6 | 7 | 8 | #define LROT(x, bits) rotate( x,(uint) bits) 9 | 10 | 11 | #define ROTATEUPWARDS7(a) LROT(a,7) 12 | #define ROTATEUPWARDS11(a) LROT(a,11) 13 | 14 | #define SWAP(a,b) { uint u = a; a = b; b = u; } 15 | 16 | inline void rrounds(uint x[2][2][2][2][2]) 17 | { 18 | int r; 19 | int j; 20 | int k; 21 | int l; 22 | int m; 23 | 24 | //#pragma unroll 2 25 | for (r = 0; r < CUBEHASH_ROUNDS; ++r) { 26 | 27 | /* "add x_0jklm into x_1jklmn modulo 2^32" */ 28 | //#pragma unroll 2 29 | for (j = 0; j < 2; ++j) 30 | //#pragma unroll 2 31 | for (k = 0; k < 2; ++k) 32 | //#pragma unroll 2 33 | for (l = 0; l < 2; ++l) 34 | //#pragma unroll 2 35 | for (m = 0; m < 2; ++m) 36 | x[1][j][k][l][m] += x[0][j][k][l][m]; 37 | 38 | /* "rotate x_0jklm upwards by 7 bits" */ 39 | //#pragma unroll 2 40 | for (j = 0; j < 2; ++j) 41 | //#pragma unroll 2 42 | for (k = 0; k < 2; ++k) 43 | //#pragma unroll 2 44 | for (l = 0; l < 2; ++l) 45 | //#pragma unroll 2 46 | for (m = 0; m < 2; ++m) 47 | x[0][j][k][l][m] = ROTATEUPWARDS7(x[0][j][k][l][m]); 48 | 49 | /* "swap x_00klm with x_01klm" */ 50 | //#pragma unroll 2 51 | for (k = 0; k < 2; ++k) 52 | //#pragma unroll 2 53 | for (l = 0; l < 2; ++l) 54 | //#pragma unroll 2 55 | for (m = 0; m < 2; ++m) 56 | SWAP(x[0][0][k][l][m], x[0][1][k][l][m]) 57 | 58 | /* "xor x_1jklm into x_0jklm" */ 59 | //#pragma unroll 2 60 | for (j = 0; j < 2; ++j) 61 | //#pragma unroll 2 62 | for (k = 0; k < 2; ++k) 63 | //#pragma unroll 2 64 | for (l = 0; l < 2; ++l) 65 | //#pragma unroll 2 66 | for (m = 0; m < 2; ++m) 67 | x[0][j][k][l][m] ^= x[1][j][k][l][m]; 68 | 69 | /* "swap x_1jk0m with x_1jk1m" */ 70 | //#pragma unroll 2 71 | for (j = 0; j < 2; ++j) 72 | //#pragma unroll 2 73 | for (k = 0; k < 2; ++k) 74 | //#pragma unroll 2 75 | for (m = 0; m < 2; ++m) 76 | SWAP(x[1][j][k][0][m], x[1][j][k][1][m]) 77 | 78 | /* "add x_0jklm into x_1jklm modulo 2^32" */ 79 | //#pragma unroll 2 80 | for (j = 0; j < 2; ++j) 81 | //#pragma unroll 2 82 | for (k = 0; k < 2; ++k) 83 | //#pragma unroll 2 84 | for (l = 0; l < 2; ++l) 85 | //#pragma unroll 2 86 | for (m = 0; m < 2; ++m) 87 | x[1][j][k][l][m] += x[0][j][k][l][m]; 88 | 89 | /* "rotate x_0jklm upwards by 11 bits" */ 90 | //#pragma unroll 2 91 | for (j = 0; j < 2; ++j) 92 | //#pragma unroll 2 93 | for (k = 0; k < 2; ++k) 94 | //#pragma unroll 2 95 | for (l = 0; l < 2; ++l) 96 | //#pragma unroll 2 97 | for (m = 0; m < 2; ++m) 98 | x[0][j][k][l][m] = ROTATEUPWARDS11(x[0][j][k][l][m]); 99 | 100 | /* "swap x_0j0lm with x_0j1lm" */ 101 | //#pragma unroll 2 102 | for (j = 0; j < 2; ++j) 103 | //#pragma unroll 2 104 | for (l = 0; l < 2; ++l) 105 | //#pragma unroll 2 106 | for (m = 0; m < 2; ++m) 107 | SWAP(x[0][j][0][l][m], x[0][j][1][l][m]) 108 | 109 | /* "xor x_1jklm into x_0jklm" */ 110 | //#pragma unroll 2 111 | for (j = 0; j < 2; ++j) 112 | //#pragma unroll 2 113 | for (k = 0; k < 2; ++k) 114 | //#pragma unroll 2 115 | for (l = 0; l < 2; ++l) 116 | //#pragma unroll 2 117 | for (m = 0; m < 2; ++m) 118 | x[0][j][k][l][m] ^= x[1][j][k][l][m]; 119 | 120 | /* "swap x_1jkl0 with x_1jkl1" */ 121 | //#pragma unroll 2 122 | for (j = 0; j < 2; ++j) 123 | //#pragma unroll 2 124 | for (k = 0; k < 2; ++k) 125 | //#pragma unroll 2 126 | for (l = 0; l < 2; ++l) 127 | SWAP(x[1][j][k][l][0], x[1][j][k][l][1]) 128 | 129 | } 130 | } 131 | 132 | 133 | -------------------------------------------------------------------------------- /linuxsgminer561/echo.cl: -------------------------------------------------------------------------------- 1 | /* $Id: echo.c 227 2010-06-16 17:28:38Z tp $ */ 2 | /* 3 | * ECHO implementation. 4 | * 5 | * ==========================(LICENSE BEGIN)============================ 6 | * 7 | * Copyright (c) 2007-2010 Projet RNRT SAPHIR 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining 10 | * a copy of this software and associated documentation files (the 11 | * "Software"), to deal in the Software without restriction, including 12 | * without limitation the rights to use, copy, modify, merge, publish, 13 | * distribute, sublicense, and/or sell copies of the Software, and to 14 | * permit persons to whom the Software is furnished to do so, subject to 15 | * the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | * 28 | * ===========================(LICENSE END)============================= 29 | * 30 | * @author Thomas Pornin 31 | */ 32 | 33 | #define T32 SPH_T32 34 | #define C32 SPH_C32 35 | #if SPH_64 36 | #define C64 SPH_C64 37 | #endif 38 | 39 | #define AES_BIG_ENDIAN 0 40 | #include "aes_helper.cl" 41 | 42 | #define ECHO_DECL_STATE_BIG \ 43 | sph_u64 W00, W01, W10, W11, W20, W21, W30, W31, W40, W41, W50, W51, W60, W61, W70, W71, W80, W81, W90, W91, WA0, WA1, WB0, WB1, WC0, WC1, WD0, WD1, WE0, WE1, WF0, WF1; 44 | 45 | #define AES_2ROUNDS(XX, XY) do { \ 46 | sph_u32 X0 = (sph_u32)(XX); \ 47 | sph_u32 X1 = (sph_u32)(XX >> 32); \ 48 | sph_u32 X2 = (sph_u32)(XY); \ 49 | sph_u32 X3 = (sph_u32)(XY >> 32); \ 50 | sph_u32 Y0, Y1, Y2, Y3; \ 51 | AES_ROUND_LE(X0, X1, X2, X3, K0, K1, K2, K3, Y0, Y1, Y2, Y3); \ 52 | AES_ROUND_NOKEY_LE(Y0, Y1, Y2, Y3, X0, X1, X2, X3); \ 53 | XX = (sph_u64)X0 | ((sph_u64)X1 << 32); \ 54 | XY = (sph_u64)X2 | ((sph_u64)X3 << 32); \ 55 | if ((K0 = T32(K0 + 1)) == 0) { \ 56 | if ((K1 = T32(K1 + 1)) == 0) \ 57 | if ((K2 = T32(K2 + 1)) == 0) \ 58 | K3 = T32(K3 + 1); \ 59 | } \ 60 | } while (0) 61 | 62 | #define BIG_SUB_WORDS do { \ 63 | AES_2ROUNDS(W00, W01); \ 64 | AES_2ROUNDS(W10, W11); \ 65 | AES_2ROUNDS(W20, W21); \ 66 | AES_2ROUNDS(W30, W31); \ 67 | AES_2ROUNDS(W40, W41); \ 68 | AES_2ROUNDS(W50, W51); \ 69 | AES_2ROUNDS(W60, W61); \ 70 | AES_2ROUNDS(W70, W71); \ 71 | AES_2ROUNDS(W80, W81); \ 72 | AES_2ROUNDS(W90, W91); \ 73 | AES_2ROUNDS(WA0, WA1); \ 74 | AES_2ROUNDS(WB0, WB1); \ 75 | AES_2ROUNDS(WC0, WC1); \ 76 | AES_2ROUNDS(WD0, WD1); \ 77 | AES_2ROUNDS(WE0, WE1); \ 78 | AES_2ROUNDS(WF0, WF1); \ 79 | } while (0) 80 | 81 | #define SHIFT_ROW1(a, b, c, d) do { \ 82 | sph_u64 tmp; \ 83 | tmp = W ## a ## 0; \ 84 | W ## a ## 0 = W ## b ## 0; \ 85 | W ## b ## 0 = W ## c ## 0; \ 86 | W ## c ## 0 = W ## d ## 0; \ 87 | W ## d ## 0 = tmp; \ 88 | tmp = W ## a ## 1; \ 89 | W ## a ## 1 = W ## b ## 1; \ 90 | W ## b ## 1 = W ## c ## 1; \ 91 | W ## c ## 1 = W ## d ## 1; \ 92 | W ## d ## 1 = tmp; \ 93 | } while (0) 94 | 95 | #define SHIFT_ROW2(a, b, c, d) do { \ 96 | sph_u64 tmp; \ 97 | tmp = W ## a ## 0; \ 98 | W ## a ## 0 = W ## c ## 0; \ 99 | W ## c ## 0 = tmp; \ 100 | tmp = W ## b ## 0; \ 101 | W ## b ## 0 = W ## d ## 0; \ 102 | W ## d ## 0 = tmp; \ 103 | tmp = W ## a ## 1; \ 104 | W ## a ## 1 = W ## c ## 1; \ 105 | W ## c ## 1 = tmp; \ 106 | tmp = W ## b ## 1; \ 107 | W ## b ## 1 = W ## d ## 1; \ 108 | W ## d ## 1 = tmp; \ 109 | } while (0) 110 | 111 | #define SHIFT_ROW3(a, b, c, d) SHIFT_ROW1(d, c, b, a) 112 | 113 | #define BIG_SHIFT_ROWS do { \ 114 | SHIFT_ROW1(1, 5, 9, D); \ 115 | SHIFT_ROW2(2, 6, A, E); \ 116 | SHIFT_ROW3(3, 7, B, F); \ 117 | } while (0) 118 | 119 | #define MIX_COLUMN1(ia, ib, ic, id, n) do { \ 120 | sph_u64 a = W ## ia ## n; \ 121 | sph_u64 b = W ## ib ## n; \ 122 | sph_u64 c = W ## ic ## n; \ 123 | sph_u64 d = W ## id ## n; \ 124 | sph_u64 ab = a ^ b; \ 125 | sph_u64 bc = b ^ c; \ 126 | sph_u64 cd = c ^ d; \ 127 | sph_u64 abx = ((ab & C64(0x8080808080808080)) >> 7) * 27U \ 128 | ^ ((ab & C64(0x7F7F7F7F7F7F7F7F)) << 1); \ 129 | sph_u64 bcx = ((bc & C64(0x8080808080808080)) >> 7) * 27U \ 130 | ^ ((bc & C64(0x7F7F7F7F7F7F7F7F)) << 1); \ 131 | sph_u64 cdx = ((cd & C64(0x8080808080808080)) >> 7) * 27U \ 132 | ^ ((cd & C64(0x7F7F7F7F7F7F7F7F)) << 1); \ 133 | W ## ia ## n = abx ^ bc ^ d; \ 134 | W ## ib ## n = bcx ^ a ^ cd; \ 135 | W ## ic ## n = cdx ^ ab ^ d; \ 136 | W ## id ## n = abx ^ bcx ^ cdx ^ ab ^ c; \ 137 | } while (0) 138 | 139 | #define MIX_COLUMN(a, b, c, d) do { \ 140 | MIX_COLUMN1(a, b, c, d, 0); \ 141 | MIX_COLUMN1(a, b, c, d, 1); \ 142 | } while (0) 143 | 144 | #define BIG_MIX_COLUMNS do { \ 145 | MIX_COLUMN(0, 1, 2, 3); \ 146 | MIX_COLUMN(4, 5, 6, 7); \ 147 | MIX_COLUMN(8, 9, A, B); \ 148 | MIX_COLUMN(C, D, E, F); \ 149 | } while (0) 150 | 151 | #define BIG_ROUND do { \ 152 | BIG_SUB_WORDS; \ 153 | BIG_SHIFT_ROWS; \ 154 | BIG_MIX_COLUMNS; \ 155 | } while (0) 156 | 157 | #define ECHO_COMPRESS_BIG(sc) do { \ 158 | sph_u32 K0 = sc->C0; \ 159 | sph_u32 K1 = sc->C1; \ 160 | sph_u32 K2 = sc->C2; \ 161 | sph_u32 K3 = sc->C3; \ 162 | unsigned u; \ 163 | INPUT_BLOCK_BIG(sc); \ 164 | for (u = 0; u < 10; u ++) { \ 165 | BIG_ROUND; \ 166 | } \ 167 | ECHO_FINAL_BIG; \ 168 | } while (0) 169 | 170 | -------------------------------------------------------------------------------- /linuxsgminer561/fuguecoin.cl: -------------------------------------------------------------------------------- 1 | /* 2 | * FugueCoin kernel implementation. 3 | * 4 | * ==========================(LICENSE BEGIN)============================ 5 | * 6 | * Copyright (c) 2014 phm 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining 9 | * a copy of this software and associated documentation files (the 10 | * "Software"), to deal in the Software without restriction, including 11 | * without limitation the rights to use, copy, modify, merge, publish, 12 | * distribute, sublicense, and/or sell copies of the Software, and to 13 | * permit persons to whom the Software is furnished to do so, subject to 14 | * the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 22 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 23 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 25 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | * 27 | * ===========================(LICENSE END)============================= 28 | * 29 | * @author phm 30 | */ 31 | 32 | #ifndef FUGUECOIN_CL 33 | #define FUGUECOIN_CL 34 | 35 | #if __ENDIAN_LITTLE__ 36 | #define SPH_LITTLE_ENDIAN 1 37 | #else 38 | #define SPH_BIG_ENDIAN 1 39 | #endif 40 | 41 | #define SPH_UPTR sph_u64 42 | 43 | typedef unsigned int sph_u32; 44 | typedef int sph_s32; 45 | #ifndef __OPENCL_VERSION__ 46 | typedef unsigned long long sph_u64; 47 | typedef long long sph_s64; 48 | #else 49 | typedef unsigned long sph_u64; 50 | typedef long sph_s64; 51 | #endif 52 | 53 | #define SPH_64 1 54 | #define SPH_64_TRUE 1 55 | 56 | #define SPH_C32(x) ((sph_u32)(x ## U)) 57 | #define SPH_T32(x) ((x) & SPH_C32(0xFFFFFFFF)) 58 | #define SPH_ROTL32(x, n) SPH_T32(((x) << (n)) | ((x) >> (32 - (n)))) 59 | #define SPH_ROTR32(x, n) SPH_ROTL32(x, (32 - (n))) 60 | 61 | #define SPH_C64(x) ((sph_u64)(x ## UL)) 62 | #define SPH_T64(x) ((x) & SPH_C64(0xFFFFFFFFFFFFFFFF)) 63 | #define SPH_ROTL64(x, n) SPH_T64(((x) << (n)) | ((x) >> (64 - (n)))) 64 | #define SPH_ROTR64(x, n) SPH_ROTL64(x, (64 - (n))) 65 | 66 | #include "fugue.cl" 67 | 68 | #define SWAP4(x) as_uint(as_uchar4(x).wzyx) 69 | #define SWAP8(x) as_ulong(as_uchar8(x).s76543210) 70 | 71 | #if SPH_BIG_ENDIAN 72 | #define DEC32BE(x) (*(const __global sph_u32 *) (x)) 73 | #else 74 | #define DEC32BE(x) SWAP4(*(const __global sph_u32 *) (x)) 75 | #endif 76 | 77 | __attribute__((reqd_work_group_size(WORKSIZE, 1, 1))) 78 | __kernel void search(__global unsigned char* input, volatile __global uint* output, const ulong target) 79 | { 80 | uint gid = get_global_id(0); 81 | 82 | //mixtab 83 | __local sph_u32 mixtab0[256], mixtab1[256], mixtab2[256], mixtab3[256]; 84 | int init = get_local_id(0); 85 | int step = get_local_size(0); 86 | for (int i = init; i < 256; i += step) 87 | { 88 | mixtab0[i] = mixtab0_c[i]; 89 | mixtab1[i] = mixtab1_c[i]; 90 | mixtab2[i] = mixtab2_c[i]; 91 | mixtab3[i] = mixtab3_c[i]; 92 | } 93 | barrier(CLK_GLOBAL_MEM_FENCE); 94 | 95 | sph_u32 S00 = 0, S01 = 0, S02 = 0, S03 = 0, S04 = 0, S05 = 0, S06 = 0, S07 = 0, S08 = 0, S09 = 0; \ 96 | sph_u32 S10 = 0, S11 = 0, S12 = 0, S13 = 0, S14 = 0, S15 = 0, S16 = 0, S17 = 0, S18 = 0, S19 = 0; \ 97 | sph_u32 S20 = 0, S21 = 0, S22 = IV256[0], S23 = IV256[1], S24 = IV256[2], S25 = IV256[3], S26 = IV256[4], S27 = IV256[5], S28 = IV256[6], S29 = IV256[7]; 98 | 99 | FUGUE256_5(DEC32BE(input + 0x0), DEC32BE(input + 0x4), DEC32BE(input + 0x8), DEC32BE(input + 0xc), DEC32BE(input + 0x10)); 100 | FUGUE256_5(DEC32BE(input + 0x14), DEC32BE(input + 0x18), DEC32BE(input + 0x1c), DEC32BE(input + 0x20), DEC32BE(input + 0x24)); 101 | FUGUE256_5(DEC32BE(input + 0x28), DEC32BE(input + 0x2c), DEC32BE(input + 0x30), DEC32BE(input + 0x34), DEC32BE(input + 0x38)); 102 | FUGUE256_4(DEC32BE(input + 0x3c), DEC32BE(input + 0x40), DEC32BE(input + 0x44), DEC32BE(input + 0x48)); 103 | 104 | TIX2(SWAP4(gid), S06, S07, S14, S16, S00); 105 | CMIX30(S03, S04, S05, S07, S08, S09, S18, S19, S20); 106 | SMIX(S03, S04, S05, S06); 107 | CMIX30(S00, S01, S02, S04, S05, S06, S15, S16, S17); 108 | SMIX(S00, S01, S02, S03); 109 | 110 | TIX2(0, S00, S01, S08, S10, S24); 111 | CMIX30(S27, S28, S29, S01, S02, S03, S12, S13, S14); 112 | SMIX(S27, S28, S29, S00); 113 | CMIX30(S24, S25, S26, S28, S29, S00, S09, S10, S11); 114 | SMIX(S24, S25, S26, S27); 115 | 116 | TIX2(0x280, S24, S25, S02, S04, S18); 117 | CMIX30(S21, S22, S23, S25, S26, S27, S06, S07, S08); 118 | SMIX(S21, S22, S23, S24); 119 | CMIX30(S18, S19, S20, S22, S23, S24, S03, S04, S05); 120 | SMIX(S18, S19, S20, S21); 121 | 122 | CMIX30(S15, S16, S17, S19, S20, S21, S00, S01, S02); 123 | SMIX(S15, S16, S17, S18); 124 | CMIX30(S12, S13, S14, S16, S17, S18, S27, S28, S29); 125 | SMIX(S12, S13, S14, S15); 126 | CMIX30(S09, S10, S11, S13, S14, S15, S24, S25, S26); 127 | SMIX(S09, S10, S11, S12); 128 | CMIX30(S06, S07, S08, S10, S11, S12, S21, S22, S23); 129 | SMIX(S06, S07, S08, S09); 130 | CMIX30(S03, S04, S05, S07, S08, S09, S18, S19, S20); 131 | SMIX(S03, S04, S05, S06); 132 | CMIX30(S00, S01, S02, S04, S05, S06, S15, S16, S17); 133 | SMIX(S00, S01, S02, S03); 134 | CMIX30(S27, S28, S29, S01, S02, S03, S12, S13, S14); 135 | SMIX(S27, S28, S29, S00); 136 | CMIX30(S24, S25, S26, S28, S29, S00, S09, S10, S11); 137 | SMIX(S24, S25, S26, S27); 138 | CMIX30(S21, S22, S23, S25, S26, S27, S06, S07, S08); 139 | SMIX(S21, S22, S23, S24); 140 | CMIX30(S18, S19, S20, S22, S23, S24, S03, S04, S05); 141 | SMIX(S18, S19, S20, S21); 142 | S22 ^= S18; 143 | S03 ^= S18; 144 | SMIX(S03, S04, S05, S06); 145 | S07 ^= S03; 146 | S19 ^= S03; 147 | SMIX(S19, S20, S21, S22); 148 | S23 ^= S19; 149 | S04 ^= S19; 150 | SMIX(S04, S05, S06, S07); 151 | S08 ^= S04; 152 | S20 ^= S04; 153 | SMIX(S20, S21, S22, S23); 154 | S24 ^= S20; 155 | S05 ^= S20; 156 | SMIX(S05, S06, S07, S08); 157 | S09 ^= S05; 158 | S21 ^= S05; 159 | SMIX(S21, S22, S23, S24); 160 | S25 ^= S21; 161 | S06 ^= S21; 162 | SMIX(S06, S07, S08, S09); 163 | S10 ^= S06; 164 | S22 ^= S06; 165 | SMIX(S22, S23, S24, S25); 166 | S26 ^= S22; 167 | S07 ^= S22; 168 | SMIX(S07, S08, S09, S10); 169 | S11 ^= S07; 170 | S23 ^= S07; 171 | SMIX(S23, S24, S25, S26); 172 | S27 ^= S23; 173 | S08 ^= S23; 174 | SMIX(S08, S09, S10, S11); 175 | S12 ^= S08; 176 | S24 ^= S08; 177 | SMIX(S24, S25, S26, S27); 178 | S28 ^= S24; 179 | S09 ^= S24; 180 | SMIX(S09, S10, S11, S12); 181 | S13 ^= S09; 182 | S25 ^= S09; 183 | SMIX(S25, S26, S27, S28); 184 | S29 ^= S25; 185 | S10 ^= S25; 186 | SMIX(S10, S11, S12, S13); 187 | S14 ^= S10; 188 | S26 ^= S10; 189 | SMIX(S26, S27, S28, S29); 190 | S00 ^= S26; 191 | S11 ^= S26; 192 | SMIX(S11, S12, S13, S14); 193 | S15 ^= S11; 194 | S27 ^= S11; 195 | SMIX(S27, S28, S29, S00); 196 | S01 ^= S27; 197 | S12 ^= S27; 198 | SMIX(S12, S13, S14, S15); 199 | S16 ^= S12; 200 | S28 ^= S12; 201 | SMIX(S28, S29, S00, S01); 202 | S02 ^= S28; 203 | S13 ^= S28; 204 | SMIX(S13, S14, S15, S16); 205 | S17 ^= S13; 206 | S29 ^= S13; 207 | SMIX(S29, S00, S01, S02); 208 | S03 ^= S29; 209 | S14 ^= S29; 210 | SMIX(S14, S15, S16, S17); 211 | S18 ^= S14; 212 | S00 ^= S14; 213 | SMIX(S00, S01, S02, S03); 214 | S04 ^= S00; 215 | S15 ^= S00; 216 | SMIX(S15, S16, S17, S18); 217 | S19 ^= S15; 218 | S01 ^= S15; 219 | SMIX(S01, S02, S03, S04); 220 | 221 | S05 ^= S01; 222 | S16 ^= S01; 223 | 224 | bool result = ((((sph_u64) SWAP4(S19) << 32) | SWAP4(S18)) <= target); 225 | if (result) 226 | output[output[0xFF]++] = SWAP4(gid); 227 | } 228 | 229 | #endif // FUGUECOIN_CL 230 | -------------------------------------------------------------------------------- /linuxsgminer561/keccak1600.cl: -------------------------------------------------------------------------------- 1 | /* 2 | * keccak_1600 function 3 | * C. Buchner 2014 4 | * 5 | */ 6 | 7 | __constant static const sph_u64 RC[] = { 8 | SPH_C64(0x0000000000000001), SPH_C64(0x0000000000008082), 9 | SPH_C64(0x800000000000808A), SPH_C64(0x8000000080008000), 10 | SPH_C64(0x000000000000808B), SPH_C64(0x0000000080000001), 11 | SPH_C64(0x8000000080008081), SPH_C64(0x8000000000008009), 12 | SPH_C64(0x000000000000008A), SPH_C64(0x0000000000000088), 13 | SPH_C64(0x0000000080008009), SPH_C64(0x000000008000000A), 14 | SPH_C64(0x000000008000808B), SPH_C64(0x800000000000008B), 15 | SPH_C64(0x8000000000008089), SPH_C64(0x8000000000008003), 16 | SPH_C64(0x8000000000008002), SPH_C64(0x8000000000000080), 17 | SPH_C64(0x000000000000800A), SPH_C64(0x800000008000000A), 18 | SPH_C64(0x8000000080008081), SPH_C64(0x8000000000008080), 19 | SPH_C64(0x0000000080000001), SPH_C64(0x8000000080008008) 20 | }; 21 | 22 | 23 | inline void keccak_block(ulong *s) { 24 | size_t i; 25 | ulong t[5], u[5], v, w; 26 | 27 | for (i = 0; i < 24; i++) { 28 | /* theta: c = a[0,i] ^ a[1,i] ^ .. a[4,i] */ 29 | t[0] = s[0] ^ s[5] ^ s[10] ^ s[15] ^ s[20]; 30 | t[1] = s[1] ^ s[6] ^ s[11] ^ s[16] ^ s[21]; 31 | t[2] = s[2] ^ s[7] ^ s[12] ^ s[17] ^ s[22]; 32 | t[3] = s[3] ^ s[8] ^ s[13] ^ s[18] ^ s[23]; 33 | t[4] = s[4] ^ s[9] ^ s[14] ^ s[19] ^ s[24]; 34 | 35 | /* theta: d[i] = c[i+4] ^ rotl(c[i+1],1) */ 36 | u[0] = t[4] ^ SPH_ROTL64(t[1], 1); 37 | u[1] = t[0] ^ SPH_ROTL64(t[2], 1); 38 | u[2] = t[1] ^ SPH_ROTL64(t[3], 1); 39 | u[3] = t[2] ^ SPH_ROTL64(t[4], 1); 40 | u[4] = t[3] ^ SPH_ROTL64(t[0], 1); 41 | 42 | /* theta: a[0,i], a[1,i], .. a[4,i] ^= d[i] */ 43 | s[0] ^= u[0]; s[5] ^= u[0]; s[10] ^= u[0]; s[15] ^= u[0]; s[20] ^= u[0]; 44 | s[1] ^= u[1]; s[6] ^= u[1]; s[11] ^= u[1]; s[16] ^= u[1]; s[21] ^= u[1]; 45 | s[2] ^= u[2]; s[7] ^= u[2]; s[12] ^= u[2]; s[17] ^= u[2]; s[22] ^= u[2]; 46 | s[3] ^= u[3]; s[8] ^= u[3]; s[13] ^= u[3]; s[18] ^= u[3]; s[23] ^= u[3]; 47 | s[4] ^= u[4]; s[9] ^= u[4]; s[14] ^= u[4]; s[19] ^= u[4]; s[24] ^= u[4]; 48 | 49 | /* rho pi: b[..] = rotl(a[..], ..) */ 50 | v = s[1]; 51 | s[1] = SPH_ROTL64(s[6], 44); 52 | s[6] = SPH_ROTL64(s[9], 20); 53 | s[9] = SPH_ROTL64(s[22], 61); 54 | s[22] = SPH_ROTL64(s[14], 39); 55 | s[14] = SPH_ROTL64(s[20], 18); 56 | s[20] = SPH_ROTL64(s[2], 62); 57 | s[2] = SPH_ROTL64(s[12], 43); 58 | s[12] = SPH_ROTL64(s[13], 25); 59 | s[13] = SPH_ROTL64(s[19], 8); 60 | s[19] = SPH_ROTL64(s[23], 56); 61 | s[23] = SPH_ROTL64(s[15], 41); 62 | s[15] = SPH_ROTL64(s[4], 27); 63 | s[4] = SPH_ROTL64(s[24], 14); 64 | s[24] = SPH_ROTL64(s[21], 2); 65 | s[21] = SPH_ROTL64(s[8], 55); 66 | s[8] = SPH_ROTL64(s[16], 45); 67 | s[16] = SPH_ROTL64(s[5], 36); 68 | s[5] = SPH_ROTL64(s[3], 28); 69 | s[3] = SPH_ROTL64(s[18], 21); 70 | s[18] = SPH_ROTL64(s[17], 15); 71 | s[17] = SPH_ROTL64(s[11], 10); 72 | s[11] = SPH_ROTL64(s[7], 6); 73 | s[7] = SPH_ROTL64(s[10], 3); 74 | s[10] = SPH_ROTL64(v, 1); 75 | 76 | v = s[0]; w = s[1]; s[0] ^= (~w) & s[2]; s[1] ^= (~s[2]) & s[3]; s[2] ^= (~s[3]) & s[4]; s[3] ^= (~s[4]) & v; s[4] ^= (~v) & w; 77 | v = s[5]; w = s[6]; s[5] ^= (~w) & s[7]; s[6] ^= (~s[7]) & s[8]; s[7] ^= (~s[8]) & s[9]; s[8] ^= (~s[9]) & v; s[9] ^= (~v) & w; 78 | v = s[10]; w = s[11]; s[10] ^= (~w) & s[12]; s[11] ^= (~s[12]) & s[13]; s[12] ^= (~s[13]) & s[14]; s[13] ^= (~s[14]) & v; s[14] ^= (~v) & w; 79 | v = s[15]; w = s[16]; s[15] ^= (~w) & s[17]; s[16] ^= (~s[17]) & s[18]; s[17] ^= (~s[18]) & s[19]; s[18] ^= (~s[19]) & v; s[19] ^= (~v) & w; 80 | v = s[20]; w = s[21]; s[20] ^= (~w) & s[22]; s[21] ^= (~s[22]) & s[23]; s[22] ^= (~s[23]) & s[24]; s[23] ^= (~s[24]) & v; s[24] ^= (~v) & w; 81 | 82 | s[0] ^= RC[i]; 83 | } 84 | }; -------------------------------------------------------------------------------- /linuxsgminer561/lbry.cl: -------------------------------------------------------------------------------- 1 | #include "sha256.cl" 2 | #include "wolf-sha512.cl" 3 | #include "ripemd160.cl" 4 | 5 | #define SWAP32(x) as_uint(as_uchar4(x).s3210) 6 | #define SWAP64(x) as_ulong(as_uchar8(x).s76543210) 7 | 8 | 9 | __attribute__((reqd_work_group_size(WORKSIZE, 1, 1))) 10 | __kernel void search(__global const uint *input, __global uint8 *ctx) 11 | { 12 | // SHA256 takes 16 uints of input per block - we have 112 bytes to process 13 | // 8 * 16 == 64, meaning two block transforms. 14 | 15 | uint SHA256Buf[16]; 16 | uint gid = get_global_id(0); 17 | 18 | // Remember the last four is the nonce - so 108 bytes / 4 bytes per dword 19 | #pragma unroll 20 | for(int i = 0; i < 16; ++i) SHA256Buf[i] = SWAP32(input[i]); 21 | 22 | 23 | 24 | // SHA256 initialization constants 25 | uint8 outbuf = (uint8)(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19); 26 | 27 | #pragma unroll 28 | for(int i = 0; i < 3; ++i) 29 | { 30 | if(i == 1) 31 | { 32 | #pragma unroll 33 | for(int i = 0; i < 11; ++i) SHA256Buf[i] = SWAP32(input[i + 16]); 34 | SHA256Buf[11] = SWAP32(gid); 35 | SHA256Buf[12] = 0x80000000; 36 | SHA256Buf[13] = 0x00000000; 37 | SHA256Buf[14] = 0x00000000; 38 | SHA256Buf[15] = 0x00000380; 39 | } 40 | if(i == 2) 41 | { 42 | ((uint8 *)SHA256Buf)[0] = outbuf; 43 | SHA256Buf[8] = 0x80000000; 44 | #pragma unroll 45 | for(int i = 9; i < 15; ++i) SHA256Buf[i] = 0x00000000; 46 | SHA256Buf[15] = 0x00000100; 47 | outbuf = (uint8)(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19); 48 | } 49 | outbuf = sha256_round(((uint16 *)SHA256Buf)[0], outbuf); 50 | } 51 | 52 | /* 53 | outbuf = sha256_round(((uint16 *)SHA256Buf)[0], outbuf); 54 | #pragma unroll 55 | for(int i = 0; i < 11; ++i) SHA256Buf[i] = SWAP32(input[i + 16]); 56 | SHA256Buf[11] = SWAP32(gid); 57 | SHA256Buf[12] = 0x80000000; 58 | SHA256Buf[13] = 0x00000000; 59 | SHA256Buf[14] = 0x00000000; 60 | SHA256Buf[15] = 0x00000380; 61 | 62 | outbuf = sha256_round(((uint16 *)SHA256Buf)[0], outbuf); 63 | ((uint8 *)SHA256Buf)[0] = outbuf; 64 | SHA256Buf[8] = 0x80000000; 65 | for(int i = 9; i < 15; ++i) SHA256Buf[i] = 0x00000000; 66 | SHA256Buf[15] = 0x00000100; 67 | outbuf = (uint8)(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19); 68 | outbuf = sha256_round(((uint16 *)SHA256Buf)[0], outbuf); 69 | */ 70 | 71 | 72 | /* 73 | 74 | //outbuf = sha256_round(((uint16 *)SHA256Buf)[0], outbuf); 75 | //outbuf = sha256_round(((uint16 *)SHA256Buf)[1], outbuf); 76 | 77 | // outbuf would normall be SWAP32'd here, but it'll need it again 78 | // once we use it as input to the next SHA256, so it negates. 79 | 80 | ((uint8 *)SHA256Buf)[0] = outbuf; 81 | SHA256Buf[8] = 0x80000000; 82 | for(int i = 9; i < 15; ++i) SHA256Buf[i] = 0x00000000; 83 | SHA256Buf[15] = 0x00000100; 84 | 85 | outbuf = (uint8)(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19); 86 | outbuf = sha256_round(((uint16 *)SHA256Buf)[0], outbuf); 87 | */ 88 | 89 | 90 | 91 | outbuf.s0 = SWAP32(outbuf.s0); 92 | outbuf.s1 = SWAP32(outbuf.s1); 93 | outbuf.s2 = SWAP32(outbuf.s2); 94 | outbuf.s3 = SWAP32(outbuf.s3); 95 | outbuf.s4 = SWAP32(outbuf.s4); 96 | outbuf.s5 = SWAP32(outbuf.s5); 97 | outbuf.s6 = SWAP32(outbuf.s6); 98 | outbuf.s7 = SWAP32(outbuf.s7); 99 | 100 | ctx[get_global_id(0) - get_global_offset(0)] = outbuf; 101 | } 102 | 103 | __attribute__((reqd_work_group_size(WORKSIZE, 1, 1))) 104 | __kernel void search1(__global uint8 *ctx) 105 | { 106 | ulong W[16] = { 0UL }, SHA512Out[8]; 107 | uint SHA256Buf[16]; 108 | uint8 outbuf = ctx[get_global_id(0) - get_global_offset(0)]; 109 | 110 | ((uint8 *)W)[0] = outbuf; 111 | 112 | for(int i = 0; i < 4; ++i) W[i] = SWAP64(W[i]); 113 | 114 | W[4] = 0x8000000000000000UL; 115 | W[15] = 0x0000000000000100UL; 116 | 117 | for(int i = 0; i < 8; ++i) SHA512Out[i] = SHA512_INIT[i]; 118 | 119 | SHA512Block(W, SHA512Out); 120 | 121 | for(int i = 0; i < 8; ++i) SHA512Out[i] = SWAP64(SHA512Out[i]); 122 | 123 | uint RMD160_0[16] = { 0U }; 124 | uint RMD160_1[16] = { 0U }; 125 | uint RMD160_0_Out[5], RMD160_1_Out[5]; 126 | 127 | for(int i = 0; i < 4; ++i) 128 | { 129 | ((ulong *)RMD160_0)[i] = SHA512Out[i]; 130 | ((ulong *)RMD160_1)[i] = SHA512Out[i + 4]; 131 | } 132 | 133 | RMD160_0[8] = RMD160_1[8] = 0x00000080; 134 | RMD160_0[14] = RMD160_1[14] = 0x00000100; 135 | 136 | for(int i = 0; i < 5; ++i) 137 | { 138 | RMD160_0_Out[i] = RMD160_IV[i]; 139 | RMD160_1_Out[i] = RMD160_IV[i]; 140 | } 141 | 142 | RIPEMD160_ROUND_BODY(RMD160_0, RMD160_0_Out); 143 | RIPEMD160_ROUND_BODY(RMD160_1, RMD160_1_Out); 144 | 145 | for(int i = 0; i < 5; ++i) SHA256Buf[i] = SWAP32(RMD160_0_Out[i]); 146 | for(int i = 5; i < 10; ++i) SHA256Buf[i] = SWAP32(RMD160_1_Out[i - 5]); 147 | SHA256Buf[10] = 0x80000000; 148 | 149 | for(int i = 11; i < 15; ++i) SHA256Buf[i] = 0x00000000U; 150 | 151 | SHA256Buf[15] = 0x00000140; 152 | 153 | outbuf = (uint8)(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19); 154 | outbuf = sha256_round(((uint16 *)SHA256Buf)[0], outbuf); 155 | 156 | ctx[get_global_id(0) - get_global_offset(0)] = outbuf; 157 | } 158 | 159 | __attribute__((reqd_work_group_size(WORKSIZE, 1, 1))) 160 | __kernel void search2(__global uint8 *ctx, __global uint *output, ulong target) 161 | { 162 | uint SHA256Buf[16] = { 0U }; 163 | uint gid = get_global_id(0); 164 | uint8 outbuf = ctx[get_global_id(0) - get_global_offset(0)]; 165 | 166 | ((uint8 *)SHA256Buf)[0] = outbuf; 167 | SHA256Buf[8] = 0x80000000; 168 | for(int i = 9; i < 15; ++i) SHA256Buf[i] = 0x00000000; 169 | SHA256Buf[15] = 0x00000100; 170 | 171 | outbuf = (uint8)(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19); 172 | outbuf = sha256_round(((uint16 *)SHA256Buf)[0], outbuf); 173 | 174 | outbuf.s6 = SWAP32(outbuf.s6); 175 | outbuf.s7 = SWAP32(outbuf.s7); 176 | 177 | if(as_ulong(outbuf.s67) <= target) 178 | output[atomic_inc(output+0xFF)] = SWAP32(gid); 179 | } 180 | -------------------------------------------------------------------------------- /linuxsgminer561/lyra2.cl: -------------------------------------------------------------------------------- 1 | /* 2 | * Lyra2 kernel implementation. 3 | * 4 | * ==========================(LICENSE BEGIN)============================ 5 | * Copyright (c) 2014 djm34 6 | * 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining 9 | * a copy of this software and associated documentation files (the 10 | * "Software"), to deal in the Software without restriction, including 11 | * without limitation the rights to use, copy, modify, merge, publish, 12 | * distribute, sublicense, and/or sell copies of the Software, and to 13 | * permit persons to whom the Software is furnished to do so, subject to 14 | * the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 22 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 23 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 25 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | * 27 | * ===========================(LICENSE END)============================= 28 | * 29 | * @author djm34 30 | */ 31 | 32 | /*Blake2b IV Array*/ 33 | __constant static const sph_u64 blake2b_IV[8] = 34 | { 35 | 0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL, 36 | 0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL, 37 | 0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL, 38 | 0x1f83d9abfb41bd6bULL, 0x5be0cd19137e2179ULL 39 | }; 40 | 41 | /*Blake2b's rotation*/ 42 | 43 | static inline uint2 ror2(uint2 v, unsigned a) { 44 | uint2 result; 45 | unsigned n = 64 - a; 46 | if (n == 32) { return (uint2)(v.y,v.x); } 47 | if (n < 32) { 48 | result.y = ((v.y << (n)) | (v.x >> (32 - n))); 49 | result.x = ((v.x << (n)) | (v.y >> (32 - n))); 50 | } 51 | else { 52 | result.y = ((v.x << (n - 32)) | (v.y >> (64 - n))); 53 | result.x = ((v.y << (n - 32)) | (v.x >> (64 - n))); 54 | } 55 | return result; 56 | } 57 | static inline uint2 ror2l(uint2 v, unsigned a) { 58 | uint2 result; 59 | result.y = ((v.x << (32-a)) | (v.y >> (a))); 60 | result.x = ((v.y << (32-a)) | (v.x >> (a))); 61 | return result; 62 | } 63 | static inline uint2 ror2r(uint2 v, unsigned a) { 64 | uint2 result; 65 | result.y = ((v.y << (64-a)) | (v.x >> (a-32))); 66 | result.x = ((v.x << (64-a)) | (v.y >> (a-32))); 67 | return result; 68 | } 69 | /* 70 | #define G(a,b,c,d) \ 71 | do { \ 72 | a = as_uint2(as_ulong(a)+as_ulong(b)); d ^= a; d = d.yx; \ 73 | c = as_uint2(as_ulong(c)+as_ulong(d)); b ^= c; b = ror2l(b, 24); \ 74 | a = as_uint2(as_ulong(a)+as_ulong(b)); d ^= a; d = ror2l(d, 16); \ 75 | c = as_uint2(as_ulong(c)+as_ulong(d)); b ^= c; b = ror2r(b, 63); \ 76 | } while(0) 77 | */ 78 | #define G(a,b,c,d) \ 79 | do { \ 80 | a = as_uint2(as_ulong(a)+as_ulong(b)); d ^= a; d = d.yx; \ 81 | c = as_uint2(as_ulong(c)+as_ulong(d)); b ^= c; b = as_uint2(as_uchar8(b).s34567012); \ 82 | a = as_uint2(as_ulong(a)+as_ulong(b)); d ^= a; d = ror2l(d, 16); \ 83 | c = as_uint2(as_ulong(c)+as_ulong(d)); b ^= c; b = ror2r(b, 63); \ 84 | } while(0) 85 | 86 | /*One Round of the Blake2b's compression function*/ 87 | #define round_lyra(v) \ 88 | do { \ 89 | G(v[ 0],v[ 4],v[ 8],v[12]); \ 90 | G(v[ 1],v[ 5],v[ 9],v[13]); \ 91 | G(v[ 2],v[ 6],v[10],v[14]); \ 92 | G(v[ 3],v[ 7],v[11],v[15]); \ 93 | G(v[ 0],v[ 5],v[10],v[15]); \ 94 | G(v[ 1],v[ 6],v[11],v[12]); \ 95 | G(v[ 2],v[ 7],v[ 8],v[13]); \ 96 | G(v[ 3],v[ 4],v[ 9],v[14]); \ 97 | } while(0) 98 | 99 | 100 | #define reduceDuplexRowSetup(rowIn, rowInOut, rowOut) \ 101 | { \ 102 | for (int i = 0; i < 8; i++) \ 103 | { \ 104 | \ 105 | for (int j = 0; j < 12; j++) {state[j] ^= as_uint2(as_ulong(Matrix[12 * i + j][rowIn]) + as_ulong(Matrix[12 * i + j][rowInOut]));} \ 106 | round_lyra(state); \ 107 | for (int j = 0; j < 12; j++) {Matrix[j + 84 - 12 * i][rowOut] = Matrix[12 * i + j][rowIn] ^ state[j];} \ 108 | \ 109 | Matrix[0 + 12 * i][rowInOut] ^= state[11]; \ 110 | Matrix[1 + 12 * i][rowInOut] ^= state[0]; \ 111 | Matrix[2 + 12 * i][rowInOut] ^= state[1]; \ 112 | Matrix[3 + 12 * i][rowInOut] ^= state[2]; \ 113 | Matrix[4 + 12 * i][rowInOut] ^= state[3]; \ 114 | Matrix[5 + 12 * i][rowInOut] ^= state[4]; \ 115 | Matrix[6 + 12 * i][rowInOut] ^= state[5]; \ 116 | Matrix[7 + 12 * i][rowInOut] ^= state[6]; \ 117 | Matrix[8 + 12 * i][rowInOut] ^= state[7]; \ 118 | Matrix[9 + 12 * i][rowInOut] ^= state[8]; \ 119 | Matrix[10 + 12 * i][rowInOut] ^= state[9]; \ 120 | Matrix[11 + 12 * i][rowInOut] ^= state[10]; \ 121 | } \ 122 | \ 123 | } 124 | 125 | #define reduceDuplexRow(rowIn, rowInOut, rowOut) \ 126 | { \ 127 | for (int i = 0; i < 8; i++) \ 128 | { \ 129 | for (int j = 0; j < 12; j++) \ 130 | state[j] ^= as_uint2(as_ulong(Matrix[12 * i + j][rowIn]) + as_ulong(Matrix[12 * i + j][rowInOut])); \ 131 | \ 132 | round_lyra(state); \ 133 | for (int j = 0; j < 12; j++) {Matrix[j + 12 * i][rowOut] ^= state[j];} \ 134 | \ 135 | Matrix[0 + 12 * i][rowInOut] ^= state[11]; \ 136 | Matrix[1 + 12 * i][rowInOut] ^= state[0]; \ 137 | Matrix[2 + 12 * i][rowInOut] ^= state[1]; \ 138 | Matrix[3 + 12 * i][rowInOut] ^= state[2]; \ 139 | Matrix[4 + 12 * i][rowInOut] ^= state[3]; \ 140 | Matrix[5 + 12 * i][rowInOut] ^= state[4]; \ 141 | Matrix[6 + 12 * i][rowInOut] ^= state[5]; \ 142 | Matrix[7 + 12 * i][rowInOut] ^= state[6]; \ 143 | Matrix[8 + 12 * i][rowInOut] ^= state[7]; \ 144 | Matrix[9 + 12 * i][rowInOut] ^= state[8]; \ 145 | Matrix[10 + 12 * i][rowInOut] ^= state[9]; \ 146 | Matrix[11 + 12 * i][rowInOut] ^= state[10]; \ 147 | } \ 148 | \ 149 | } 150 | #define absorbblock(in) { \ 151 | state[0] ^= Matrix[0][in]; \ 152 | state[1] ^= Matrix[1][in]; \ 153 | state[2] ^= Matrix[2][in]; \ 154 | state[3] ^= Matrix[3][in]; \ 155 | state[4] ^= Matrix[4][in]; \ 156 | state[5] ^= Matrix[5][in]; \ 157 | state[6] ^= Matrix[6][in]; \ 158 | state[7] ^= Matrix[7][in]; \ 159 | state[8] ^= Matrix[8][in]; \ 160 | state[9] ^= Matrix[9][in]; \ 161 | state[10] ^= Matrix[10][in]; \ 162 | state[11] ^= Matrix[11][in]; \ 163 | round_lyra(state); \ 164 | round_lyra(state); \ 165 | round_lyra(state); \ 166 | round_lyra(state); \ 167 | round_lyra(state); \ 168 | round_lyra(state); \ 169 | round_lyra(state); \ 170 | round_lyra(state); \ 171 | round_lyra(state); \ 172 | round_lyra(state); \ 173 | round_lyra(state); \ 174 | round_lyra(state); \ 175 | } 176 | -------------------------------------------------------------------------------- /linuxsgminer561/lyra2v2.cl: -------------------------------------------------------------------------------- 1 | /* 2 | * Lyra2 kernel implementation. 3 | * 4 | * ==========================(LICENSE BEGIN)============================ 5 | * Copyright (c) 2014 djm34 6 | * 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining 9 | * a copy of this software and associated documentation files (the 10 | * "Software"), to deal in the Software without restriction, including 11 | * without limitation the rights to use, copy, modify, merge, publish, 12 | * distribute, sublicense, and/or sell copies of the Software, and to 13 | * permit persons to whom the Software is furnished to do so, subject to 14 | * the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 22 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 23 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 25 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | * 27 | * ===========================(LICENSE END)============================= 28 | * 29 | * @author djm34 30 | */ 31 | 32 | 33 | 34 | #define ROTL64(x,n) rotate(x,(ulong)n) 35 | #define ROTR64(x,n) rotate(x,(ulong)(64-n)) 36 | #define SWAP32(x) as_ulong(as_uint2(x).s10) 37 | #define SWAP24(x) as_ulong(as_uchar8(x).s34567012) 38 | #define SWAP16(x) as_ulong(as_uchar8(x).s23456701) 39 | 40 | #define G(a,b,c,d) \ 41 | do { \ 42 | a += b; d ^= a; d = SWAP32(d); \ 43 | c += d; b ^= c; b = ROTR64(b,24); \ 44 | a += b; d ^= a; d = ROTR64(d,16); \ 45 | c += d; b ^= c; b = ROTR64(b, 63); \ 46 | \ 47 | } while (0) 48 | 49 | #define G_old(a,b,c,d) \ 50 | do { \ 51 | a += b; d ^= a; d = ROTR64(d, 32); \ 52 | c += d; b ^= c; b = ROTR64(b, 24); \ 53 | a += b; d ^= a; d = ROTR64(d, 16); \ 54 | c += d; b ^= c; b = ROTR64(b, 63); \ 55 | \ 56 | } while (0) 57 | 58 | 59 | /*One Round of the Blake2b's compression function*/ 60 | 61 | #define round_lyra(s) \ 62 | do { \ 63 | G(s[0].x, s[1].x, s[2].x, s[3].x); \ 64 | G(s[0].y, s[1].y, s[2].y, s[3].y); \ 65 | G(s[0].z, s[1].z, s[2].z, s[3].z); \ 66 | G(s[0].w, s[1].w, s[2].w, s[3].w); \ 67 | G(s[0].x, s[1].y, s[2].z, s[3].w); \ 68 | G(s[0].y, s[1].z, s[2].w, s[3].x); \ 69 | G(s[0].z, s[1].w, s[2].x, s[3].y); \ 70 | G(s[0].w, s[1].x, s[2].y, s[3].z); \ 71 | } while(0) 72 | 73 | 74 | 75 | void reduceDuplexf(ulong4* state ,__global ulong4* DMatrix) 76 | { 77 | 78 | ulong4 state1[3]; 79 | uint ps1 = 0; 80 | uint ps2 = (memshift * 3 + memshift * 4); 81 | //#pragma unroll 4 82 | for (int i = 0; i < 4; i++) 83 | { 84 | uint s1 = ps1 + i*memshift; 85 | uint s2 = ps2 - i*memshift; 86 | 87 | for (int j = 0; j < 3; j++) state1[j] = (DMatrix)[j + s1]; 88 | 89 | for (int j = 0; j < 3; j++) state[j] ^= state1[j]; 90 | round_lyra(state); 91 | for (int j = 0; j < 3; j++) state1[j] ^= state[j]; 92 | 93 | for (int j = 0; j < 3; j++) (DMatrix)[j + s2] = state1[j]; 94 | } 95 | 96 | } 97 | 98 | 99 | 100 | void reduceDuplexRowf(uint rowIn,uint rowInOut,uint rowOut,ulong4 * state, __global ulong4 * DMatrix) 101 | { 102 | 103 | ulong4 state1[3], state2[3]; 104 | uint ps1 = (memshift * 4 * rowIn); 105 | uint ps2 = (memshift * 4 * rowInOut); 106 | uint ps3 = (memshift * 4 * rowOut); 107 | 108 | 109 | for (int i = 0; i < 4; i++) 110 | { 111 | uint s1 = ps1 + i*memshift; 112 | uint s2 = ps2 + i*memshift; 113 | uint s3 = ps3 + i*memshift; 114 | 115 | 116 | for (int j = 0; j < 3; j++) state1[j] = (DMatrix)[j + s1]; 117 | 118 | for (int j = 0; j < 3; j++) state2[j] = (DMatrix)[j + s2]; 119 | 120 | for (int j = 0; j < 3; j++) state1[j] += state2[j]; 121 | 122 | for (int j = 0; j < 3; j++) state[j] ^= state1[j]; 123 | 124 | 125 | round_lyra(state); 126 | 127 | ((ulong*)state2)[0] ^= ((ulong*)state)[11]; 128 | for (int j = 0; j < 11; j++) 129 | ((ulong*)state2)[j + 1] ^= ((ulong*)state)[j]; 130 | 131 | if (rowInOut != rowOut) { 132 | for (int j = 0; j < 3; j++) 133 | (DMatrix)[j + s2] = state2[j]; 134 | for (int j = 0; j < 3; j++) 135 | (DMatrix)[j + s3] ^= state[j]; 136 | } 137 | else { 138 | for (int j = 0; j < 3; j++) 139 | state2[j] ^= state[j]; 140 | for (int j = 0; j < 3; j++) 141 | (DMatrix)[j + s2] = state2[j]; 142 | } 143 | 144 | } 145 | } 146 | 147 | 148 | 149 | 150 | void reduceDuplexRowSetupf(uint rowIn, uint rowInOut, uint rowOut, ulong4 *state, __global ulong4* DMatrix) { 151 | 152 | ulong4 state2[3], state1[3]; 153 | uint ps1 = (memshift * 4 * rowIn); 154 | uint ps2 = (memshift * 4 * rowInOut); 155 | uint ps3 = (memshift * 3 + memshift * 4 * rowOut); 156 | 157 | for (int i = 0; i < 4; i++) 158 | { 159 | uint s1 = ps1 + i*memshift; 160 | uint s2 = ps2 + i*memshift; 161 | uint s3 = ps3 - i*memshift; 162 | 163 | for (int j = 0; j < 3; j++) state1[j] = (DMatrix)[j + s1]; 164 | 165 | for (int j = 0; j < 3; j++) state2[j] = (DMatrix)[j + s2]; 166 | for (int j = 0; j < 3; j++) { 167 | ulong4 tmp = state1[j] + state2[j]; 168 | state[j] ^= tmp; 169 | } 170 | round_lyra(state); 171 | 172 | for (int j = 0; j < 3; j++) { 173 | state1[j] ^= state[j]; 174 | (DMatrix)[j + s3] = state1[j]; 175 | } 176 | 177 | ((ulong*)state2)[0] ^= ((ulong*)state)[11]; 178 | for (int j = 0; j < 11; j++) 179 | ((ulong*)state2)[j + 1] ^= ((ulong*)state)[j]; 180 | for (int j = 0; j < 3; j++) 181 | (DMatrix)[j + s2] = state2[j]; 182 | } 183 | } 184 | 185 | -------------------------------------------------------------------------------- /linuxsgminer561/maxcoin.cl: -------------------------------------------------------------------------------- 1 | #define ARGS_25(x) x ## 0, x ## 1, x ## 2, x ## 3, x ## 4, x ## 5, x ## 6, x ## 7, x ## 8, x ## 9, x ## 10, x ## 11, x ## 12, x ## 13, x ## 14, x ## 15, x ## 16, x ## 17, x ## 18, x ## 19, x ## 20, x ## 21, x ## 22, x ## 23, x ## 24 2 | 3 | __constant uint2 keccak_round_constants[24] = 4 | { 5 | (uint2)(0x00000001,0x00000000), (uint2)(0x00008082,0x00000000), 6 | (uint2)(0x0000808a,0x80000000), (uint2)(0x80008000,0x80000000), 7 | (uint2)(0x0000808b,0x00000000), (uint2)(0x80000001,0x00000000), 8 | (uint2)(0x80008081,0x80000000), (uint2)(0x00008009,0x80000000), 9 | (uint2)(0x0000008a,0x00000000), (uint2)(0x00000088,0x00000000), 10 | (uint2)(0x80008009,0x00000000), (uint2)(0x8000000a,0x00000000), 11 | (uint2)(0x8000808b,0x00000000), (uint2)(0x0000008b,0x80000000), 12 | (uint2)(0x00008089,0x80000000), (uint2)(0x00008003,0x80000000), 13 | (uint2)(0x00008002,0x80000000), (uint2)(0x00000080,0x80000000), 14 | (uint2)(0x0000800a,0x00000000), (uint2)(0x8000000a,0x80000000), 15 | (uint2)(0x80008081,0x80000000), (uint2)(0x00008080,0x80000000), 16 | (uint2)(0x80000001,0x00000000), (uint2)(0x80008008,0x80000000) 17 | }; 18 | 19 | uint2 ROTL64_1(const uint2 x, const uint y) 20 | { 21 | return (uint2)((x.x<>(32-y)),(x.y<>(32-y))); 22 | } 23 | uint2 ROTL64_2(const uint2 x, const uint y) 24 | { 25 | return (uint2)((x.y<>(32-y)),(x.x<>(32-y))); 26 | } 27 | 28 | #define RND(i) \ 29 | m0 = *s0 ^ *s5 ^ *s10 ^ *s15 ^ *s20 ^ ROTL64_1(*s2 ^ *s7 ^ *s12 ^ *s17 ^ *s22, 1);\ 30 | m1 = *s1 ^ *s6 ^ *s11 ^ *s16 ^ *s21 ^ ROTL64_1(*s3 ^ *s8 ^ *s13 ^ *s18 ^ *s23, 1);\ 31 | m2 = *s2 ^ *s7 ^ *s12 ^ *s17 ^ *s22 ^ ROTL64_1(*s4 ^ *s9 ^ *s14 ^ *s19 ^ *s24, 1);\ 32 | m3 = *s3 ^ *s8 ^ *s13 ^ *s18 ^ *s23 ^ ROTL64_1(*s0 ^ *s5 ^ *s10 ^ *s15 ^ *s20, 1);\ 33 | m4 = *s4 ^ *s9 ^ *s14 ^ *s19 ^ *s24 ^ ROTL64_1(*s1 ^ *s6 ^ *s11 ^ *s16 ^ *s21, 1);\ 34 | \ 35 | m5 = *s1^m0;\ 36 | \ 37 | *s0 ^= m4;\ 38 | *s1 = ROTL64_2(*s6^m0, 12);\ 39 | *s6 = ROTL64_1(*s9^m3, 20);\ 40 | *s9 = ROTL64_2(*s22^m1, 29);\ 41 | *s22 = ROTL64_2(*s14^m3, 7);\ 42 | *s14 = ROTL64_1(*s20^m4, 18);\ 43 | *s20 = ROTL64_2(*s2^m1, 30);\ 44 | *s2 = ROTL64_2(*s12^m1, 11);\ 45 | *s12 = ROTL64_1(*s13^m2, 25);\ 46 | *s13 = ROTL64_1(*s19^m3, 8);\ 47 | *s19 = ROTL64_2(*s23^m2, 24);\ 48 | *s23 = ROTL64_2(*s15^m4, 9);\ 49 | *s15 = ROTL64_1(*s4^m3, 27);\ 50 | *s4 = ROTL64_1(*s24^m3, 14);\ 51 | *s24 = ROTL64_1(*s21^m0, 2);\ 52 | *s21 = ROTL64_2(*s8^m2, 23);\ 53 | *s8 = ROTL64_2(*s16^m0, 13);\ 54 | *s16 = ROTL64_2(*s5^m4, 4);\ 55 | *s5 = ROTL64_1(*s3^m2, 28);\ 56 | *s3 = ROTL64_1(*s18^m2, 21);\ 57 | *s18 = ROTL64_1(*s17^m1, 15);\ 58 | *s17 = ROTL64_1(*s11^m0, 10);\ 59 | *s11 = ROTL64_1(*s7^m1, 6);\ 60 | *s7 = ROTL64_1(*s10^m4, 3);\ 61 | *s10 = ROTL64_1( m5, 1);\ 62 | \ 63 | m5 = *s0; m6 = *s1; *s0 = bitselect(*s0^*s2,*s0,*s1); *s1 = bitselect(*s1^*s3,*s1,*s2); *s2 = bitselect(*s2^*s4,*s2,*s3); *s3 = bitselect(*s3^m5,*s3,*s4); *s4 = bitselect(*s4^m6,*s4,m5);\ 64 | m5 = *s5; m6 = *s6; *s5 = bitselect(*s5^*s7,*s5,*s6); *s6 = bitselect(*s6^*s8,*s6,*s7); *s7 = bitselect(*s7^*s9,*s7,*s8); *s8 = bitselect(*s8^m5,*s8,*s9); *s9 = bitselect(*s9^m6,*s9,m5);\ 65 | m5 = *s10; m6 = *s11; *s10 = bitselect(*s10^*s12,*s10,*s11); *s11 = bitselect(*s11^*s13,*s11,*s12); *s12 = bitselect(*s12^*s14,*s12,*s13); *s13 = bitselect(*s13^m5,*s13,*s14); *s14 = bitselect(*s14^m6,*s14,m5);\ 66 | m5 = *s15; m6 = *s16; *s15 = bitselect(*s15^*s17,*s15,*s16); *s16 = bitselect(*s16^*s18,*s16,*s17); *s17 = bitselect(*s17^*s19,*s17,*s18); *s18 = bitselect(*s18^m5,*s18,*s19); *s19 = bitselect(*s19^m6,*s19,m5);\ 67 | m5 = *s20; m6 = *s21; *s20 = bitselect(*s20^*s22,*s20,*s21); *s21 = bitselect(*s21^*s23,*s21,*s22); *s22 = bitselect(*s22^*s24,*s22,*s23); *s23 = bitselect(*s23^m5,*s23,*s24); *s24 = bitselect(*s24^m6,*s24,m5);\ 68 | \ 69 | *s0 ^= keccak_round_constants[i]; 70 | 71 | void keccak_block_noabsorb(ARGS_25(uint2* s)) 72 | { 73 | uint2 m0,m1,m2,m3,m4,m5,m6; 74 | RND(0); 75 | for (int i = 1; i < 22; ++i) 76 | { 77 | RND(i); 78 | ++i; 79 | RND(i); 80 | ++i; 81 | RND(i); 82 | } 83 | RND(22); 84 | RND(23); 85 | } 86 | 87 | __attribute__((reqd_work_group_size(WORKSIZE, 1, 1))) 88 | __kernel void search(__global const uint2*restrict in, __global uint*restrict output) 89 | { 90 | uint2 ARGS_25(state); 91 | 92 | state0 = in[0]; 93 | state1 = in[1]; 94 | state2 = in[2]; 95 | state3 = in[3]; 96 | state4 = in[4]; 97 | state5 = in[5]; 98 | state6 = in[6]; 99 | state7 = in[7]; 100 | state8 = in[8]; 101 | state9 = (uint2)(in[9].x,get_global_id(0)); 102 | state10 = (uint2)(1,0); 103 | state11 = 0; 104 | state12 = 0; 105 | state13 = 0; 106 | state14 = 0; 107 | state15 = 0; 108 | state16 = (uint2)(0,0x80000000U); 109 | state17 = 0; 110 | state18 = 0; 111 | state19 = 0; 112 | state20 = 0; 113 | state21 = 0; 114 | state22 = 0; 115 | state23 = 0; 116 | state24 = 0; 117 | 118 | keccak_block_noabsorb(ARGS_25(&state)); 119 | 120 | #define FOUND (0x0F) 121 | #define SETFOUND(Xnonce) output[output[FOUND]++] = Xnonce 122 | 123 | if ((state3.y & 0xFFFFFFF0U) == 0) 124 | { 125 | SETFOUND(get_global_id(0)); 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /linuxsgminer561/panama.cl: -------------------------------------------------------------------------------- 1 | /* $Id: panama.c 216 2010-06-08 09:46:57Z tp $ */ 2 | /* 3 | * PANAMA implementation. 4 | * 5 | * ==========================(LICENSE BEGIN)============================ 6 | * 7 | * Copyright (c) 2007-2010 Projet RNRT SAPHIR 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining 10 | * a copy of this software and associated documentation files (the 11 | * "Software"), to deal in the Software without restriction, including 12 | * without limitation the rights to use, copy, modify, merge, publish, 13 | * distribute, sublicense, and/or sell copies of the Software, and to 14 | * permit persons to whom the Software is furnished to do so, subject to 15 | * the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | * 28 | * ===========================(LICENSE END)============================= 29 | * 30 | * @author Thomas Pornin 31 | */ 32 | 33 | #define LVAR17(b) sph_u32 \ 34 | b ## 0, b ## 1, b ## 2, b ## 3, b ## 4, b ## 5, \ 35 | b ## 6, b ## 7, b ## 8, b ## 9, b ## 10, b ## 11, \ 36 | b ## 12, b ## 13, b ## 14, b ## 15, b ## 16; 37 | 38 | #define LVARS \ 39 | LVAR17(a) \ 40 | LVAR17(g) \ 41 | LVAR17(p) \ 42 | LVAR17(t) 43 | 44 | #define M17(macro) do { \ 45 | macro( 0, 1, 2, 4); \ 46 | macro( 1, 2, 3, 5); \ 47 | macro( 2, 3, 4, 6); \ 48 | macro( 3, 4, 5, 7); \ 49 | macro( 4, 5, 6, 8); \ 50 | macro( 5, 6, 7, 9); \ 51 | macro( 6, 7, 8, 10); \ 52 | macro( 7, 8, 9, 11); \ 53 | macro( 8, 9, 10, 12); \ 54 | macro( 9, 10, 11, 13); \ 55 | macro(10, 11, 12, 14); \ 56 | macro(11, 12, 13, 15); \ 57 | macro(12, 13, 14, 16); \ 58 | macro(13, 14, 15, 0); \ 59 | macro(14, 15, 16, 1); \ 60 | macro(15, 16, 0, 2); \ 61 | macro(16, 0, 1, 3); \ 62 | } while (0) 63 | 64 | #define BUPDATE1(n0, n2) do { \ 65 | buffer[ptr24][n0] ^= buffer[ptr31][n2]; \ 66 | buffer[ptr31][n2] ^= INW1(n2); \ 67 | } while (0) 68 | 69 | #define BUPDATE do { \ 70 | BUPDATE1(0, 2); \ 71 | BUPDATE1(1, 3); \ 72 | BUPDATE1(2, 4); \ 73 | BUPDATE1(3, 5); \ 74 | BUPDATE1(4, 6); \ 75 | BUPDATE1(5, 7); \ 76 | BUPDATE1(6, 0); \ 77 | BUPDATE1(7, 1); \ 78 | } while (0) 79 | 80 | #define RSTATE(n0, n1, n2, n4) (a ## n0 = state[n0]) 81 | 82 | #define WSTATE(n0, n1, n2, n4) (state[n0] = a ## n0) 83 | 84 | #define GAMMA(n0, n1, n2, n4) \ 85 | (g ## n0 = a ## n0 ^ (a ## n1 | SPH_T32(~a ## n2))) 86 | 87 | #define PI_ALL do { \ 88 | p0 = g0; \ 89 | p1 = SPH_ROTL32( g7, 1); \ 90 | p2 = SPH_ROTL32(g14, 3); \ 91 | p3 = SPH_ROTL32( g4, 6); \ 92 | p4 = SPH_ROTL32(g11, 10); \ 93 | p5 = SPH_ROTL32( g1, 15); \ 94 | p6 = SPH_ROTL32( g8, 21); \ 95 | p7 = SPH_ROTL32(g15, 28); \ 96 | p8 = SPH_ROTL32( g5, 4); \ 97 | p9 = SPH_ROTL32(g12, 13); \ 98 | p10 = SPH_ROTL32( g2, 23); \ 99 | p11 = SPH_ROTL32( g9, 2); \ 100 | p12 = SPH_ROTL32(g16, 14); \ 101 | p13 = SPH_ROTL32( g6, 27); \ 102 | p14 = SPH_ROTL32(g13, 9); \ 103 | p15 = SPH_ROTL32( g3, 24); \ 104 | p16 = SPH_ROTL32(g10, 8); \ 105 | } while (0) 106 | 107 | #define THETA(n0, n1, n2, n4) \ 108 | (t ## n0 = p ## n0 ^ p ## n1 ^ p ## n4) 109 | 110 | #define SIGMA_ALL do { \ 111 | a0 = t0 ^ 1; \ 112 | a1 = t1 ^ INW2(0); \ 113 | a2 = t2 ^ INW2(1); \ 114 | a3 = t3 ^ INW2(2); \ 115 | a4 = t4 ^ INW2(3); \ 116 | a5 = t5 ^ INW2(4); \ 117 | a6 = t6 ^ INW2(5); \ 118 | a7 = t7 ^ INW2(6); \ 119 | a8 = t8 ^ INW2(7); \ 120 | a9 = t9 ^ buffer[ptr16][0]; \ 121 | a10 = t10 ^ buffer[ptr16][1]; \ 122 | a11 = t11 ^ buffer[ptr16][2]; \ 123 | a12 = t12 ^ buffer[ptr16][3]; \ 124 | a13 = t13 ^ buffer[ptr16][4]; \ 125 | a14 = t14 ^ buffer[ptr16][5]; \ 126 | a15 = t15 ^ buffer[ptr16][6]; \ 127 | a16 = t16 ^ buffer[ptr16][7]; \ 128 | } while (0) 129 | 130 | #define PANAMA_STEP do { \ 131 | unsigned ptr16, ptr24, ptr31; \ 132 | \ 133 | ptr24 = (ptr0 - 8) & 31; \ 134 | ptr31 = (ptr0 - 1) & 31; \ 135 | BUPDATE; \ 136 | M17(GAMMA); \ 137 | PI_ALL; \ 138 | M17(THETA); \ 139 | ptr16 = ptr0 ^ 16; \ 140 | SIGMA_ALL; \ 141 | ptr0 = ptr31; \ 142 | } while (0) 143 | 144 | /* 145 | * These macros are used to compute 146 | */ 147 | #define INC0 1 148 | #define INC1 2 149 | #define INC2 3 150 | #define INC3 4 151 | #define INC4 5 152 | #define INC5 6 153 | #define INC6 7 154 | #define INC7 8 155 | 156 | -------------------------------------------------------------------------------- /linuxsgminer561/sgminer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/linuxsgminer561/sgminer -------------------------------------------------------------------------------- /linuxsgminer561/sha256.cl: -------------------------------------------------------------------------------- 1 | #define ROL32(x, y) rotate(x, y ## U) 2 | #define SHR(x, y) (x >> y) 3 | #define SWAP32(a) (as_uint(as_uchar4(a).wzyx)) 4 | 5 | #define S0(x) (ROL32(x, 25) ^ ROL32(x, 14) ^ SHR(x, 3)) 6 | #define S1(x) (ROL32(x, 15) ^ ROL32(x, 13) ^ SHR(x, 10)) 7 | 8 | #define S2(x) (ROL32(x, 30) ^ ROL32(x, 19) ^ ROL32(x, 10)) 9 | #define S3(x) (ROL32(x, 26) ^ ROL32(x, 21) ^ ROL32(x, 7)) 10 | 11 | #define P(a,b,c,d,e,f,g,h,x,K) \ 12 | { \ 13 | temp1 = h + S3(e) + F1(e,f,g) + (K + x); \ 14 | d += temp1; h = temp1 + S2(a) + F0(a,b,c); \ 15 | } 16 | 17 | #define F0(y, x, z) bitselect(z, y, z ^ x) 18 | #define F1(x, y, z) bitselect(z, y, x) 19 | 20 | #define R0 (W0 = S1(W14) + W9 + S0(W1) + W0) 21 | #define R1 (W1 = S1(W15) + W10 + S0(W2) + W1) 22 | #define R2 (W2 = S1(W0) + W11 + S0(W3) + W2) 23 | #define R3 (W3 = S1(W1) + W12 + S0(W4) + W3) 24 | #define R4 (W4 = S1(W2) + W13 + S0(W5) + W4) 25 | #define R5 (W5 = S1(W3) + W14 + S0(W6) + W5) 26 | #define R6 (W6 = S1(W4) + W15 + S0(W7) + W6) 27 | #define R7 (W7 = S1(W5) + W0 + S0(W8) + W7) 28 | #define R8 (W8 = S1(W6) + W1 + S0(W9) + W8) 29 | #define R9 (W9 = S1(W7) + W2 + S0(W10) + W9) 30 | #define R10 (W10 = S1(W8) + W3 + S0(W11) + W10) 31 | #define R11 (W11 = S1(W9) + W4 + S0(W12) + W11) 32 | #define R12 (W12 = S1(W10) + W5 + S0(W13) + W12) 33 | #define R13 (W13 = S1(W11) + W6 + S0(W14) + W13) 34 | #define R14 (W14 = S1(W12) + W7 + S0(W15) + W14) 35 | #define R15 (W15 = S1(W13) + W8 + S0(W0) + W15) 36 | 37 | #define RD14 (S1(W12) + W7 + S0(W15) + W14) 38 | #define RD15 (S1(W13) + W8 + S0(W0) + W15) 39 | 40 | 41 | inline uint8 sha256_round(uint16 data, uint8 buf) 42 | { 43 | uint temp1; 44 | uint8 res; 45 | uint W0 = (data.s0); 46 | uint W1 = (data.s1); 47 | uint W2 = (data.s2); 48 | uint W3 = (data.s3); 49 | uint W4 = (data.s4); 50 | uint W5 = (data.s5); 51 | uint W6 = (data.s6); 52 | uint W7 = (data.s7); 53 | uint W8 = (data.s8); 54 | uint W9 = (data.s9); 55 | uint W10 = (data.sA); 56 | uint W11 = (data.sB); 57 | uint W12 = (data.sC); 58 | uint W13 = (data.sD); 59 | uint W14 = (data.sE); 60 | uint W15 = (data.sF); 61 | 62 | uint v0 = buf.s0; 63 | uint v1 = buf.s1; 64 | uint v2 = buf.s2; 65 | uint v3 = buf.s3; 66 | uint v4 = buf.s4; 67 | uint v5 = buf.s5; 68 | uint v6 = buf.s6; 69 | uint v7 = buf.s7; 70 | 71 | P(v0, v1, v2, v3, v4, v5, v6, v7, W0, 0x428A2F98); 72 | P(v7, v0, v1, v2, v3, v4, v5, v6, W1, 0x71374491); 73 | P(v6, v7, v0, v1, v2, v3, v4, v5, W2, 0xB5C0FBCF); 74 | P(v5, v6, v7, v0, v1, v2, v3, v4, W3, 0xE9B5DBA5); 75 | P(v4, v5, v6, v7, v0, v1, v2, v3, W4, 0x3956C25B); 76 | P(v3, v4, v5, v6, v7, v0, v1, v2, W5, 0x59F111F1); 77 | P(v2, v3, v4, v5, v6, v7, v0, v1, W6, 0x923F82A4); 78 | P(v1, v2, v3, v4, v5, v6, v7, v0, W7, 0xAB1C5ED5); 79 | P(v0, v1, v2, v3, v4, v5, v6, v7, W8, 0xD807AA98); 80 | P(v7, v0, v1, v2, v3, v4, v5, v6, W9, 0x12835B01); 81 | P(v6, v7, v0, v1, v2, v3, v4, v5, W10, 0x243185BE); 82 | P(v5, v6, v7, v0, v1, v2, v3, v4, W11, 0x550C7DC3); 83 | P(v4, v5, v6, v7, v0, v1, v2, v3, W12, 0x72BE5D74); 84 | P(v3, v4, v5, v6, v7, v0, v1, v2, W13, 0x80DEB1FE); 85 | P(v2, v3, v4, v5, v6, v7, v0, v1, W14, 0x9BDC06A7); 86 | P(v1, v2, v3, v4, v5, v6, v7, v0, W15, 0xC19BF174); 87 | 88 | P(v0, v1, v2, v3, v4, v5, v6, v7, R0, 0xE49B69C1); 89 | P(v7, v0, v1, v2, v3, v4, v5, v6, R1, 0xEFBE4786); 90 | P(v6, v7, v0, v1, v2, v3, v4, v5, R2, 0x0FC19DC6); 91 | P(v5, v6, v7, v0, v1, v2, v3, v4, R3, 0x240CA1CC); 92 | P(v4, v5, v6, v7, v0, v1, v2, v3, R4, 0x2DE92C6F); 93 | P(v3, v4, v5, v6, v7, v0, v1, v2, R5, 0x4A7484AA); 94 | P(v2, v3, v4, v5, v6, v7, v0, v1, R6, 0x5CB0A9DC); 95 | P(v1, v2, v3, v4, v5, v6, v7, v0, R7, 0x76F988DA); 96 | P(v0, v1, v2, v3, v4, v5, v6, v7, R8, 0x983E5152); 97 | P(v7, v0, v1, v2, v3, v4, v5, v6, R9, 0xA831C66D); 98 | P(v6, v7, v0, v1, v2, v3, v4, v5, R10, 0xB00327C8); 99 | P(v5, v6, v7, v0, v1, v2, v3, v4, R11, 0xBF597FC7); 100 | P(v4, v5, v6, v7, v0, v1, v2, v3, R12, 0xC6E00BF3); 101 | P(v3, v4, v5, v6, v7, v0, v1, v2, R13, 0xD5A79147); 102 | P(v2, v3, v4, v5, v6, v7, v0, v1, R14, 0x06CA6351); 103 | P(v1, v2, v3, v4, v5, v6, v7, v0, R15, 0x14292967); 104 | 105 | P(v0, v1, v2, v3, v4, v5, v6, v7, R0, 0x27B70A85); 106 | P(v7, v0, v1, v2, v3, v4, v5, v6, R1, 0x2E1B2138); 107 | P(v6, v7, v0, v1, v2, v3, v4, v5, R2, 0x4D2C6DFC); 108 | P(v5, v6, v7, v0, v1, v2, v3, v4, R3, 0x53380D13); 109 | P(v4, v5, v6, v7, v0, v1, v2, v3, R4, 0x650A7354); 110 | P(v3, v4, v5, v6, v7, v0, v1, v2, R5, 0x766A0ABB); 111 | P(v2, v3, v4, v5, v6, v7, v0, v1, R6, 0x81C2C92E); 112 | P(v1, v2, v3, v4, v5, v6, v7, v0, R7, 0x92722C85); 113 | P(v0, v1, v2, v3, v4, v5, v6, v7, R8, 0xA2BFE8A1); 114 | P(v7, v0, v1, v2, v3, v4, v5, v6, R9, 0xA81A664B); 115 | P(v6, v7, v0, v1, v2, v3, v4, v5, R10, 0xC24B8B70); 116 | P(v5, v6, v7, v0, v1, v2, v3, v4, R11, 0xC76C51A3); 117 | P(v4, v5, v6, v7, v0, v1, v2, v3, R12, 0xD192E819); 118 | P(v3, v4, v5, v6, v7, v0, v1, v2, R13, 0xD6990624); 119 | P(v2, v3, v4, v5, v6, v7, v0, v1, R14, 0xF40E3585); 120 | P(v1, v2, v3, v4, v5, v6, v7, v0, R15, 0x106AA070); 121 | 122 | P(v0, v1, v2, v3, v4, v5, v6, v7, R0, 0x19A4C116); 123 | P(v7, v0, v1, v2, v3, v4, v5, v6, R1, 0x1E376C08); 124 | P(v6, v7, v0, v1, v2, v3, v4, v5, R2, 0x2748774C); 125 | P(v5, v6, v7, v0, v1, v2, v3, v4, R3, 0x34B0BCB5); 126 | P(v4, v5, v6, v7, v0, v1, v2, v3, R4, 0x391C0CB3); 127 | P(v3, v4, v5, v6, v7, v0, v1, v2, R5, 0x4ED8AA4A); 128 | P(v2, v3, v4, v5, v6, v7, v0, v1, R6, 0x5B9CCA4F); 129 | P(v1, v2, v3, v4, v5, v6, v7, v0, R7, 0x682E6FF3); 130 | P(v0, v1, v2, v3, v4, v5, v6, v7, R8, 0x748F82EE); 131 | P(v7, v0, v1, v2, v3, v4, v5, v6, R9, 0x78A5636F); 132 | P(v6, v7, v0, v1, v2, v3, v4, v5, R10, 0x84C87814); 133 | P(v5, v6, v7, v0, v1, v2, v3, v4, R11, 0x8CC70208); 134 | P(v4, v5, v6, v7, v0, v1, v2, v3, R12, 0x90BEFFFA); 135 | P(v3, v4, v5, v6, v7, v0, v1, v2, R13, 0xA4506CEB); 136 | P(v2, v3, v4, v5, v6, v7, v0, v1, RD14, 0xBEF9A3F7); 137 | P(v1, v2, v3, v4, v5, v6, v7, v0, RD15, 0xC67178F2); 138 | 139 | res.s0 = (v0 + buf.s0); 140 | res.s1 = (v1 + buf.s1); 141 | res.s2 = (v2 + buf.s2); 142 | res.s3 = (v3 + buf.s3); 143 | res.s4 = (v4 + buf.s4); 144 | res.s5 = (v5 + buf.s5); 145 | res.s6 = (v6 + buf.s6); 146 | res.s7 = (v7 + buf.s7); 147 | return (res); 148 | } 149 | 150 | -------------------------------------------------------------------------------- /linuxsgminer561/sia.cl: -------------------------------------------------------------------------------- 1 | 2 | #if __ENDIAN_LITTLE__ 3 | #define SPH_LITTLE_ENDIAN 1 4 | #else 5 | #define SPH_BIG_ENDIAN 1 6 | #endif 7 | 8 | #define SPH_UPTR sph_u64 9 | 10 | typedef unsigned int sph_u32; 11 | typedef int sph_s32; 12 | #ifndef __OPENCL_VERSION__ 13 | typedef unsigned long long sph_u64; 14 | typedef long long sph_s64; 15 | #else 16 | typedef unsigned long sph_u64; 17 | typedef long sph_s64; 18 | #endif 19 | 20 | #define SPH_64 1 21 | #define SPH_64_TRUE 1 22 | 23 | #define SWAP4(x) as_uint(as_uchar4(x).wzyx) 24 | #define SWAP8(x) as_ulong(as_uchar8(x).s76543210) 25 | 26 | #if SPH_BIG_ENDIAN 27 | #define DEC64E(x) (x) 28 | #define DEC64BE(x) (*(const __global sph_u64 *) (x)); 29 | #define DEC32LE(x) SWAP4(*(const __global sph_u32 *) (x)); 30 | #else 31 | #define DEC64E(x) SWAP8(x) 32 | #define DEC64BE(x) SWAP8(*(const __global sph_u64 *) (x)); 33 | #define DEC64LE(x) (*(const __global sph_u64 *) (x)); 34 | #define DEC32LE(x) (*(const __global sph_u32 *) (x)); 35 | #endif 36 | 37 | inline static uint2 ror64(const uint2 x, const uint y) 38 | { 39 | return (uint2)(((x).x>>y)^((x).y<<(32-y)),((x).y>>y)^((x).x<<(32-y))); 40 | } 41 | inline static uint2 ror64_2(const uint2 x, const uint y) 42 | { 43 | return (uint2)(((x).y>>(y-32))^((x).x<<(64-y)),((x).x>>(y-32))^((x).y<<(64-y))); 44 | } 45 | __constant static const uchar blake2b_sigma[12][16] = { 46 | { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } , 47 | { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } , 48 | { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 } , 49 | { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 } , 50 | { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 } , 51 | { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } , 52 | { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 } , 53 | { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 } , 54 | { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 } , 55 | { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0 } , 56 | { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } , 57 | { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } }; 58 | 59 | __kernel void search(__global unsigned char* block, volatile __global uint* output, const ulong target) { 60 | sph_u32 gid = get_global_id(0); 61 | 62 | ulong m[16]; 63 | m[0] = DEC64LE(block + 0); 64 | m[1] = DEC64LE(block + 8); 65 | m[2] = DEC64LE(block + 16); 66 | m[3] = DEC64LE(block + 24); 67 | m[4] = DEC64LE(block + 32); 68 | m[4] &= 0xFFFFFFFF00000000; 69 | m[4] ^= (gid); 70 | m[5] = DEC64LE(block + 40); 71 | m[6] = DEC64LE(block + 48); 72 | m[7] = DEC64LE(block + 56); 73 | m[8] = DEC64LE(block + 64); 74 | m[9] = DEC64LE(block + 72); 75 | m[10] = m[11] = m[12] = m[13] = m[14] = m[15] = 0; 76 | 77 | ulong v[16] = { 0x6a09e667f2bdc928, 0xbb67ae8584caa73b, 0x3c6ef372fe94f82b, 0xa54ff53a5f1d36f1, 78 | 0x510e527fade682d1, 0x9b05688c2b3e6c1f, 0x1f83d9abfb41bd6b, 0x5be0cd19137e2179, 79 | 0x6a09e667f3bcc908, 0xbb67ae8584caa73b, 0x3c6ef372fe94f82b, 0xa54ff53a5f1d36f1, 80 | 0x510e527fade68281, 0x9b05688c2b3e6c1f, 0xe07c265404be4294, 0x5be0cd19137e2179 }; 81 | 82 | #define G(r,i,a,b,c,d) \ 83 | a = a + b + m[ blake2b_sigma[r][2*i] ]; \ 84 | ((uint2*)&d)[0] = ((uint2*)&d)[0].yx ^ ((uint2*)&a)[0].yx; \ 85 | c = c + d; \ 86 | ((uint2*)&b)[0] = ror64( ((uint2*)&b)[0] ^ ((uint2*)&c)[0], 24U); \ 87 | a = a + b + m[ blake2b_sigma[r][2*i+1] ]; \ 88 | ((uint2*)&d)[0] = ror64( ((uint2*)&d)[0] ^ ((uint2*)&a)[0], 16U); \ 89 | c = c + d; \ 90 | ((uint2*)&b)[0] = ror64_2( ((uint2*)&b)[0] ^ ((uint2*)&c)[0], 63U); 91 | 92 | #define ROUND(r) \ 93 | G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \ 94 | G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \ 95 | G(r,2,v[ 2],v[ 6],v[10],v[14]); \ 96 | G(r,3,v[ 3],v[ 7],v[11],v[15]); \ 97 | G(r,4,v[ 0],v[ 5],v[10],v[15]); \ 98 | G(r,5,v[ 1],v[ 6],v[11],v[12]); \ 99 | G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \ 100 | G(r,7,v[ 3],v[ 4],v[ 9],v[14]); 101 | ROUND( 0 ); 102 | ROUND( 1 ); 103 | ROUND( 2 ); 104 | ROUND( 3 ); 105 | ROUND( 4 ); 106 | ROUND( 5 ); 107 | ROUND( 6 ); 108 | ROUND( 7 ); 109 | ROUND( 8 ); 110 | ROUND( 9 ); 111 | ROUND( 10 ); 112 | ROUND( 11 ); 113 | 114 | #undef G 115 | #undef ROUND 116 | 117 | bool result = (SWAP8(0x6a09e667f2bdc928 ^ v[0] ^ v[8]) <= target); 118 | if (result) 119 | output[output[0xFF]++] = SWAP4(gid); 120 | } 121 | -------------------------------------------------------------------------------- /linuxsgminer561/skein256.cl: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * skein256 kernel implementation. 4 | * 5 | * ==========================(LICENSE BEGIN)============================ 6 | * Copyright (c) 2014 djm34 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining 9 | * a copy of this software and associated documentation files (the 10 | * "Software"), to deal in the Software without restriction, including 11 | * without limitation the rights to use, copy, modify, merge, publish, 12 | * distribute, sublicense, and/or sell copies of the Software, and to 13 | * permit persons to whom the Software is furnished to do so, subject to 14 | * the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 22 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 23 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 25 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | * 27 | * ===========================(LICENSE END)============================= 28 | * 29 | * @author djm34 30 | */ 31 | 32 | 33 | __constant static const sph_u64 SKEIN_IV512[] = { 34 | SPH_C64(0x4903ADFF749C51CE), SPH_C64(0x0D95DE399746DF03), 35 | SPH_C64(0x8FD1934127C79BCE), SPH_C64(0x9A255629FF352CB1), 36 | SPH_C64(0x5DB62599DF6CA7B0), SPH_C64(0xEABE394CA9D5C3F4), 37 | SPH_C64(0x991112C71A75B523), SPH_C64(0xAE18A40B660FCC33) 38 | }; 39 | 40 | __constant static const sph_u64 SKEIN_IV512_256[8] = { 41 | 0xCCD044A12FDB3E13UL, 0xE83590301A79A9EBUL, 42 | 0x55AEA0614F816E6FUL, 0x2A2767A4AE9B94DBUL, 43 | 0xEC06025E74DD7683UL, 0xE7A436CDC4746251UL, 44 | 0xC36FBAF9393AD185UL, 0x3EEDBA1833EDFC13UL 45 | }; 46 | 47 | 48 | 49 | __constant static const int ROT256[8][4] = 50 | { 51 | 46, 36, 19, 37, 52 | 33, 27, 14, 42, 53 | 17, 49, 36, 39, 54 | 44, 9, 54, 56, 55 | 39, 30, 34, 24, 56 | 13, 50, 10, 17, 57 | 25, 29, 39, 43, 58 | 8, 35, 56, 22, 59 | }; 60 | 61 | __constant static const sph_u64 skein_ks_parity = 0x1BD11BDAA9FC1A22; 62 | 63 | __constant static const sph_u64 t12[6] = 64 | { 0x20UL, 65 | 0xf000000000000000UL, 66 | 0xf000000000000020UL, 67 | 0x08UL, 68 | 0xff00000000000000UL, 69 | 0xff00000000000008UL 70 | }; 71 | 72 | 73 | #define Round512(p0,p1,p2,p3,p4,p5,p6,p7,ROT) { \ 74 | p0 += p1; p1 = SPH_ROTL64(p1, ROT256[ROT][0]); p1 ^= p0; \ 75 | p2 += p3; p3 = SPH_ROTL64(p3, ROT256[ROT][1]); p3 ^= p2; \ 76 | p4 += p5; p5 = SPH_ROTL64(p5, ROT256[ROT][2]); p5 ^= p4; \ 77 | p6 += p7; p7 = SPH_ROTL64(p7, ROT256[ROT][3]); p7 ^= p6; \ 78 | } 79 | 80 | #define Round_8_512(p0, p1, p2, p3, p4, p5, p6, p7, R) { \ 81 | Round512(p0, p1, p2, p3, p4, p5, p6, p7, 0); \ 82 | Round512(p2, p1, p4, p7, p6, p5, p0, p3, 1); \ 83 | Round512(p4, p1, p6, p3, p0, p5, p2, p7, 2); \ 84 | Round512(p6, p1, p0, p7, p2, p5, p4, p3, 3); \ 85 | p0 += h[((R)+0) % 9]; \ 86 | p1 += h[((R)+1) % 9]; \ 87 | p2 += h[((R)+2) % 9]; \ 88 | p3 += h[((R)+3) % 9]; \ 89 | p4 += h[((R)+4) % 9]; \ 90 | p5 += h[((R)+5) % 9] + t[((R)+0) % 3]; \ 91 | p6 += h[((R)+6) % 9] + t[((R)+1) % 3]; \ 92 | p7 += h[((R)+7) % 9] + R; \ 93 | Round512(p0, p1, p2, p3, p4, p5, p6, p7, 4); \ 94 | Round512(p2, p1, p4, p7, p6, p5, p0, p3, 5); \ 95 | Round512(p4, p1, p6, p3, p0, p5, p2, p7, 6); \ 96 | Round512(p6, p1, p0, p7, p2, p5, p4, p3, 7); \ 97 | p0 += h[((R)+1) % 9]; \ 98 | p1 += h[((R)+2) % 9]; \ 99 | p2 += h[((R)+3) % 9]; \ 100 | p3 += h[((R)+4) % 9]; \ 101 | p4 += h[((R)+5) % 9]; \ 102 | p5 += h[((R)+6) % 9] + t[((R)+1) % 3]; \ 103 | p6 += h[((R)+7) % 9] + t[((R)+2) % 3]; \ 104 | p7 += h[((R)+8) % 9] + (R+1); \ 105 | } -------------------------------------------------------------------------------- /linuxsgminer561/whirlpoolx.cl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/linuxsgminer561/whirlpoolx.cl -------------------------------------------------------------------------------- /linuxsgminer561/wolf-sha512.cl: -------------------------------------------------------------------------------- 1 | static const __constant ulong K512[80] = 2 | { 3 | 0x428A2F98D728AE22UL, 0x7137449123EF65CDUL, 4 | 0xB5C0FBCFEC4D3B2FUL, 0xE9B5DBA58189DBBCUL, 5 | 0x3956C25BF348B538UL, 0x59F111F1B605D019UL, 6 | 0x923F82A4AF194F9BUL, 0xAB1C5ED5DA6D8118UL, 7 | 0xD807AA98A3030242UL, 0x12835B0145706FBEUL, 8 | 0x243185BE4EE4B28CUL, 0x550C7DC3D5FFB4E2UL, 9 | 0x72BE5D74F27B896FUL, 0x80DEB1FE3B1696B1UL, 10 | 0x9BDC06A725C71235UL, 0xC19BF174CF692694UL, 11 | 0xE49B69C19EF14AD2UL, 0xEFBE4786384F25E3UL, 12 | 0x0FC19DC68B8CD5B5UL, 0x240CA1CC77AC9C65UL, 13 | 0x2DE92C6F592B0275UL, 0x4A7484AA6EA6E483UL, 14 | 0x5CB0A9DCBD41FBD4UL, 0x76F988DA831153B5UL, 15 | 0x983E5152EE66DFABUL, 0xA831C66D2DB43210UL, 16 | 0xB00327C898FB213FUL, 0xBF597FC7BEEF0EE4UL, 17 | 0xC6E00BF33DA88FC2UL, 0xD5A79147930AA725UL, 18 | 0x06CA6351E003826FUL, 0x142929670A0E6E70UL, 19 | 0x27B70A8546D22FFCUL, 0x2E1B21385C26C926UL, 20 | 0x4D2C6DFC5AC42AEDUL, 0x53380D139D95B3DFUL, 21 | 0x650A73548BAF63DEUL, 0x766A0ABB3C77B2A8UL, 22 | 0x81C2C92E47EDAEE6UL, 0x92722C851482353BUL, 23 | 0xA2BFE8A14CF10364UL, 0xA81A664BBC423001UL, 24 | 0xC24B8B70D0F89791UL, 0xC76C51A30654BE30UL, 25 | 0xD192E819D6EF5218UL, 0xD69906245565A910UL, 26 | 0xF40E35855771202AUL, 0x106AA07032BBD1B8UL, 27 | 0x19A4C116B8D2D0C8UL, 0x1E376C085141AB53UL, 28 | 0x2748774CDF8EEB99UL, 0x34B0BCB5E19B48A8UL, 29 | 0x391C0CB3C5C95A63UL, 0x4ED8AA4AE3418ACBUL, 30 | 0x5B9CCA4F7763E373UL, 0x682E6FF3D6B2B8A3UL, 31 | 0x748F82EE5DEFB2FCUL, 0x78A5636F43172F60UL, 32 | 0x84C87814A1F0AB72UL, 0x8CC702081A6439ECUL, 33 | 0x90BEFFFA23631E28UL, 0xA4506CEBDE82BDE9UL, 34 | 0xBEF9A3F7B2C67915UL, 0xC67178F2E372532BUL, 35 | 0xCA273ECEEA26619CUL, 0xD186B8C721C0C207UL, 36 | 0xEADA7DD6CDE0EB1EUL, 0xF57D4F7FEE6ED178UL, 37 | 0x06F067AA72176FBAUL, 0x0A637DC5A2C898A6UL, 38 | 0x113F9804BEF90DAEUL, 0x1B710B35131C471BUL, 39 | 0x28DB77F523047D84UL, 0x32CAAB7B40C72493UL, 40 | 0x3C9EBE0A15C9BEBCUL, 0x431D67C49C100D4CUL, 41 | 0x4CC5D4BECB3E42B6UL, 0x597F299CFC657E2AUL, 42 | 0x5FCB6FAB3AD6FAECUL, 0x6C44198C4A475817UL 43 | }; 44 | 45 | static const __constant ulong SHA512_INIT[8] = 46 | { 47 | 0x6A09E667F3BCC908UL, 0xBB67AE8584CAA73BUL, 48 | 0x3C6EF372FE94F82BUL, 0xA54FF53A5F1D36F1UL, 49 | 0x510E527FADE682D1UL, 0x9B05688C2B3E6C1FUL, 50 | 0x1F83D9ABFB41BD6BUL, 0x5BE0CD19137E2179UL 51 | }; 52 | 53 | #define ROTR64(x, y) rotate((x), 64UL - (y)) 54 | 55 | ulong FAST_ROTR64_LO(const uint2 x, const uint y) { return(as_ulong(amd_bitalign(x.s10, x, y))); } 56 | ulong FAST_ROTR64_HI(const uint2 x, const uint y) { return(as_ulong(amd_bitalign(x, x.s10, (y - 32)))); } 57 | 58 | /* 59 | #define BSG5_0(x) (FAST_ROTR64_LO(x, 28) ^ FAST_ROTR64_HI(x, 34) ^ FAST_ROTR64_HI(x, 39)) 60 | #define BSG5_1(x) (FAST_ROTR64_LO(x, 14) ^ FAST_ROTR64_LO(x, 18) ^ ROTR64(x, 41)) 61 | #define SSG5_0(x) (FAST_ROTR64_LO(x, 1) ^ FAST_ROTR64_LO(x, 8) ^ ((x) >> 7)) 62 | #define SSG5_1(x) (FAST_ROTR64_LO(x, 19) ^ FAST_ROTR64_HI(x, 61) ^ ((x) >> 6)) 63 | */ 64 | 65 | #define BSG5_0(x) (FAST_ROTR64_LO(as_uint2(x), 28) ^ FAST_ROTR64_HI(as_uint2(x), 34) ^ FAST_ROTR64_HI(as_uint2(x), 39)) 66 | #define BSG5_1(x) (FAST_ROTR64_LO(as_uint2(x), 14) ^ FAST_ROTR64_LO(as_uint2(x), 18) ^ FAST_ROTR64_HI(as_uint2(x), 41)) 67 | #define SSG5_0(x) (FAST_ROTR64_LO(as_uint2(x), 1) ^ FAST_ROTR64_LO(as_uint2(x), 8) ^ ((x) >> 7)) 68 | #define SSG5_1(x) (FAST_ROTR64_LO(as_uint2(x), 19) ^ FAST_ROTR64_HI(as_uint2(x), 61) ^ ((x) >> 6)) 69 | 70 | #define CH(X, Y, Z) bitselect(Z, Y, X) 71 | #define MAJ(X, Y, Z) CH((X ^ Z), Y, Z) 72 | 73 | void SHA2_512_STEP2(const ulong *W, uint ord, ulong *r, int i) 74 | { 75 | ulong T1; 76 | int x = 8 - ord; 77 | 78 | ulong a = r[x & 7], b = r[(x + 1) & 7], c = r[(x + 2) & 7], d = r[(x + 3) & 7]; 79 | ulong e = r[(x + 4) & 7], f = r[(x + 5) & 7], g = r[(x + 6) & 7], h = r[(x + 7) & 7]; 80 | 81 | T1 = h + BSG5_1(e) + CH(e, f, g) + W[i] + K512[i]; 82 | r[(3 + x) & 7] = d + T1; 83 | r[(7 + x) & 7] = T1 + BSG5_0(a) + MAJ(a, b, c); 84 | } 85 | 86 | void SHA512Block(ulong *data, ulong *buf) 87 | { 88 | ulong W[80], r[8]; 89 | 90 | for(int i = 0; i < 8; ++i) r[i] = buf[i]; 91 | 92 | for(int i = 0; i < 16; ++i) W[i] = data[i]; 93 | 94 | #pragma unroll 4 95 | for(int i = 16; i < 80; ++i) W[i] = SSG5_1(W[i - 2]) + W[i - 7] + SSG5_0(W[i - 15]) + W[i - 16]; 96 | 97 | #pragma unroll 1 98 | for(int i = 0; i < 80; i += 8) 99 | { 100 | #pragma unroll 101 | for(int j = 0; j < 8; ++j) 102 | { 103 | SHA2_512_STEP2(W, j, r, i + j); 104 | } 105 | } 106 | 107 | for(int i = 0; i < 8; ++i) buf[i] += r[i]; 108 | } 109 | -------------------------------------------------------------------------------- /linuxsgminer561/yescrypt.cl: -------------------------------------------------------------------------------- 1 | /* 2 | * "yescrypt" kernel implementation. 3 | * 4 | * ==========================(LICENSE BEGIN)============================ 5 | * 6 | * Copyright (c) 2015 djm34 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining 9 | * a copy of this software and associated documentation files (the 10 | * "Software"), to deal in the Software without restriction, including 11 | * without limitation the rights to use, copy, modify, merge, publish, 12 | * distribute, sublicense, and/or sell copies of the Software, and to 13 | * permit persons to whom the Software is furnished to do so, subject to 14 | * the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 22 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 23 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 25 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | * 27 | * ===========================(LICENSE END)============================= 28 | * 29 | * @author djm34 30 | */ 31 | #if !defined(cl_khr_byte_addressable_store) 32 | #error "Device does not support unaligned stores" 33 | #endif 34 | 35 | #include "yescrypt_essential.cl" 36 | 37 | 38 | __attribute__((reqd_work_group_size(WORKSIZE, 1, 1))) 39 | __kernel void search(__global const uchar* restrict input, __global uint* restrict output, __global uchar *padcache, __global uchar* buff1, __global uchar* buff2, const uint target) 40 | { 41 | 42 | __global ulong16 *hashbuffer = (__global ulong16 *)(padcache + (2048 * 128 * sizeof(ulong)* (get_global_id(0) % MAX_GLOBAL_THREADS))); 43 | __global ulong16 *prevstate = (__global ulong16 *)(buff1 + (64 * 128 * sizeof(ulong)*(get_global_id(0) % MAX_GLOBAL_THREADS))); 44 | __global ulong16 *Bdev = (__global ulong16 *)(buff2 + (8 * 128 * sizeof(ulong)* (get_global_id(0) % MAX_GLOBAL_THREADS))); 45 | 46 | 47 | 48 | uint nonce = (get_global_id(0)); 49 | uint data[20]; 50 | uint16 in; 51 | uint8 state1, state2; 52 | uint8 sha256tokeep; 53 | 54 | ((uint16 *)data)[0] = ((__global const uint16 *)input)[0]; 55 | ((uint4 *)data)[4] = ((__global const uint4 *)input)[4]; 56 | for (int i = 0; i<20; i++) { data[i] = SWAP32(data[i]); } 57 | // if (nonce == 10) { printf("data %08x %08x\n", data[0], data[1]); } 58 | uint8 passwd = sha256_80(data, nonce); 59 | //pbkdf 60 | in.lo = pad1.lo ^ passwd; 61 | in.hi = pad1.hi; 62 | state1 = sha256_Transform(in, H256); 63 | 64 | in.lo = pad2.lo ^ passwd; 65 | in.hi = pad2.hi; 66 | state2 = sha256_Transform(in, H256); 67 | 68 | in = ((uint16*)data)[0]; 69 | state1 = sha256_Transform(in, state1); 70 | #pragma unroll 1 71 | for (int i = 0; i<8; i++) 72 | { 73 | uint16 result; 74 | in = pad3; 75 | in.s0 = data[16]; 76 | in.s1 = data[17]; 77 | in.s2 = data[18]; 78 | in.s3 = nonce; 79 | in.s4 = 4 * i + 1; 80 | in.lo = sha256_Transform(in, state1); 81 | in.hi = pad4; 82 | result.lo = swapvec(sha256_Transform(in, state2)); 83 | if (i == 0) sha256tokeep = result.lo; 84 | in = pad3; 85 | in.s0 = data[16]; 86 | in.s1 = data[17]; 87 | in.s2 = data[18]; 88 | in.s3 = nonce; 89 | in.s4 = 4 * i + 2; 90 | in.lo = sha256_Transform(in, state1); 91 | in.hi = pad4; 92 | result.hi = swapvec(sha256_Transform(in, state2)); 93 | Bdev[i].lo = as_ulong8(shuffle(result)); 94 | in = pad3; 95 | in.s0 = data[16]; 96 | in.s1 = data[17]; 97 | in.s2 = data[18]; 98 | in.s3 = nonce; 99 | in.s4 = 4 * i + 3; 100 | in.lo = sha256_Transform(in, state1); 101 | in.hi = pad4; 102 | result.lo = swapvec(sha256_Transform(in, state2)); 103 | in = pad3; 104 | in.s0 = data[16]; 105 | in.s1 = data[17]; 106 | in.s2 = data[18]; 107 | in.s3 = nonce; 108 | in.s4 = 4 * i + 4; 109 | in.lo = sha256_Transform(in, state1); 110 | in.hi = pad4; 111 | result.hi = swapvec(sha256_Transform(in, state2)); 112 | 113 | 114 | Bdev[i].hi = as_ulong8(shuffle(result)); 115 | } 116 | 117 | //mixing1 118 | 119 | prevstate[0] = Bdev[0]; 120 | Bdev[0] = blockmix_salsa8_small2(Bdev[0]); 121 | prevstate[1] = Bdev[0]; 122 | Bdev[0] = blockmix_salsa8_small2(Bdev[0]); 123 | 124 | uint n = 1; 125 | #pragma unroll 1 126 | for (uint i = 2; i < 64; i++) 127 | { 128 | 129 | prevstate[i] = Bdev[0]; 130 | 131 | if ((i&(i - 1)) == 0) n = n << 1; 132 | 133 | uint j = as_uint2(Bdev[0].hi.s0).x & (n - 1); 134 | 135 | j += i - n; 136 | Bdev[0] ^= prevstate[j]; 137 | 138 | Bdev[0] = blockmix_salsa8_small2(Bdev[0]); 139 | } 140 | 141 | 142 | for (int i = 0; i<8; i++) 143 | hashbuffer[i] = Bdev[i]; 144 | 145 | blockmix_pwxform((__global ulong8*)Bdev, prevstate); 146 | 147 | 148 | for (int i = 0; i<8; i++) 149 | hashbuffer[i + 8] = Bdev[i]; 150 | 151 | blockmix_pwxform((__global ulong8*)Bdev, prevstate); 152 | n = 1; 153 | #pragma unroll 1 154 | for (int i = 2; i < 2048; i++) 155 | { 156 | 157 | for (int k = 0; k<8; k++) 158 | (hashbuffer + 8 * i)[k] = Bdev[k]; 159 | 160 | 161 | if ((i&(i - 1)) == 0) n = n << 1; 162 | 163 | uint j = as_uint2(Bdev[7].hi.s0).x & (n - 1); 164 | j += i - n; 165 | 166 | for (int k = 0; k < 8; k++) 167 | Bdev[k] ^= (hashbuffer + 8 * j)[k]; 168 | 169 | 170 | blockmix_pwxform((__global ulong8*)Bdev, prevstate); 171 | } 172 | 173 | 174 | #pragma unroll 1 175 | for (int z = 0; z < 684; z++) 176 | { 177 | 178 | uint j = as_uint2(Bdev[7].hi.s0).x & 2047; 179 | 180 | 181 | for (int k = 0; k < 8; k++) 182 | Bdev[k] ^= (hashbuffer + 8 * j)[k]; 183 | 184 | if (z<682) 185 | for (int k = 0; k<8; k++) 186 | (hashbuffer + 8 * j)[k] = Bdev[k]; 187 | 188 | blockmix_pwxform((__global ulong8*)Bdev, prevstate); 189 | //// 190 | } 191 | 192 | 193 | 194 | uint8 swpass = swapvec(sha256tokeep); 195 | // uint16 in; 196 | // uint8 state1, state2; 197 | in.lo = pad1.lo ^ swpass; 198 | in.hi = pad1.hi; 199 | 200 | 201 | state1 = sha256_Transform(in, H256); 202 | 203 | in.lo = pad2.lo ^ swpass; 204 | in.hi = pad2.hi; 205 | state2 = sha256_Transform(in, H256); 206 | 207 | #pragma unroll 1 208 | for (int i = 0; i<8; i++) { 209 | in = unshuffle(Bdev[i].lo); 210 | in = swapvec16(in); 211 | state1 = sha256_Transform(in, state1); 212 | in = unshuffle(Bdev[i].hi); 213 | in = swapvec16(in); 214 | state1 = sha256_Transform(in, state1); 215 | } 216 | in = pad5; 217 | state1 = sha256_Transform(in, state1); 218 | in.lo = state1; 219 | in.hi = pad4; 220 | uint8 res = sha256_Transform(in, state2); 221 | 222 | //hmac and final sha 223 | 224 | in.lo = pad1.lo ^ res; 225 | in.hi = pad1.hi; 226 | state1 = sha256_Transform(in, H256); 227 | in.lo = pad2.lo ^ res; 228 | in.hi = pad2.hi; 229 | state2 = sha256_Transform(in, H256); 230 | in = ((uint16*)data)[0]; 231 | state1 = sha256_Transform(in, state1); 232 | in = padsha80; 233 | in.s0 = data[16]; 234 | in.s1 = data[17]; 235 | in.s2 = data[18]; 236 | in.s3 = get_global_id(0); 237 | in.sf = 0x480; 238 | state1 = sha256_Transform(in, state1); 239 | in.lo = state1; 240 | in.hi = pad4; 241 | state1 = sha256_Transform(in, state2); 242 | // state2 = H256; 243 | in.lo = state1; 244 | in.hi = pad4; 245 | in.sf = 0x100; 246 | res = sha256_Transform(in, H256); 247 | 248 | 249 | if (SWAP32(res.s7) <= (target)) 250 | output[atomic_inc(output + 0xFF)] = (nonce); 251 | 252 | } 253 | 254 | -------------------------------------------------------------------------------- /mac/minerd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/mac/minerd -------------------------------------------------------------------------------- /mac_cgminer-4.3.3/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/mac_cgminer-4.3.3/.DS_Store -------------------------------------------------------------------------------- /mac_cgminer-4.3.3/COPYING (curl).txt: -------------------------------------------------------------------------------- 1 | COPYRIGHT AND PERMISSION NOTICE 2 | 3 | Copyright (c) 1996 - 2013, Daniel Stenberg, . 4 | 5 | All rights reserved. 6 | 7 | Permission to use, copy, modify, and distribute this software for any purpose 8 | with or without fee is hereby granted, provided that the above copyright 9 | notice and this permission notice appear in all copies. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN 14 | NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 15 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 16 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 17 | OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | Except as contained in this notice, the name of a copyright holder shall not 20 | be used in advertising or otherwise to promote the sale, use or other dealings 21 | in this Software without prior written authorization of the copyright holder. 22 | -------------------------------------------------------------------------------- /mac_cgminer-4.3.3/COPYING (jansson).txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2012 Petri Lehtinen 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /mac_cgminer-4.3.3/cgminer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/mac_cgminer-4.3.3/cgminer -------------------------------------------------------------------------------- /mac_cgminer-4.3.3/curl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/mac_cgminer-4.3.3/curl -------------------------------------------------------------------------------- /mac_cgminer-4.3.3/curl-config: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/mac_cgminer-4.3.3/curl-config -------------------------------------------------------------------------------- /mac_cgminer-4.3.3/docs/AUTHORS: -------------------------------------------------------------------------------- 1 | Current maintainers and active developers: 2 | Main code+USB+ASIC+maintainer: Con Kolivas 15qSxP1SQcUX3o4nhkfdbgyoWEFMomJ4rZ 3 | API+USB+FPGA+ASIC: Andrew Smith 1Jjk2LmktEQKnv8r2cZ9MvLiZwZ9gxabKm 4 | 5 | Legacy: 6 | Original CPU mining software: Jeff Garzik 7 | BitFORCE FPGA mining and refactor: Luke Dashjr 1NbRmS6a4dniwHHoSS9v3tEYUpP1Z5VVdL 8 | -------------------------------------------------------------------------------- /mac_cgminer-4.3.3/docs/ChangeLog: -------------------------------------------------------------------------------- 1 | See git repository ('git log') for full changelog. 2 | 3 | Git repo can be found at: 4 | https://github.com/ckolivas/cgminer 5 | 6 | The NEWS file contains most of the changelog 7 | -------------------------------------------------------------------------------- /mac_cgminer-4.3.3/lib/libcurl.4.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/mac_cgminer-4.3.3/lib/libcurl.4.dylib -------------------------------------------------------------------------------- /mac_cgminer-4.3.3/lib/libcurl.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/mac_cgminer-4.3.3/lib/libcurl.a -------------------------------------------------------------------------------- /mac_cgminer-4.3.3/lib/libcurl.dylib: -------------------------------------------------------------------------------- 1 | libcurl.4.dylib -------------------------------------------------------------------------------- /mac_cgminer-4.3.3/lib/libcurl.la: -------------------------------------------------------------------------------- 1 | # libcurl.la - a libtool library file 2 | # Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.6 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # The name that we can dlopen(3). 8 | dlname='libcurl.4.dylib' 9 | 10 | # Names of this library. 11 | library_names='libcurl.4.dylib libcurl.dylib' 12 | 13 | # The name of the static archive. 14 | old_library='libcurl.a' 15 | 16 | # Linker flags that can not go in dependency_libs. 17 | inherited_linker_flags=' ' 18 | 19 | # Libraries that this one depends upon. 20 | dependency_libs=' -lssl -lcrypto -lz' 21 | 22 | # Names of additional weak libraries provided by this library 23 | weak_library_names='' 24 | 25 | # Version information for libcurl. 26 | current=7 27 | age=3 28 | revision=0 29 | 30 | # Is this an already installed library? 31 | installed=yes 32 | 33 | # Should we warn about portability when linking against -modules? 34 | shouldnotlink=no 35 | 36 | # Files to dlopen/dlpreopen 37 | dlopen='' 38 | dlpreopen='' 39 | 40 | # Directory that this library needs to be installed in: 41 | libdir='@executable_path/lib' 42 | -------------------------------------------------------------------------------- /mac_cgminer-4.3.3/lib/libjansson.4.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/mac_cgminer-4.3.3/lib/libjansson.4.dylib -------------------------------------------------------------------------------- /mac_cgminer-4.3.3/lib/libjansson.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/mac_cgminer-4.3.3/lib/libjansson.a -------------------------------------------------------------------------------- /mac_cgminer-4.3.3/lib/libjansson.dylib: -------------------------------------------------------------------------------- 1 | libjansson.4.dylib -------------------------------------------------------------------------------- /mac_cgminer-4.3.3/lib/libjansson.la: -------------------------------------------------------------------------------- 1 | # libjansson.la - a libtool library file 2 | # Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.3ubuntu1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # The name that we can dlopen(3). 8 | dlname='libjansson.4.dylib' 9 | 10 | # Names of this library. 11 | library_names='libjansson.4.dylib libjansson.dylib' 12 | 13 | # The name of the static archive. 14 | old_library='libjansson.a' 15 | 16 | # Linker flags that can not go in dependency_libs. 17 | inherited_linker_flags=' ' 18 | 19 | # Libraries that this one depends upon. 20 | dependency_libs='' 21 | 22 | # Names of additional weak libraries provided by this library 23 | weak_library_names='' 24 | 25 | # Version information for libjansson. 26 | current=9 27 | age=5 28 | revision=0 29 | 30 | # Is this an already installed library? 31 | installed=yes 32 | 33 | # Should we warn about portability when linking against -modules? 34 | shouldnotlink=no 35 | 36 | # Files to dlopen/dlpreopen 37 | dlopen='' 38 | dlpreopen='' 39 | 40 | # Directory that this library needs to be installed in: 41 | libdir='@executable_path/lib' 42 | -------------------------------------------------------------------------------- /mac_cgminer-4.3.3/lib/libusb-1.0.2.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/mac_cgminer-4.3.3/lib/libusb-1.0.2.dylib -------------------------------------------------------------------------------- /mac_cgminer-4.3.3/lib/libusb-1.0.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/mac_cgminer-4.3.3/lib/libusb-1.0.a -------------------------------------------------------------------------------- /mac_cgminer-4.3.3/lib/libusb-1.0.dylib: -------------------------------------------------------------------------------- 1 | libusb-1.0.2.dylib -------------------------------------------------------------------------------- /mac_cgminer-4.3.3/lib/libusb-1.0.la: -------------------------------------------------------------------------------- 1 | # libusb-1.0.la - a libtool library file 2 | # Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.3ubuntu1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # The name that we can dlopen(3). 8 | dlname='libusb-1.0.2.dylib' 9 | 10 | # Names of this library. 11 | library_names='libusb-1.0.2.dylib libusb-1.0.dylib' 12 | 13 | # The name of the static archive. 14 | old_library='libusb-1.0.a' 15 | 16 | # Linker flags that can not go in dependency_libs. 17 | inherited_linker_flags=' ' 18 | 19 | # Libraries that this one depends upon. 20 | dependency_libs=' -lobjc' 21 | 22 | # Names of additional weak libraries provided by this library 23 | weak_library_names='' 24 | 25 | # Version information for libusb-1.0. 26 | current=2 27 | age=0 28 | revision=0 29 | 30 | # Is this an already installed library? 31 | installed=yes 32 | 33 | # Should we warn about portability when linking against -modules? 34 | shouldnotlink=no 35 | 36 | # Files to dlopen/dlpreopen 37 | dlopen='' 38 | dlpreopen='' 39 | 40 | # Directory that this library needs to be installed in: 41 | libdir='@executable_path/lib' 42 | -------------------------------------------------------------------------------- /max_cg_win.cmd: -------------------------------------------------------------------------------- 1 | cd cgminer_366_keccak_win32 2 | cgminer --keccak --url stratum+tcp://hub.miningpoolhub.com:20461 -u aohas.aohas4 -p 888888 -------------------------------------------------------------------------------- /max_cudamin_win.cmd: -------------------------------------------------------------------------------- 1 | cd cudaminer/x64 2 | cudaminer -a keccak -o stratum+tcp://hub.miningpoolhub.com:20461 -u aohas.aohas6 -p 888888 3 | -------------------------------------------------------------------------------- /max_minerd_win.cmd: -------------------------------------------------------------------------------- 1 | cd maxcpuminer-win64 2 | minerd.exe -a keccak -o stratum+tcp://hub.miningpoolhub.com:20461 -u aohas.aohas1 -p 888888 -------------------------------------------------------------------------------- /maxcpuminer-win64/README.txt: -------------------------------------------------------------------------------- 1 | cpuminer-win64 2 | ============== 3 | 4 | cpuminer can be run either in pool or solo mode. When running in solo mode an entire block must be found before any MaxCoins will be earnt - this is unlikely to happen due to the quantity of miners on the network. Running in pool mode allows you to receive a portion of the coins earned proportional to the amount of work you contributed, as determined by the hashpower you provide. 5 | 6 | To use cpuminer in solo mode use the following command: 7 | 8 | minerd.exe -a keccak -o 127.0.0.1:8669 -u RPCUSER -p RPCPASSWORD 9 | 10 | The IP address and port are the address/port of the machine your wallet is running on. The RPC credentials are configured in your maxcoin.conf file. 11 | 12 | To use cpuminer in pool mode use the following command: 13 | 14 | minerd.exe -a keccak -o stratum+tcp://POOLURL:3333 -u USERNAME.WORKERNAME -p WORKERPASSWORD 15 | 16 | The mining pool URL, username and password are determined by the mining pool you pick. You must sign up for a pool, create a work and configure the command based upon these details. A list of pools can be found at www.maxcoin.co.uk/pools. 17 | 18 | For ease of use, copy the following into a .bat file: 19 | 20 | @echo off 21 | minerd.exe -a keccak -o stratum+tcp://POOLURL:3333 -u USERNAME.WORKERNAME -p WORKERPASSWORD -------------------------------------------------------------------------------- /maxcpuminer-win64/libcurl-4.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/maxcpuminer-win64/libcurl-4.dll -------------------------------------------------------------------------------- /maxcpuminer-win64/libeay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/maxcpuminer-win64/libeay32.dll -------------------------------------------------------------------------------- /maxcpuminer-win64/minerd.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/maxcpuminer-win64/minerd.exe -------------------------------------------------------------------------------- /maxcpuminer-win64/pthreadGC2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/maxcpuminer-win64/pthreadGC2.dll -------------------------------------------------------------------------------- /maxcpuminer-win64/ssleay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/maxcpuminer-win64/ssleay32.dll -------------------------------------------------------------------------------- /maxcpuminer-win64/zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/maxcpuminer-win64/zlib1.dll -------------------------------------------------------------------------------- /minerd_linux.sh: -------------------------------------------------------------------------------- 1 | ./minerd --timeout=6 --url=stratum+tcp://stratum.aikapool.com:7912 --userpass=aohas.aohas5:888888 2 | -------------------------------------------------------------------------------- /minerd_mac.sh: -------------------------------------------------------------------------------- 1 | mac/minerd --timeout=6 --url=stratum+tcp://stratum.aikapool.com:7912 --userpass=aohas.aohas14:888888 2 | -------------------------------------------------------------------------------- /minerd_win.cmd: -------------------------------------------------------------------------------- 1 | cd pooler-cpuminer-2.4.5-win64 2 | minerd.exe --timeout=6 --url=stratum+tcp://stratum.aikapool.com:7917 --userpass=aohas.aohas7:888888 3 | -------------------------------------------------------------------------------- /pooler-cpuminer-2.4.5-win64/libcurl-4.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/pooler-cpuminer-2.4.5-win64/libcurl-4.dll -------------------------------------------------------------------------------- /pooler-cpuminer-2.4.5-win64/libwinpthread-1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/pooler-cpuminer-2.4.5-win64/libwinpthread-1.dll -------------------------------------------------------------------------------- /pooler-cpuminer-2.4.5-win64/minerd.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/pooler-cpuminer-2.4.5-win64/minerd.exe -------------------------------------------------------------------------------- /pooler-cpuminer-2.4.5-win64/zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/pooler-cpuminer-2.4.5-win64/zlib1.dll -------------------------------------------------------------------------------- /sgminer_win.cmd: -------------------------------------------------------------------------------- 1 | cd winsgminer561 2 | sgminer --kernel darkcoin-mod -o stratum+tcp://stratum.aikapool.com:7917 -u aohas.aohas5 -p 888888 3 | -------------------------------------------------------------------------------- /sh3cgminer-3.7.3-kalrothmax/cgminer.conf: -------------------------------------------------------------------------------- 1 | { 2 | "pools" : [ 3 | { 4 | "url" : "stratum+tcp://eu.multipool.us:7777", 5 | "user" : "yourworker.1", 6 | "pass" : "password" 7 | }, 8 | { 9 | "url" : "stratum+tcp://us-west.multipool.us:7777", 10 | "user" : "yourworker.2", 11 | "pass" : "password" 12 | }, 13 | { 14 | "url" : "stratum+tcp://us-east.multipool.us:7777", 15 | "user" : "yourworker.3", 16 | "pass" : "password" 17 | }, 18 | { 19 | "url" : "stratum+tcp://us-west.multipool.us:7777", 20 | "user" : "yourworker.4", 21 | "pass" : "password" 22 | } 23 | ] 24 | , 25 | "intensity" : "13", 26 | "vectors" : "1", 27 | "worksize" : "256", 28 | "kernel" : "scrypt", 29 | "lookup-gap" : "2", 30 | "thread-concurrency" : "8192", 31 | "shaders" : "2048,", 32 | "gpu-engine" : "0-0", 33 | "gpu-fan" : "0", 34 | "gpu-memclock" : "0", 35 | "gpu-memdiff" : "0", 36 | "gpu-powertune" : "0", 37 | "gpu-vddc" : "0.000", 38 | "temp-cutoff" : "75", 39 | "temp-overheat" : "85", 40 | "temp-target" : "65", 41 | "api-port" : "4028", 42 | "expiry" : "120", 43 | "gpu-dyninterval" : "7", 44 | "gpu-platform" : "0", 45 | "gpu-threads" : "2", 46 | "hotplug" : "5", 47 | "log" : "5", 48 | "no-pool-disable" : true, 49 | "queue" : "1", 50 | "scan-time" : "60", 51 | "scrypt" : true, 52 | "temp-hysteresis" : "3", 53 | "shares" : "0", 54 | "kernel-path" : "/usr/local/bin" 55 | } 56 | -------------------------------------------------------------------------------- /sh3cgminer-3.7.3-kalrothmax/cgminer.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/sh3cgminer-3.7.3-kalrothmax/cgminer.exe -------------------------------------------------------------------------------- /sh3cgminer-3.7.3-kalrothmax/gpumax-cgminer.bat: -------------------------------------------------------------------------------- 1 | setx GPU_MAX_ALLOC_PERCENT 100 2 | setx GPU_USE_SYNC_OBJECTS 1 3 | cgminer.exe -------------------------------------------------------------------------------- /sh3cgminer-3.7.3-kalrothmax/libcurl.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/sh3cgminer-3.7.3-kalrothmax/libcurl.dll -------------------------------------------------------------------------------- /sh3cgminer-3.7.3-kalrothmax/libeay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/sh3cgminer-3.7.3-kalrothmax/libeay32.dll -------------------------------------------------------------------------------- /sh3cgminer-3.7.3-kalrothmax/libidn-11.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/sh3cgminer-3.7.3-kalrothmax/libidn-11.dll -------------------------------------------------------------------------------- /sh3cgminer-3.7.3-kalrothmax/libpdcurses.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/sh3cgminer-3.7.3-kalrothmax/libpdcurses.dll -------------------------------------------------------------------------------- /sh3cgminer-3.7.3-kalrothmax/pthreadGC2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/sh3cgminer-3.7.3-kalrothmax/pthreadGC2.dll -------------------------------------------------------------------------------- /sh3cgminer-3.7.3-kalrothmax/ssleay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/sh3cgminer-3.7.3-kalrothmax/ssleay32.dll -------------------------------------------------------------------------------- /sh3cgminer-3.7.3-kalrothmax/zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/sh3cgminer-3.7.3-kalrothmax/zlib1.dll -------------------------------------------------------------------------------- /winsgminer561/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/winsgminer561/.DS_Store -------------------------------------------------------------------------------- /winsgminer561/blake256.cl: -------------------------------------------------------------------------------- 1 | /* 2 | * blake256 kernel implementation. 3 | * 4 | * ==========================(LICENSE BEGIN)============================ 5 | * Copyright (c) 2014 djm34 6 | * Copyright (c) 2014 tpruvot 7 | * Permission is hereby granted, free of charge, to any person obtaining 8 | * a copy of this software and associated documentation files (the 9 | * "Software"), to deal in the Software without restriction, including 10 | * without limitation the rights to use, copy, modify, merge, publish, 11 | * distribute, sublicense, and/or sell copies of the Software, and to 12 | * permit persons to whom the Software is furnished to do so, subject to 13 | * the following conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be 16 | * included in all copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | * 26 | * ===========================(LICENSE END)============================= 27 | * 28 | * @author djm34 29 | */ 30 | __constant static const int sigma[16][16] = { 31 | { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, 32 | { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, 33 | { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, 34 | { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, 35 | { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, 36 | { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 }, 37 | { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 }, 38 | { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 }, 39 | { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 }, 40 | { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0 }, 41 | { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, 42 | { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, 43 | { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, 44 | { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, 45 | { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, 46 | { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } 47 | }; 48 | 49 | 50 | __constant static const sph_u32 c_IV256[8] = { 51 | 0x6A09E667, 0xBB67AE85, 52 | 0x3C6EF372, 0xA54FF53A, 53 | 0x510E527F, 0x9B05688C, 54 | 0x1F83D9AB, 0x5BE0CD19 55 | }; 56 | 57 | /* Second part (64-80) msg never change, store it */ 58 | __constant static const sph_u32 c_Padding[16] = { 59 | 0, 0, 0, 0, 60 | 0x80000000, 0, 0, 0, 61 | 0, 0, 0, 0, 62 | 0, 1, 0, 640, 63 | }; 64 | __constant static const sph_u32 c_u256[16] = { 65 | 0x243F6A88, 0x85A308D3, 66 | 0x13198A2E, 0x03707344, 67 | 0xA4093822, 0x299F31D0, 68 | 0x082EFA98, 0xEC4E6C89, 69 | 0x452821E6, 0x38D01377, 70 | 0xBE5466CF, 0x34E90C6C, 71 | 0xC0AC29B7, 0xC97C50DD, 72 | 0x3F84D5B5, 0xB5470917 73 | }; 74 | 75 | #define GS(a,b,c,d,x) { \ 76 | const sph_u32 idx1 = sigma[r][x]; \ 77 | const sph_u32 idx2 = sigma[r][x+1]; \ 78 | v[a] += (m[idx1] ^ c_u256[idx2]) + v[b]; \ 79 | v[d] ^= v[a]; \ 80 | v[d] = SPH_ROTR32(v[d], 16); \ 81 | v[c] += v[d]; \ 82 | v[b] ^= v[c]; \ 83 | v[b] = SPH_ROTR32(v[b], 12); \ 84 | \ 85 | v[a] += (m[idx2] ^ c_u256[idx1]) + v[b]; \ 86 | v[d] ^= v[a]; \ 87 | v[d] = SPH_ROTR32(v[d], 8); \ 88 | v[c] += v[d]; \ 89 | v[b] ^= v[c]; \ 90 | v[b] = SPH_ROTR32(v[b], 7); \ 91 | } 92 | 93 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /winsgminer561/cubehash256.cl: -------------------------------------------------------------------------------- 1 | // cubehash256 2 | // djm34 2015 based on ccminer cubehash512 3 | 4 | #define CUBEHASH_ROUNDS 16 /* this is r for CubeHashr/b */ 5 | #define CUBEHASH_BLOCKBYTES 32 /* this is b for CubeHashr/b */ 6 | 7 | 8 | #define LROT(x, bits) rotate( x,(uint) bits) 9 | 10 | 11 | #define ROTATEUPWARDS7(a) LROT(a,7) 12 | #define ROTATEUPWARDS11(a) LROT(a,11) 13 | 14 | #define SWAP(a,b) { uint u = a; a = b; b = u; } 15 | 16 | inline void rrounds(uint x[2][2][2][2][2]) 17 | { 18 | int r; 19 | int j; 20 | int k; 21 | int l; 22 | int m; 23 | 24 | //#pragma unroll 2 25 | for (r = 0; r < CUBEHASH_ROUNDS; ++r) { 26 | 27 | /* "add x_0jklm into x_1jklmn modulo 2^32" */ 28 | //#pragma unroll 2 29 | for (j = 0; j < 2; ++j) 30 | //#pragma unroll 2 31 | for (k = 0; k < 2; ++k) 32 | //#pragma unroll 2 33 | for (l = 0; l < 2; ++l) 34 | //#pragma unroll 2 35 | for (m = 0; m < 2; ++m) 36 | x[1][j][k][l][m] += x[0][j][k][l][m]; 37 | 38 | /* "rotate x_0jklm upwards by 7 bits" */ 39 | //#pragma unroll 2 40 | for (j = 0; j < 2; ++j) 41 | //#pragma unroll 2 42 | for (k = 0; k < 2; ++k) 43 | //#pragma unroll 2 44 | for (l = 0; l < 2; ++l) 45 | //#pragma unroll 2 46 | for (m = 0; m < 2; ++m) 47 | x[0][j][k][l][m] = ROTATEUPWARDS7(x[0][j][k][l][m]); 48 | 49 | /* "swap x_00klm with x_01klm" */ 50 | //#pragma unroll 2 51 | for (k = 0; k < 2; ++k) 52 | //#pragma unroll 2 53 | for (l = 0; l < 2; ++l) 54 | //#pragma unroll 2 55 | for (m = 0; m < 2; ++m) 56 | SWAP(x[0][0][k][l][m], x[0][1][k][l][m]) 57 | 58 | /* "xor x_1jklm into x_0jklm" */ 59 | //#pragma unroll 2 60 | for (j = 0; j < 2; ++j) 61 | //#pragma unroll 2 62 | for (k = 0; k < 2; ++k) 63 | //#pragma unroll 2 64 | for (l = 0; l < 2; ++l) 65 | //#pragma unroll 2 66 | for (m = 0; m < 2; ++m) 67 | x[0][j][k][l][m] ^= x[1][j][k][l][m]; 68 | 69 | /* "swap x_1jk0m with x_1jk1m" */ 70 | //#pragma unroll 2 71 | for (j = 0; j < 2; ++j) 72 | //#pragma unroll 2 73 | for (k = 0; k < 2; ++k) 74 | //#pragma unroll 2 75 | for (m = 0; m < 2; ++m) 76 | SWAP(x[1][j][k][0][m], x[1][j][k][1][m]) 77 | 78 | /* "add x_0jklm into x_1jklm modulo 2^32" */ 79 | //#pragma unroll 2 80 | for (j = 0; j < 2; ++j) 81 | //#pragma unroll 2 82 | for (k = 0; k < 2; ++k) 83 | //#pragma unroll 2 84 | for (l = 0; l < 2; ++l) 85 | //#pragma unroll 2 86 | for (m = 0; m < 2; ++m) 87 | x[1][j][k][l][m] += x[0][j][k][l][m]; 88 | 89 | /* "rotate x_0jklm upwards by 11 bits" */ 90 | //#pragma unroll 2 91 | for (j = 0; j < 2; ++j) 92 | //#pragma unroll 2 93 | for (k = 0; k < 2; ++k) 94 | //#pragma unroll 2 95 | for (l = 0; l < 2; ++l) 96 | //#pragma unroll 2 97 | for (m = 0; m < 2; ++m) 98 | x[0][j][k][l][m] = ROTATEUPWARDS11(x[0][j][k][l][m]); 99 | 100 | /* "swap x_0j0lm with x_0j1lm" */ 101 | //#pragma unroll 2 102 | for (j = 0; j < 2; ++j) 103 | //#pragma unroll 2 104 | for (l = 0; l < 2; ++l) 105 | //#pragma unroll 2 106 | for (m = 0; m < 2; ++m) 107 | SWAP(x[0][j][0][l][m], x[0][j][1][l][m]) 108 | 109 | /* "xor x_1jklm into x_0jklm" */ 110 | //#pragma unroll 2 111 | for (j = 0; j < 2; ++j) 112 | //#pragma unroll 2 113 | for (k = 0; k < 2; ++k) 114 | //#pragma unroll 2 115 | for (l = 0; l < 2; ++l) 116 | //#pragma unroll 2 117 | for (m = 0; m < 2; ++m) 118 | x[0][j][k][l][m] ^= x[1][j][k][l][m]; 119 | 120 | /* "swap x_1jkl0 with x_1jkl1" */ 121 | //#pragma unroll 2 122 | for (j = 0; j < 2; ++j) 123 | //#pragma unroll 2 124 | for (k = 0; k < 2; ++k) 125 | //#pragma unroll 2 126 | for (l = 0; l < 2; ++l) 127 | SWAP(x[1][j][k][l][0], x[1][j][k][l][1]) 128 | 129 | } 130 | } 131 | 132 | 133 | -------------------------------------------------------------------------------- /winsgminer561/echo.cl: -------------------------------------------------------------------------------- 1 | /* $Id: echo.c 227 2010-06-16 17:28:38Z tp $ */ 2 | /* 3 | * ECHO implementation. 4 | * 5 | * ==========================(LICENSE BEGIN)============================ 6 | * 7 | * Copyright (c) 2007-2010 Projet RNRT SAPHIR 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining 10 | * a copy of this software and associated documentation files (the 11 | * "Software"), to deal in the Software without restriction, including 12 | * without limitation the rights to use, copy, modify, merge, publish, 13 | * distribute, sublicense, and/or sell copies of the Software, and to 14 | * permit persons to whom the Software is furnished to do so, subject to 15 | * the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | * 28 | * ===========================(LICENSE END)============================= 29 | * 30 | * @author Thomas Pornin 31 | */ 32 | 33 | #define T32 SPH_T32 34 | #define C32 SPH_C32 35 | #if SPH_64 36 | #define C64 SPH_C64 37 | #endif 38 | 39 | #define AES_BIG_ENDIAN 0 40 | #include "aes_helper.cl" 41 | 42 | #define ECHO_DECL_STATE_BIG \ 43 | sph_u64 W00, W01, W10, W11, W20, W21, W30, W31, W40, W41, W50, W51, W60, W61, W70, W71, W80, W81, W90, W91, WA0, WA1, WB0, WB1, WC0, WC1, WD0, WD1, WE0, WE1, WF0, WF1; 44 | 45 | #define AES_2ROUNDS(XX, XY) do { \ 46 | sph_u32 X0 = (sph_u32)(XX); \ 47 | sph_u32 X1 = (sph_u32)(XX >> 32); \ 48 | sph_u32 X2 = (sph_u32)(XY); \ 49 | sph_u32 X3 = (sph_u32)(XY >> 32); \ 50 | sph_u32 Y0, Y1, Y2, Y3; \ 51 | AES_ROUND_LE(X0, X1, X2, X3, K0, K1, K2, K3, Y0, Y1, Y2, Y3); \ 52 | AES_ROUND_NOKEY_LE(Y0, Y1, Y2, Y3, X0, X1, X2, X3); \ 53 | XX = (sph_u64)X0 | ((sph_u64)X1 << 32); \ 54 | XY = (sph_u64)X2 | ((sph_u64)X3 << 32); \ 55 | if ((K0 = T32(K0 + 1)) == 0) { \ 56 | if ((K1 = T32(K1 + 1)) == 0) \ 57 | if ((K2 = T32(K2 + 1)) == 0) \ 58 | K3 = T32(K3 + 1); \ 59 | } \ 60 | } while (0) 61 | 62 | #define BIG_SUB_WORDS do { \ 63 | AES_2ROUNDS(W00, W01); \ 64 | AES_2ROUNDS(W10, W11); \ 65 | AES_2ROUNDS(W20, W21); \ 66 | AES_2ROUNDS(W30, W31); \ 67 | AES_2ROUNDS(W40, W41); \ 68 | AES_2ROUNDS(W50, W51); \ 69 | AES_2ROUNDS(W60, W61); \ 70 | AES_2ROUNDS(W70, W71); \ 71 | AES_2ROUNDS(W80, W81); \ 72 | AES_2ROUNDS(W90, W91); \ 73 | AES_2ROUNDS(WA0, WA1); \ 74 | AES_2ROUNDS(WB0, WB1); \ 75 | AES_2ROUNDS(WC0, WC1); \ 76 | AES_2ROUNDS(WD0, WD1); \ 77 | AES_2ROUNDS(WE0, WE1); \ 78 | AES_2ROUNDS(WF0, WF1); \ 79 | } while (0) 80 | 81 | #define SHIFT_ROW1(a, b, c, d) do { \ 82 | sph_u64 tmp; \ 83 | tmp = W ## a ## 0; \ 84 | W ## a ## 0 = W ## b ## 0; \ 85 | W ## b ## 0 = W ## c ## 0; \ 86 | W ## c ## 0 = W ## d ## 0; \ 87 | W ## d ## 0 = tmp; \ 88 | tmp = W ## a ## 1; \ 89 | W ## a ## 1 = W ## b ## 1; \ 90 | W ## b ## 1 = W ## c ## 1; \ 91 | W ## c ## 1 = W ## d ## 1; \ 92 | W ## d ## 1 = tmp; \ 93 | } while (0) 94 | 95 | #define SHIFT_ROW2(a, b, c, d) do { \ 96 | sph_u64 tmp; \ 97 | tmp = W ## a ## 0; \ 98 | W ## a ## 0 = W ## c ## 0; \ 99 | W ## c ## 0 = tmp; \ 100 | tmp = W ## b ## 0; \ 101 | W ## b ## 0 = W ## d ## 0; \ 102 | W ## d ## 0 = tmp; \ 103 | tmp = W ## a ## 1; \ 104 | W ## a ## 1 = W ## c ## 1; \ 105 | W ## c ## 1 = tmp; \ 106 | tmp = W ## b ## 1; \ 107 | W ## b ## 1 = W ## d ## 1; \ 108 | W ## d ## 1 = tmp; \ 109 | } while (0) 110 | 111 | #define SHIFT_ROW3(a, b, c, d) SHIFT_ROW1(d, c, b, a) 112 | 113 | #define BIG_SHIFT_ROWS do { \ 114 | SHIFT_ROW1(1, 5, 9, D); \ 115 | SHIFT_ROW2(2, 6, A, E); \ 116 | SHIFT_ROW3(3, 7, B, F); \ 117 | } while (0) 118 | 119 | #define MIX_COLUMN1(ia, ib, ic, id, n) do { \ 120 | sph_u64 a = W ## ia ## n; \ 121 | sph_u64 b = W ## ib ## n; \ 122 | sph_u64 c = W ## ic ## n; \ 123 | sph_u64 d = W ## id ## n; \ 124 | sph_u64 ab = a ^ b; \ 125 | sph_u64 bc = b ^ c; \ 126 | sph_u64 cd = c ^ d; \ 127 | sph_u64 abx = ((ab & C64(0x8080808080808080)) >> 7) * 27U \ 128 | ^ ((ab & C64(0x7F7F7F7F7F7F7F7F)) << 1); \ 129 | sph_u64 bcx = ((bc & C64(0x8080808080808080)) >> 7) * 27U \ 130 | ^ ((bc & C64(0x7F7F7F7F7F7F7F7F)) << 1); \ 131 | sph_u64 cdx = ((cd & C64(0x8080808080808080)) >> 7) * 27U \ 132 | ^ ((cd & C64(0x7F7F7F7F7F7F7F7F)) << 1); \ 133 | W ## ia ## n = abx ^ bc ^ d; \ 134 | W ## ib ## n = bcx ^ a ^ cd; \ 135 | W ## ic ## n = cdx ^ ab ^ d; \ 136 | W ## id ## n = abx ^ bcx ^ cdx ^ ab ^ c; \ 137 | } while (0) 138 | 139 | #define MIX_COLUMN(a, b, c, d) do { \ 140 | MIX_COLUMN1(a, b, c, d, 0); \ 141 | MIX_COLUMN1(a, b, c, d, 1); \ 142 | } while (0) 143 | 144 | #define BIG_MIX_COLUMNS do { \ 145 | MIX_COLUMN(0, 1, 2, 3); \ 146 | MIX_COLUMN(4, 5, 6, 7); \ 147 | MIX_COLUMN(8, 9, A, B); \ 148 | MIX_COLUMN(C, D, E, F); \ 149 | } while (0) 150 | 151 | #define BIG_ROUND do { \ 152 | BIG_SUB_WORDS; \ 153 | BIG_SHIFT_ROWS; \ 154 | BIG_MIX_COLUMNS; \ 155 | } while (0) 156 | 157 | #define ECHO_COMPRESS_BIG(sc) do { \ 158 | sph_u32 K0 = sc->C0; \ 159 | sph_u32 K1 = sc->C1; \ 160 | sph_u32 K2 = sc->C2; \ 161 | sph_u32 K3 = sc->C3; \ 162 | unsigned u; \ 163 | INPUT_BLOCK_BIG(sc); \ 164 | for (u = 0; u < 10; u ++) { \ 165 | BIG_ROUND; \ 166 | } \ 167 | ECHO_FINAL_BIG; \ 168 | } while (0) 169 | 170 | -------------------------------------------------------------------------------- /winsgminer561/fuguecoin.cl: -------------------------------------------------------------------------------- 1 | /* 2 | * FugueCoin kernel implementation. 3 | * 4 | * ==========================(LICENSE BEGIN)============================ 5 | * 6 | * Copyright (c) 2014 phm 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining 9 | * a copy of this software and associated documentation files (the 10 | * "Software"), to deal in the Software without restriction, including 11 | * without limitation the rights to use, copy, modify, merge, publish, 12 | * distribute, sublicense, and/or sell copies of the Software, and to 13 | * permit persons to whom the Software is furnished to do so, subject to 14 | * the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 22 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 23 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 25 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | * 27 | * ===========================(LICENSE END)============================= 28 | * 29 | * @author phm 30 | */ 31 | 32 | #ifndef FUGUECOIN_CL 33 | #define FUGUECOIN_CL 34 | 35 | #if __ENDIAN_LITTLE__ 36 | #define SPH_LITTLE_ENDIAN 1 37 | #else 38 | #define SPH_BIG_ENDIAN 1 39 | #endif 40 | 41 | #define SPH_UPTR sph_u64 42 | 43 | typedef unsigned int sph_u32; 44 | typedef int sph_s32; 45 | #ifndef __OPENCL_VERSION__ 46 | typedef unsigned long long sph_u64; 47 | typedef long long sph_s64; 48 | #else 49 | typedef unsigned long sph_u64; 50 | typedef long sph_s64; 51 | #endif 52 | 53 | #define SPH_64 1 54 | #define SPH_64_TRUE 1 55 | 56 | #define SPH_C32(x) ((sph_u32)(x ## U)) 57 | #define SPH_T32(x) ((x) & SPH_C32(0xFFFFFFFF)) 58 | #define SPH_ROTL32(x, n) SPH_T32(((x) << (n)) | ((x) >> (32 - (n)))) 59 | #define SPH_ROTR32(x, n) SPH_ROTL32(x, (32 - (n))) 60 | 61 | #define SPH_C64(x) ((sph_u64)(x ## UL)) 62 | #define SPH_T64(x) ((x) & SPH_C64(0xFFFFFFFFFFFFFFFF)) 63 | #define SPH_ROTL64(x, n) SPH_T64(((x) << (n)) | ((x) >> (64 - (n)))) 64 | #define SPH_ROTR64(x, n) SPH_ROTL64(x, (64 - (n))) 65 | 66 | #include "fugue.cl" 67 | 68 | #define SWAP4(x) as_uint(as_uchar4(x).wzyx) 69 | #define SWAP8(x) as_ulong(as_uchar8(x).s76543210) 70 | 71 | #if SPH_BIG_ENDIAN 72 | #define DEC32BE(x) (*(const __global sph_u32 *) (x)) 73 | #else 74 | #define DEC32BE(x) SWAP4(*(const __global sph_u32 *) (x)) 75 | #endif 76 | 77 | __attribute__((reqd_work_group_size(WORKSIZE, 1, 1))) 78 | __kernel void search(__global unsigned char* input, volatile __global uint* output, const ulong target) 79 | { 80 | uint gid = get_global_id(0); 81 | 82 | //mixtab 83 | __local sph_u32 mixtab0[256], mixtab1[256], mixtab2[256], mixtab3[256]; 84 | int init = get_local_id(0); 85 | int step = get_local_size(0); 86 | for (int i = init; i < 256; i += step) 87 | { 88 | mixtab0[i] = mixtab0_c[i]; 89 | mixtab1[i] = mixtab1_c[i]; 90 | mixtab2[i] = mixtab2_c[i]; 91 | mixtab3[i] = mixtab3_c[i]; 92 | } 93 | barrier(CLK_GLOBAL_MEM_FENCE); 94 | 95 | sph_u32 S00 = 0, S01 = 0, S02 = 0, S03 = 0, S04 = 0, S05 = 0, S06 = 0, S07 = 0, S08 = 0, S09 = 0; \ 96 | sph_u32 S10 = 0, S11 = 0, S12 = 0, S13 = 0, S14 = 0, S15 = 0, S16 = 0, S17 = 0, S18 = 0, S19 = 0; \ 97 | sph_u32 S20 = 0, S21 = 0, S22 = IV256[0], S23 = IV256[1], S24 = IV256[2], S25 = IV256[3], S26 = IV256[4], S27 = IV256[5], S28 = IV256[6], S29 = IV256[7]; 98 | 99 | FUGUE256_5(DEC32BE(input + 0x0), DEC32BE(input + 0x4), DEC32BE(input + 0x8), DEC32BE(input + 0xc), DEC32BE(input + 0x10)); 100 | FUGUE256_5(DEC32BE(input + 0x14), DEC32BE(input + 0x18), DEC32BE(input + 0x1c), DEC32BE(input + 0x20), DEC32BE(input + 0x24)); 101 | FUGUE256_5(DEC32BE(input + 0x28), DEC32BE(input + 0x2c), DEC32BE(input + 0x30), DEC32BE(input + 0x34), DEC32BE(input + 0x38)); 102 | FUGUE256_4(DEC32BE(input + 0x3c), DEC32BE(input + 0x40), DEC32BE(input + 0x44), DEC32BE(input + 0x48)); 103 | 104 | TIX2(SWAP4(gid), S06, S07, S14, S16, S00); 105 | CMIX30(S03, S04, S05, S07, S08, S09, S18, S19, S20); 106 | SMIX(S03, S04, S05, S06); 107 | CMIX30(S00, S01, S02, S04, S05, S06, S15, S16, S17); 108 | SMIX(S00, S01, S02, S03); 109 | 110 | TIX2(0, S00, S01, S08, S10, S24); 111 | CMIX30(S27, S28, S29, S01, S02, S03, S12, S13, S14); 112 | SMIX(S27, S28, S29, S00); 113 | CMIX30(S24, S25, S26, S28, S29, S00, S09, S10, S11); 114 | SMIX(S24, S25, S26, S27); 115 | 116 | TIX2(0x280, S24, S25, S02, S04, S18); 117 | CMIX30(S21, S22, S23, S25, S26, S27, S06, S07, S08); 118 | SMIX(S21, S22, S23, S24); 119 | CMIX30(S18, S19, S20, S22, S23, S24, S03, S04, S05); 120 | SMIX(S18, S19, S20, S21); 121 | 122 | CMIX30(S15, S16, S17, S19, S20, S21, S00, S01, S02); 123 | SMIX(S15, S16, S17, S18); 124 | CMIX30(S12, S13, S14, S16, S17, S18, S27, S28, S29); 125 | SMIX(S12, S13, S14, S15); 126 | CMIX30(S09, S10, S11, S13, S14, S15, S24, S25, S26); 127 | SMIX(S09, S10, S11, S12); 128 | CMIX30(S06, S07, S08, S10, S11, S12, S21, S22, S23); 129 | SMIX(S06, S07, S08, S09); 130 | CMIX30(S03, S04, S05, S07, S08, S09, S18, S19, S20); 131 | SMIX(S03, S04, S05, S06); 132 | CMIX30(S00, S01, S02, S04, S05, S06, S15, S16, S17); 133 | SMIX(S00, S01, S02, S03); 134 | CMIX30(S27, S28, S29, S01, S02, S03, S12, S13, S14); 135 | SMIX(S27, S28, S29, S00); 136 | CMIX30(S24, S25, S26, S28, S29, S00, S09, S10, S11); 137 | SMIX(S24, S25, S26, S27); 138 | CMIX30(S21, S22, S23, S25, S26, S27, S06, S07, S08); 139 | SMIX(S21, S22, S23, S24); 140 | CMIX30(S18, S19, S20, S22, S23, S24, S03, S04, S05); 141 | SMIX(S18, S19, S20, S21); 142 | S22 ^= S18; 143 | S03 ^= S18; 144 | SMIX(S03, S04, S05, S06); 145 | S07 ^= S03; 146 | S19 ^= S03; 147 | SMIX(S19, S20, S21, S22); 148 | S23 ^= S19; 149 | S04 ^= S19; 150 | SMIX(S04, S05, S06, S07); 151 | S08 ^= S04; 152 | S20 ^= S04; 153 | SMIX(S20, S21, S22, S23); 154 | S24 ^= S20; 155 | S05 ^= S20; 156 | SMIX(S05, S06, S07, S08); 157 | S09 ^= S05; 158 | S21 ^= S05; 159 | SMIX(S21, S22, S23, S24); 160 | S25 ^= S21; 161 | S06 ^= S21; 162 | SMIX(S06, S07, S08, S09); 163 | S10 ^= S06; 164 | S22 ^= S06; 165 | SMIX(S22, S23, S24, S25); 166 | S26 ^= S22; 167 | S07 ^= S22; 168 | SMIX(S07, S08, S09, S10); 169 | S11 ^= S07; 170 | S23 ^= S07; 171 | SMIX(S23, S24, S25, S26); 172 | S27 ^= S23; 173 | S08 ^= S23; 174 | SMIX(S08, S09, S10, S11); 175 | S12 ^= S08; 176 | S24 ^= S08; 177 | SMIX(S24, S25, S26, S27); 178 | S28 ^= S24; 179 | S09 ^= S24; 180 | SMIX(S09, S10, S11, S12); 181 | S13 ^= S09; 182 | S25 ^= S09; 183 | SMIX(S25, S26, S27, S28); 184 | S29 ^= S25; 185 | S10 ^= S25; 186 | SMIX(S10, S11, S12, S13); 187 | S14 ^= S10; 188 | S26 ^= S10; 189 | SMIX(S26, S27, S28, S29); 190 | S00 ^= S26; 191 | S11 ^= S26; 192 | SMIX(S11, S12, S13, S14); 193 | S15 ^= S11; 194 | S27 ^= S11; 195 | SMIX(S27, S28, S29, S00); 196 | S01 ^= S27; 197 | S12 ^= S27; 198 | SMIX(S12, S13, S14, S15); 199 | S16 ^= S12; 200 | S28 ^= S12; 201 | SMIX(S28, S29, S00, S01); 202 | S02 ^= S28; 203 | S13 ^= S28; 204 | SMIX(S13, S14, S15, S16); 205 | S17 ^= S13; 206 | S29 ^= S13; 207 | SMIX(S29, S00, S01, S02); 208 | S03 ^= S29; 209 | S14 ^= S29; 210 | SMIX(S14, S15, S16, S17); 211 | S18 ^= S14; 212 | S00 ^= S14; 213 | SMIX(S00, S01, S02, S03); 214 | S04 ^= S00; 215 | S15 ^= S00; 216 | SMIX(S15, S16, S17, S18); 217 | S19 ^= S15; 218 | S01 ^= S15; 219 | SMIX(S01, S02, S03, S04); 220 | 221 | S05 ^= S01; 222 | S16 ^= S01; 223 | 224 | bool result = ((((sph_u64) SWAP4(S19) << 32) | SWAP4(S18)) <= target); 225 | if (result) 226 | output[output[0xFF]++] = SWAP4(gid); 227 | } 228 | 229 | #endif // FUGUECOIN_CL 230 | -------------------------------------------------------------------------------- /winsgminer561/keccak1600.cl: -------------------------------------------------------------------------------- 1 | /* 2 | * keccak_1600 function 3 | * C. Buchner 2014 4 | * 5 | */ 6 | 7 | __constant static const sph_u64 RC[] = { 8 | SPH_C64(0x0000000000000001), SPH_C64(0x0000000000008082), 9 | SPH_C64(0x800000000000808A), SPH_C64(0x8000000080008000), 10 | SPH_C64(0x000000000000808B), SPH_C64(0x0000000080000001), 11 | SPH_C64(0x8000000080008081), SPH_C64(0x8000000000008009), 12 | SPH_C64(0x000000000000008A), SPH_C64(0x0000000000000088), 13 | SPH_C64(0x0000000080008009), SPH_C64(0x000000008000000A), 14 | SPH_C64(0x000000008000808B), SPH_C64(0x800000000000008B), 15 | SPH_C64(0x8000000000008089), SPH_C64(0x8000000000008003), 16 | SPH_C64(0x8000000000008002), SPH_C64(0x8000000000000080), 17 | SPH_C64(0x000000000000800A), SPH_C64(0x800000008000000A), 18 | SPH_C64(0x8000000080008081), SPH_C64(0x8000000000008080), 19 | SPH_C64(0x0000000080000001), SPH_C64(0x8000000080008008) 20 | }; 21 | 22 | 23 | inline void keccak_block(ulong *s) { 24 | size_t i; 25 | ulong t[5], u[5], v, w; 26 | 27 | for (i = 0; i < 24; i++) { 28 | /* theta: c = a[0,i] ^ a[1,i] ^ .. a[4,i] */ 29 | t[0] = s[0] ^ s[5] ^ s[10] ^ s[15] ^ s[20]; 30 | t[1] = s[1] ^ s[6] ^ s[11] ^ s[16] ^ s[21]; 31 | t[2] = s[2] ^ s[7] ^ s[12] ^ s[17] ^ s[22]; 32 | t[3] = s[3] ^ s[8] ^ s[13] ^ s[18] ^ s[23]; 33 | t[4] = s[4] ^ s[9] ^ s[14] ^ s[19] ^ s[24]; 34 | 35 | /* theta: d[i] = c[i+4] ^ rotl(c[i+1],1) */ 36 | u[0] = t[4] ^ SPH_ROTL64(t[1], 1); 37 | u[1] = t[0] ^ SPH_ROTL64(t[2], 1); 38 | u[2] = t[1] ^ SPH_ROTL64(t[3], 1); 39 | u[3] = t[2] ^ SPH_ROTL64(t[4], 1); 40 | u[4] = t[3] ^ SPH_ROTL64(t[0], 1); 41 | 42 | /* theta: a[0,i], a[1,i], .. a[4,i] ^= d[i] */ 43 | s[0] ^= u[0]; s[5] ^= u[0]; s[10] ^= u[0]; s[15] ^= u[0]; s[20] ^= u[0]; 44 | s[1] ^= u[1]; s[6] ^= u[1]; s[11] ^= u[1]; s[16] ^= u[1]; s[21] ^= u[1]; 45 | s[2] ^= u[2]; s[7] ^= u[2]; s[12] ^= u[2]; s[17] ^= u[2]; s[22] ^= u[2]; 46 | s[3] ^= u[3]; s[8] ^= u[3]; s[13] ^= u[3]; s[18] ^= u[3]; s[23] ^= u[3]; 47 | s[4] ^= u[4]; s[9] ^= u[4]; s[14] ^= u[4]; s[19] ^= u[4]; s[24] ^= u[4]; 48 | 49 | /* rho pi: b[..] = rotl(a[..], ..) */ 50 | v = s[1]; 51 | s[1] = SPH_ROTL64(s[6], 44); 52 | s[6] = SPH_ROTL64(s[9], 20); 53 | s[9] = SPH_ROTL64(s[22], 61); 54 | s[22] = SPH_ROTL64(s[14], 39); 55 | s[14] = SPH_ROTL64(s[20], 18); 56 | s[20] = SPH_ROTL64(s[2], 62); 57 | s[2] = SPH_ROTL64(s[12], 43); 58 | s[12] = SPH_ROTL64(s[13], 25); 59 | s[13] = SPH_ROTL64(s[19], 8); 60 | s[19] = SPH_ROTL64(s[23], 56); 61 | s[23] = SPH_ROTL64(s[15], 41); 62 | s[15] = SPH_ROTL64(s[4], 27); 63 | s[4] = SPH_ROTL64(s[24], 14); 64 | s[24] = SPH_ROTL64(s[21], 2); 65 | s[21] = SPH_ROTL64(s[8], 55); 66 | s[8] = SPH_ROTL64(s[16], 45); 67 | s[16] = SPH_ROTL64(s[5], 36); 68 | s[5] = SPH_ROTL64(s[3], 28); 69 | s[3] = SPH_ROTL64(s[18], 21); 70 | s[18] = SPH_ROTL64(s[17], 15); 71 | s[17] = SPH_ROTL64(s[11], 10); 72 | s[11] = SPH_ROTL64(s[7], 6); 73 | s[7] = SPH_ROTL64(s[10], 3); 74 | s[10] = SPH_ROTL64(v, 1); 75 | 76 | v = s[0]; w = s[1]; s[0] ^= (~w) & s[2]; s[1] ^= (~s[2]) & s[3]; s[2] ^= (~s[3]) & s[4]; s[3] ^= (~s[4]) & v; s[4] ^= (~v) & w; 77 | v = s[5]; w = s[6]; s[5] ^= (~w) & s[7]; s[6] ^= (~s[7]) & s[8]; s[7] ^= (~s[8]) & s[9]; s[8] ^= (~s[9]) & v; s[9] ^= (~v) & w; 78 | v = s[10]; w = s[11]; s[10] ^= (~w) & s[12]; s[11] ^= (~s[12]) & s[13]; s[12] ^= (~s[13]) & s[14]; s[13] ^= (~s[14]) & v; s[14] ^= (~v) & w; 79 | v = s[15]; w = s[16]; s[15] ^= (~w) & s[17]; s[16] ^= (~s[17]) & s[18]; s[17] ^= (~s[18]) & s[19]; s[18] ^= (~s[19]) & v; s[19] ^= (~v) & w; 80 | v = s[20]; w = s[21]; s[20] ^= (~w) & s[22]; s[21] ^= (~s[22]) & s[23]; s[22] ^= (~s[23]) & s[24]; s[23] ^= (~s[24]) & v; s[24] ^= (~v) & w; 81 | 82 | s[0] ^= RC[i]; 83 | } 84 | }; -------------------------------------------------------------------------------- /winsgminer561/lbry.cl: -------------------------------------------------------------------------------- 1 | #include "sha256.cl" 2 | #include "wolf-sha512.cl" 3 | #include "ripemd160.cl" 4 | 5 | #define SWAP32(x) as_uint(as_uchar4(x).s3210) 6 | #define SWAP64(x) as_ulong(as_uchar8(x).s76543210) 7 | 8 | 9 | __attribute__((reqd_work_group_size(WORKSIZE, 1, 1))) 10 | __kernel void search(__global const uint *input, __global uint8 *ctx) 11 | { 12 | // SHA256 takes 16 uints of input per block - we have 112 bytes to process 13 | // 8 * 16 == 64, meaning two block transforms. 14 | 15 | uint SHA256Buf[16]; 16 | uint gid = get_global_id(0); 17 | 18 | // Remember the last four is the nonce - so 108 bytes / 4 bytes per dword 19 | #pragma unroll 20 | for(int i = 0; i < 16; ++i) SHA256Buf[i] = SWAP32(input[i]); 21 | 22 | 23 | 24 | // SHA256 initialization constants 25 | uint8 outbuf = (uint8)(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19); 26 | 27 | #pragma unroll 28 | for(int i = 0; i < 3; ++i) 29 | { 30 | if(i == 1) 31 | { 32 | #pragma unroll 33 | for(int i = 0; i < 11; ++i) SHA256Buf[i] = SWAP32(input[i + 16]); 34 | SHA256Buf[11] = SWAP32(gid); 35 | SHA256Buf[12] = 0x80000000; 36 | SHA256Buf[13] = 0x00000000; 37 | SHA256Buf[14] = 0x00000000; 38 | SHA256Buf[15] = 0x00000380; 39 | } 40 | if(i == 2) 41 | { 42 | ((uint8 *)SHA256Buf)[0] = outbuf; 43 | SHA256Buf[8] = 0x80000000; 44 | #pragma unroll 45 | for(int i = 9; i < 15; ++i) SHA256Buf[i] = 0x00000000; 46 | SHA256Buf[15] = 0x00000100; 47 | outbuf = (uint8)(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19); 48 | } 49 | outbuf = sha256_round(((uint16 *)SHA256Buf)[0], outbuf); 50 | } 51 | 52 | /* 53 | outbuf = sha256_round(((uint16 *)SHA256Buf)[0], outbuf); 54 | #pragma unroll 55 | for(int i = 0; i < 11; ++i) SHA256Buf[i] = SWAP32(input[i + 16]); 56 | SHA256Buf[11] = SWAP32(gid); 57 | SHA256Buf[12] = 0x80000000; 58 | SHA256Buf[13] = 0x00000000; 59 | SHA256Buf[14] = 0x00000000; 60 | SHA256Buf[15] = 0x00000380; 61 | 62 | outbuf = sha256_round(((uint16 *)SHA256Buf)[0], outbuf); 63 | ((uint8 *)SHA256Buf)[0] = outbuf; 64 | SHA256Buf[8] = 0x80000000; 65 | for(int i = 9; i < 15; ++i) SHA256Buf[i] = 0x00000000; 66 | SHA256Buf[15] = 0x00000100; 67 | outbuf = (uint8)(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19); 68 | outbuf = sha256_round(((uint16 *)SHA256Buf)[0], outbuf); 69 | */ 70 | 71 | 72 | /* 73 | 74 | //outbuf = sha256_round(((uint16 *)SHA256Buf)[0], outbuf); 75 | //outbuf = sha256_round(((uint16 *)SHA256Buf)[1], outbuf); 76 | 77 | // outbuf would normall be SWAP32'd here, but it'll need it again 78 | // once we use it as input to the next SHA256, so it negates. 79 | 80 | ((uint8 *)SHA256Buf)[0] = outbuf; 81 | SHA256Buf[8] = 0x80000000; 82 | for(int i = 9; i < 15; ++i) SHA256Buf[i] = 0x00000000; 83 | SHA256Buf[15] = 0x00000100; 84 | 85 | outbuf = (uint8)(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19); 86 | outbuf = sha256_round(((uint16 *)SHA256Buf)[0], outbuf); 87 | */ 88 | 89 | 90 | 91 | outbuf.s0 = SWAP32(outbuf.s0); 92 | outbuf.s1 = SWAP32(outbuf.s1); 93 | outbuf.s2 = SWAP32(outbuf.s2); 94 | outbuf.s3 = SWAP32(outbuf.s3); 95 | outbuf.s4 = SWAP32(outbuf.s4); 96 | outbuf.s5 = SWAP32(outbuf.s5); 97 | outbuf.s6 = SWAP32(outbuf.s6); 98 | outbuf.s7 = SWAP32(outbuf.s7); 99 | 100 | ctx[get_global_id(0) - get_global_offset(0)] = outbuf; 101 | } 102 | 103 | __attribute__((reqd_work_group_size(WORKSIZE, 1, 1))) 104 | __kernel void search1(__global uint8 *ctx) 105 | { 106 | ulong W[16] = { 0UL }, SHA512Out[8]; 107 | uint SHA256Buf[16]; 108 | uint8 outbuf = ctx[get_global_id(0) - get_global_offset(0)]; 109 | 110 | ((uint8 *)W)[0] = outbuf; 111 | 112 | for(int i = 0; i < 4; ++i) W[i] = SWAP64(W[i]); 113 | 114 | W[4] = 0x8000000000000000UL; 115 | W[15] = 0x0000000000000100UL; 116 | 117 | for(int i = 0; i < 8; ++i) SHA512Out[i] = SHA512_INIT[i]; 118 | 119 | SHA512Block(W, SHA512Out); 120 | 121 | for(int i = 0; i < 8; ++i) SHA512Out[i] = SWAP64(SHA512Out[i]); 122 | 123 | uint RMD160_0[16] = { 0U }; 124 | uint RMD160_1[16] = { 0U }; 125 | uint RMD160_0_Out[5], RMD160_1_Out[5]; 126 | 127 | for(int i = 0; i < 4; ++i) 128 | { 129 | ((ulong *)RMD160_0)[i] = SHA512Out[i]; 130 | ((ulong *)RMD160_1)[i] = SHA512Out[i + 4]; 131 | } 132 | 133 | RMD160_0[8] = RMD160_1[8] = 0x00000080; 134 | RMD160_0[14] = RMD160_1[14] = 0x00000100; 135 | 136 | for(int i = 0; i < 5; ++i) 137 | { 138 | RMD160_0_Out[i] = RMD160_IV[i]; 139 | RMD160_1_Out[i] = RMD160_IV[i]; 140 | } 141 | 142 | RIPEMD160_ROUND_BODY(RMD160_0, RMD160_0_Out); 143 | RIPEMD160_ROUND_BODY(RMD160_1, RMD160_1_Out); 144 | 145 | for(int i = 0; i < 5; ++i) SHA256Buf[i] = SWAP32(RMD160_0_Out[i]); 146 | for(int i = 5; i < 10; ++i) SHA256Buf[i] = SWAP32(RMD160_1_Out[i - 5]); 147 | SHA256Buf[10] = 0x80000000; 148 | 149 | for(int i = 11; i < 15; ++i) SHA256Buf[i] = 0x00000000U; 150 | 151 | SHA256Buf[15] = 0x00000140; 152 | 153 | outbuf = (uint8)(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19); 154 | outbuf = sha256_round(((uint16 *)SHA256Buf)[0], outbuf); 155 | 156 | ctx[get_global_id(0) - get_global_offset(0)] = outbuf; 157 | } 158 | 159 | __attribute__((reqd_work_group_size(WORKSIZE, 1, 1))) 160 | __kernel void search2(__global uint8 *ctx, __global uint *output, ulong target) 161 | { 162 | uint SHA256Buf[16] = { 0U }; 163 | uint gid = get_global_id(0); 164 | uint8 outbuf = ctx[get_global_id(0) - get_global_offset(0)]; 165 | 166 | ((uint8 *)SHA256Buf)[0] = outbuf; 167 | SHA256Buf[8] = 0x80000000; 168 | for(int i = 9; i < 15; ++i) SHA256Buf[i] = 0x00000000; 169 | SHA256Buf[15] = 0x00000100; 170 | 171 | outbuf = (uint8)(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19); 172 | outbuf = sha256_round(((uint16 *)SHA256Buf)[0], outbuf); 173 | 174 | outbuf.s6 = SWAP32(outbuf.s6); 175 | outbuf.s7 = SWAP32(outbuf.s7); 176 | 177 | if(as_ulong(outbuf.s67) <= target) 178 | output[atomic_inc(output+0xFF)] = SWAP32(gid); 179 | } 180 | -------------------------------------------------------------------------------- /winsgminer561/lyra2.cl: -------------------------------------------------------------------------------- 1 | /* 2 | * Lyra2 kernel implementation. 3 | * 4 | * ==========================(LICENSE BEGIN)============================ 5 | * Copyright (c) 2014 djm34 6 | * 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining 9 | * a copy of this software and associated documentation files (the 10 | * "Software"), to deal in the Software without restriction, including 11 | * without limitation the rights to use, copy, modify, merge, publish, 12 | * distribute, sublicense, and/or sell copies of the Software, and to 13 | * permit persons to whom the Software is furnished to do so, subject to 14 | * the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 22 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 23 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 25 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | * 27 | * ===========================(LICENSE END)============================= 28 | * 29 | * @author djm34 30 | */ 31 | 32 | /*Blake2b IV Array*/ 33 | __constant static const sph_u64 blake2b_IV[8] = 34 | { 35 | 0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL, 36 | 0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL, 37 | 0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL, 38 | 0x1f83d9abfb41bd6bULL, 0x5be0cd19137e2179ULL 39 | }; 40 | 41 | /*Blake2b's rotation*/ 42 | 43 | static inline uint2 ror2(uint2 v, unsigned a) { 44 | uint2 result; 45 | unsigned n = 64 - a; 46 | if (n == 32) { return (uint2)(v.y,v.x); } 47 | if (n < 32) { 48 | result.y = ((v.y << (n)) | (v.x >> (32 - n))); 49 | result.x = ((v.x << (n)) | (v.y >> (32 - n))); 50 | } 51 | else { 52 | result.y = ((v.x << (n - 32)) | (v.y >> (64 - n))); 53 | result.x = ((v.y << (n - 32)) | (v.x >> (64 - n))); 54 | } 55 | return result; 56 | } 57 | static inline uint2 ror2l(uint2 v, unsigned a) { 58 | uint2 result; 59 | result.y = ((v.x << (32-a)) | (v.y >> (a))); 60 | result.x = ((v.y << (32-a)) | (v.x >> (a))); 61 | return result; 62 | } 63 | static inline uint2 ror2r(uint2 v, unsigned a) { 64 | uint2 result; 65 | result.y = ((v.y << (64-a)) | (v.x >> (a-32))); 66 | result.x = ((v.x << (64-a)) | (v.y >> (a-32))); 67 | return result; 68 | } 69 | /* 70 | #define G(a,b,c,d) \ 71 | do { \ 72 | a = as_uint2(as_ulong(a)+as_ulong(b)); d ^= a; d = d.yx; \ 73 | c = as_uint2(as_ulong(c)+as_ulong(d)); b ^= c; b = ror2l(b, 24); \ 74 | a = as_uint2(as_ulong(a)+as_ulong(b)); d ^= a; d = ror2l(d, 16); \ 75 | c = as_uint2(as_ulong(c)+as_ulong(d)); b ^= c; b = ror2r(b, 63); \ 76 | } while(0) 77 | */ 78 | #define G(a,b,c,d) \ 79 | do { \ 80 | a = as_uint2(as_ulong(a)+as_ulong(b)); d ^= a; d = d.yx; \ 81 | c = as_uint2(as_ulong(c)+as_ulong(d)); b ^= c; b = as_uint2(as_uchar8(b).s34567012); \ 82 | a = as_uint2(as_ulong(a)+as_ulong(b)); d ^= a; d = ror2l(d, 16); \ 83 | c = as_uint2(as_ulong(c)+as_ulong(d)); b ^= c; b = ror2r(b, 63); \ 84 | } while(0) 85 | 86 | /*One Round of the Blake2b's compression function*/ 87 | #define round_lyra(v) \ 88 | do { \ 89 | G(v[ 0],v[ 4],v[ 8],v[12]); \ 90 | G(v[ 1],v[ 5],v[ 9],v[13]); \ 91 | G(v[ 2],v[ 6],v[10],v[14]); \ 92 | G(v[ 3],v[ 7],v[11],v[15]); \ 93 | G(v[ 0],v[ 5],v[10],v[15]); \ 94 | G(v[ 1],v[ 6],v[11],v[12]); \ 95 | G(v[ 2],v[ 7],v[ 8],v[13]); \ 96 | G(v[ 3],v[ 4],v[ 9],v[14]); \ 97 | } while(0) 98 | 99 | 100 | #define reduceDuplexRowSetup(rowIn, rowInOut, rowOut) \ 101 | { \ 102 | for (int i = 0; i < 8; i++) \ 103 | { \ 104 | \ 105 | for (int j = 0; j < 12; j++) {state[j] ^= as_uint2(as_ulong(Matrix[12 * i + j][rowIn]) + as_ulong(Matrix[12 * i + j][rowInOut]));} \ 106 | round_lyra(state); \ 107 | for (int j = 0; j < 12; j++) {Matrix[j + 84 - 12 * i][rowOut] = Matrix[12 * i + j][rowIn] ^ state[j];} \ 108 | \ 109 | Matrix[0 + 12 * i][rowInOut] ^= state[11]; \ 110 | Matrix[1 + 12 * i][rowInOut] ^= state[0]; \ 111 | Matrix[2 + 12 * i][rowInOut] ^= state[1]; \ 112 | Matrix[3 + 12 * i][rowInOut] ^= state[2]; \ 113 | Matrix[4 + 12 * i][rowInOut] ^= state[3]; \ 114 | Matrix[5 + 12 * i][rowInOut] ^= state[4]; \ 115 | Matrix[6 + 12 * i][rowInOut] ^= state[5]; \ 116 | Matrix[7 + 12 * i][rowInOut] ^= state[6]; \ 117 | Matrix[8 + 12 * i][rowInOut] ^= state[7]; \ 118 | Matrix[9 + 12 * i][rowInOut] ^= state[8]; \ 119 | Matrix[10 + 12 * i][rowInOut] ^= state[9]; \ 120 | Matrix[11 + 12 * i][rowInOut] ^= state[10]; \ 121 | } \ 122 | \ 123 | } 124 | 125 | #define reduceDuplexRow(rowIn, rowInOut, rowOut) \ 126 | { \ 127 | for (int i = 0; i < 8; i++) \ 128 | { \ 129 | for (int j = 0; j < 12; j++) \ 130 | state[j] ^= as_uint2(as_ulong(Matrix[12 * i + j][rowIn]) + as_ulong(Matrix[12 * i + j][rowInOut])); \ 131 | \ 132 | round_lyra(state); \ 133 | for (int j = 0; j < 12; j++) {Matrix[j + 12 * i][rowOut] ^= state[j];} \ 134 | \ 135 | Matrix[0 + 12 * i][rowInOut] ^= state[11]; \ 136 | Matrix[1 + 12 * i][rowInOut] ^= state[0]; \ 137 | Matrix[2 + 12 * i][rowInOut] ^= state[1]; \ 138 | Matrix[3 + 12 * i][rowInOut] ^= state[2]; \ 139 | Matrix[4 + 12 * i][rowInOut] ^= state[3]; \ 140 | Matrix[5 + 12 * i][rowInOut] ^= state[4]; \ 141 | Matrix[6 + 12 * i][rowInOut] ^= state[5]; \ 142 | Matrix[7 + 12 * i][rowInOut] ^= state[6]; \ 143 | Matrix[8 + 12 * i][rowInOut] ^= state[7]; \ 144 | Matrix[9 + 12 * i][rowInOut] ^= state[8]; \ 145 | Matrix[10 + 12 * i][rowInOut] ^= state[9]; \ 146 | Matrix[11 + 12 * i][rowInOut] ^= state[10]; \ 147 | } \ 148 | \ 149 | } 150 | #define absorbblock(in) { \ 151 | state[0] ^= Matrix[0][in]; \ 152 | state[1] ^= Matrix[1][in]; \ 153 | state[2] ^= Matrix[2][in]; \ 154 | state[3] ^= Matrix[3][in]; \ 155 | state[4] ^= Matrix[4][in]; \ 156 | state[5] ^= Matrix[5][in]; \ 157 | state[6] ^= Matrix[6][in]; \ 158 | state[7] ^= Matrix[7][in]; \ 159 | state[8] ^= Matrix[8][in]; \ 160 | state[9] ^= Matrix[9][in]; \ 161 | state[10] ^= Matrix[10][in]; \ 162 | state[11] ^= Matrix[11][in]; \ 163 | round_lyra(state); \ 164 | round_lyra(state); \ 165 | round_lyra(state); \ 166 | round_lyra(state); \ 167 | round_lyra(state); \ 168 | round_lyra(state); \ 169 | round_lyra(state); \ 170 | round_lyra(state); \ 171 | round_lyra(state); \ 172 | round_lyra(state); \ 173 | round_lyra(state); \ 174 | round_lyra(state); \ 175 | } 176 | -------------------------------------------------------------------------------- /winsgminer561/lyra2v2.cl: -------------------------------------------------------------------------------- 1 | /* 2 | * Lyra2 kernel implementation. 3 | * 4 | * ==========================(LICENSE BEGIN)============================ 5 | * Copyright (c) 2014 djm34 6 | * 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining 9 | * a copy of this software and associated documentation files (the 10 | * "Software"), to deal in the Software without restriction, including 11 | * without limitation the rights to use, copy, modify, merge, publish, 12 | * distribute, sublicense, and/or sell copies of the Software, and to 13 | * permit persons to whom the Software is furnished to do so, subject to 14 | * the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 22 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 23 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 25 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | * 27 | * ===========================(LICENSE END)============================= 28 | * 29 | * @author djm34 30 | */ 31 | 32 | 33 | 34 | #define ROTL64(x,n) rotate(x,(ulong)n) 35 | #define ROTR64(x,n) rotate(x,(ulong)(64-n)) 36 | #define SWAP32(x) as_ulong(as_uint2(x).s10) 37 | #define SWAP24(x) as_ulong(as_uchar8(x).s34567012) 38 | #define SWAP16(x) as_ulong(as_uchar8(x).s23456701) 39 | 40 | #define G(a,b,c,d) \ 41 | do { \ 42 | a += b; d ^= a; d = SWAP32(d); \ 43 | c += d; b ^= c; b = ROTR64(b,24); \ 44 | a += b; d ^= a; d = ROTR64(d,16); \ 45 | c += d; b ^= c; b = ROTR64(b, 63); \ 46 | \ 47 | } while (0) 48 | 49 | #define G_old(a,b,c,d) \ 50 | do { \ 51 | a += b; d ^= a; d = ROTR64(d, 32); \ 52 | c += d; b ^= c; b = ROTR64(b, 24); \ 53 | a += b; d ^= a; d = ROTR64(d, 16); \ 54 | c += d; b ^= c; b = ROTR64(b, 63); \ 55 | \ 56 | } while (0) 57 | 58 | 59 | /*One Round of the Blake2b's compression function*/ 60 | 61 | #define round_lyra(s) \ 62 | do { \ 63 | G(s[0].x, s[1].x, s[2].x, s[3].x); \ 64 | G(s[0].y, s[1].y, s[2].y, s[3].y); \ 65 | G(s[0].z, s[1].z, s[2].z, s[3].z); \ 66 | G(s[0].w, s[1].w, s[2].w, s[3].w); \ 67 | G(s[0].x, s[1].y, s[2].z, s[3].w); \ 68 | G(s[0].y, s[1].z, s[2].w, s[3].x); \ 69 | G(s[0].z, s[1].w, s[2].x, s[3].y); \ 70 | G(s[0].w, s[1].x, s[2].y, s[3].z); \ 71 | } while(0) 72 | 73 | 74 | 75 | void reduceDuplexf(ulong4* state ,__global ulong4* DMatrix) 76 | { 77 | 78 | ulong4 state1[3]; 79 | uint ps1 = 0; 80 | uint ps2 = (memshift * 3 + memshift * 4); 81 | //#pragma unroll 4 82 | for (int i = 0; i < 4; i++) 83 | { 84 | uint s1 = ps1 + i*memshift; 85 | uint s2 = ps2 - i*memshift; 86 | 87 | for (int j = 0; j < 3; j++) state1[j] = (DMatrix)[j + s1]; 88 | 89 | for (int j = 0; j < 3; j++) state[j] ^= state1[j]; 90 | round_lyra(state); 91 | for (int j = 0; j < 3; j++) state1[j] ^= state[j]; 92 | 93 | for (int j = 0; j < 3; j++) (DMatrix)[j + s2] = state1[j]; 94 | } 95 | 96 | } 97 | 98 | 99 | 100 | void reduceDuplexRowf(uint rowIn,uint rowInOut,uint rowOut,ulong4 * state, __global ulong4 * DMatrix) 101 | { 102 | 103 | ulong4 state1[3], state2[3]; 104 | uint ps1 = (memshift * 4 * rowIn); 105 | uint ps2 = (memshift * 4 * rowInOut); 106 | uint ps3 = (memshift * 4 * rowOut); 107 | 108 | 109 | for (int i = 0; i < 4; i++) 110 | { 111 | uint s1 = ps1 + i*memshift; 112 | uint s2 = ps2 + i*memshift; 113 | uint s3 = ps3 + i*memshift; 114 | 115 | 116 | for (int j = 0; j < 3; j++) state1[j] = (DMatrix)[j + s1]; 117 | 118 | for (int j = 0; j < 3; j++) state2[j] = (DMatrix)[j + s2]; 119 | 120 | for (int j = 0; j < 3; j++) state1[j] += state2[j]; 121 | 122 | for (int j = 0; j < 3; j++) state[j] ^= state1[j]; 123 | 124 | 125 | round_lyra(state); 126 | 127 | ((ulong*)state2)[0] ^= ((ulong*)state)[11]; 128 | for (int j = 0; j < 11; j++) 129 | ((ulong*)state2)[j + 1] ^= ((ulong*)state)[j]; 130 | 131 | if (rowInOut != rowOut) { 132 | for (int j = 0; j < 3; j++) 133 | (DMatrix)[j + s2] = state2[j]; 134 | for (int j = 0; j < 3; j++) 135 | (DMatrix)[j + s3] ^= state[j]; 136 | } 137 | else { 138 | for (int j = 0; j < 3; j++) 139 | state2[j] ^= state[j]; 140 | for (int j = 0; j < 3; j++) 141 | (DMatrix)[j + s2] = state2[j]; 142 | } 143 | 144 | } 145 | } 146 | 147 | 148 | 149 | 150 | void reduceDuplexRowSetupf(uint rowIn, uint rowInOut, uint rowOut, ulong4 *state, __global ulong4* DMatrix) { 151 | 152 | ulong4 state2[3], state1[3]; 153 | uint ps1 = (memshift * 4 * rowIn); 154 | uint ps2 = (memshift * 4 * rowInOut); 155 | uint ps3 = (memshift * 3 + memshift * 4 * rowOut); 156 | 157 | for (int i = 0; i < 4; i++) 158 | { 159 | uint s1 = ps1 + i*memshift; 160 | uint s2 = ps2 + i*memshift; 161 | uint s3 = ps3 - i*memshift; 162 | 163 | for (int j = 0; j < 3; j++) state1[j] = (DMatrix)[j + s1]; 164 | 165 | for (int j = 0; j < 3; j++) state2[j] = (DMatrix)[j + s2]; 166 | for (int j = 0; j < 3; j++) { 167 | ulong4 tmp = state1[j] + state2[j]; 168 | state[j] ^= tmp; 169 | } 170 | round_lyra(state); 171 | 172 | for (int j = 0; j < 3; j++) { 173 | state1[j] ^= state[j]; 174 | (DMatrix)[j + s3] = state1[j]; 175 | } 176 | 177 | ((ulong*)state2)[0] ^= ((ulong*)state)[11]; 178 | for (int j = 0; j < 11; j++) 179 | ((ulong*)state2)[j + 1] ^= ((ulong*)state)[j]; 180 | for (int j = 0; j < 3; j++) 181 | (DMatrix)[j + s2] = state2[j]; 182 | } 183 | } 184 | 185 | -------------------------------------------------------------------------------- /winsgminer561/maxcoin.cl: -------------------------------------------------------------------------------- 1 | #define ARGS_25(x) x ## 0, x ## 1, x ## 2, x ## 3, x ## 4, x ## 5, x ## 6, x ## 7, x ## 8, x ## 9, x ## 10, x ## 11, x ## 12, x ## 13, x ## 14, x ## 15, x ## 16, x ## 17, x ## 18, x ## 19, x ## 20, x ## 21, x ## 22, x ## 23, x ## 24 2 | 3 | __constant uint2 keccak_round_constants[24] = 4 | { 5 | (uint2)(0x00000001,0x00000000), (uint2)(0x00008082,0x00000000), 6 | (uint2)(0x0000808a,0x80000000), (uint2)(0x80008000,0x80000000), 7 | (uint2)(0x0000808b,0x00000000), (uint2)(0x80000001,0x00000000), 8 | (uint2)(0x80008081,0x80000000), (uint2)(0x00008009,0x80000000), 9 | (uint2)(0x0000008a,0x00000000), (uint2)(0x00000088,0x00000000), 10 | (uint2)(0x80008009,0x00000000), (uint2)(0x8000000a,0x00000000), 11 | (uint2)(0x8000808b,0x00000000), (uint2)(0x0000008b,0x80000000), 12 | (uint2)(0x00008089,0x80000000), (uint2)(0x00008003,0x80000000), 13 | (uint2)(0x00008002,0x80000000), (uint2)(0x00000080,0x80000000), 14 | (uint2)(0x0000800a,0x00000000), (uint2)(0x8000000a,0x80000000), 15 | (uint2)(0x80008081,0x80000000), (uint2)(0x00008080,0x80000000), 16 | (uint2)(0x80000001,0x00000000), (uint2)(0x80008008,0x80000000) 17 | }; 18 | 19 | uint2 ROTL64_1(const uint2 x, const uint y) 20 | { 21 | return (uint2)((x.x<>(32-y)),(x.y<>(32-y))); 22 | } 23 | uint2 ROTL64_2(const uint2 x, const uint y) 24 | { 25 | return (uint2)((x.y<>(32-y)),(x.x<>(32-y))); 26 | } 27 | 28 | #define RND(i) \ 29 | m0 = *s0 ^ *s5 ^ *s10 ^ *s15 ^ *s20 ^ ROTL64_1(*s2 ^ *s7 ^ *s12 ^ *s17 ^ *s22, 1);\ 30 | m1 = *s1 ^ *s6 ^ *s11 ^ *s16 ^ *s21 ^ ROTL64_1(*s3 ^ *s8 ^ *s13 ^ *s18 ^ *s23, 1);\ 31 | m2 = *s2 ^ *s7 ^ *s12 ^ *s17 ^ *s22 ^ ROTL64_1(*s4 ^ *s9 ^ *s14 ^ *s19 ^ *s24, 1);\ 32 | m3 = *s3 ^ *s8 ^ *s13 ^ *s18 ^ *s23 ^ ROTL64_1(*s0 ^ *s5 ^ *s10 ^ *s15 ^ *s20, 1);\ 33 | m4 = *s4 ^ *s9 ^ *s14 ^ *s19 ^ *s24 ^ ROTL64_1(*s1 ^ *s6 ^ *s11 ^ *s16 ^ *s21, 1);\ 34 | \ 35 | m5 = *s1^m0;\ 36 | \ 37 | *s0 ^= m4;\ 38 | *s1 = ROTL64_2(*s6^m0, 12);\ 39 | *s6 = ROTL64_1(*s9^m3, 20);\ 40 | *s9 = ROTL64_2(*s22^m1, 29);\ 41 | *s22 = ROTL64_2(*s14^m3, 7);\ 42 | *s14 = ROTL64_1(*s20^m4, 18);\ 43 | *s20 = ROTL64_2(*s2^m1, 30);\ 44 | *s2 = ROTL64_2(*s12^m1, 11);\ 45 | *s12 = ROTL64_1(*s13^m2, 25);\ 46 | *s13 = ROTL64_1(*s19^m3, 8);\ 47 | *s19 = ROTL64_2(*s23^m2, 24);\ 48 | *s23 = ROTL64_2(*s15^m4, 9);\ 49 | *s15 = ROTL64_1(*s4^m3, 27);\ 50 | *s4 = ROTL64_1(*s24^m3, 14);\ 51 | *s24 = ROTL64_1(*s21^m0, 2);\ 52 | *s21 = ROTL64_2(*s8^m2, 23);\ 53 | *s8 = ROTL64_2(*s16^m0, 13);\ 54 | *s16 = ROTL64_2(*s5^m4, 4);\ 55 | *s5 = ROTL64_1(*s3^m2, 28);\ 56 | *s3 = ROTL64_1(*s18^m2, 21);\ 57 | *s18 = ROTL64_1(*s17^m1, 15);\ 58 | *s17 = ROTL64_1(*s11^m0, 10);\ 59 | *s11 = ROTL64_1(*s7^m1, 6);\ 60 | *s7 = ROTL64_1(*s10^m4, 3);\ 61 | *s10 = ROTL64_1( m5, 1);\ 62 | \ 63 | m5 = *s0; m6 = *s1; *s0 = bitselect(*s0^*s2,*s0,*s1); *s1 = bitselect(*s1^*s3,*s1,*s2); *s2 = bitselect(*s2^*s4,*s2,*s3); *s3 = bitselect(*s3^m5,*s3,*s4); *s4 = bitselect(*s4^m6,*s4,m5);\ 64 | m5 = *s5; m6 = *s6; *s5 = bitselect(*s5^*s7,*s5,*s6); *s6 = bitselect(*s6^*s8,*s6,*s7); *s7 = bitselect(*s7^*s9,*s7,*s8); *s8 = bitselect(*s8^m5,*s8,*s9); *s9 = bitselect(*s9^m6,*s9,m5);\ 65 | m5 = *s10; m6 = *s11; *s10 = bitselect(*s10^*s12,*s10,*s11); *s11 = bitselect(*s11^*s13,*s11,*s12); *s12 = bitselect(*s12^*s14,*s12,*s13); *s13 = bitselect(*s13^m5,*s13,*s14); *s14 = bitselect(*s14^m6,*s14,m5);\ 66 | m5 = *s15; m6 = *s16; *s15 = bitselect(*s15^*s17,*s15,*s16); *s16 = bitselect(*s16^*s18,*s16,*s17); *s17 = bitselect(*s17^*s19,*s17,*s18); *s18 = bitselect(*s18^m5,*s18,*s19); *s19 = bitselect(*s19^m6,*s19,m5);\ 67 | m5 = *s20; m6 = *s21; *s20 = bitselect(*s20^*s22,*s20,*s21); *s21 = bitselect(*s21^*s23,*s21,*s22); *s22 = bitselect(*s22^*s24,*s22,*s23); *s23 = bitselect(*s23^m5,*s23,*s24); *s24 = bitselect(*s24^m6,*s24,m5);\ 68 | \ 69 | *s0 ^= keccak_round_constants[i]; 70 | 71 | void keccak_block_noabsorb(ARGS_25(uint2* s)) 72 | { 73 | uint2 m0,m1,m2,m3,m4,m5,m6; 74 | RND(0); 75 | for (int i = 1; i < 22; ++i) 76 | { 77 | RND(i); 78 | ++i; 79 | RND(i); 80 | ++i; 81 | RND(i); 82 | } 83 | RND(22); 84 | RND(23); 85 | } 86 | 87 | __attribute__((reqd_work_group_size(WORKSIZE, 1, 1))) 88 | __kernel void search(__global const uint2*restrict in, __global uint*restrict output) 89 | { 90 | uint2 ARGS_25(state); 91 | 92 | state0 = in[0]; 93 | state1 = in[1]; 94 | state2 = in[2]; 95 | state3 = in[3]; 96 | state4 = in[4]; 97 | state5 = in[5]; 98 | state6 = in[6]; 99 | state7 = in[7]; 100 | state8 = in[8]; 101 | state9 = (uint2)(in[9].x,get_global_id(0)); 102 | state10 = (uint2)(1,0); 103 | state11 = 0; 104 | state12 = 0; 105 | state13 = 0; 106 | state14 = 0; 107 | state15 = 0; 108 | state16 = (uint2)(0,0x80000000U); 109 | state17 = 0; 110 | state18 = 0; 111 | state19 = 0; 112 | state20 = 0; 113 | state21 = 0; 114 | state22 = 0; 115 | state23 = 0; 116 | state24 = 0; 117 | 118 | keccak_block_noabsorb(ARGS_25(&state)); 119 | 120 | #define FOUND (0x0F) 121 | #define SETFOUND(Xnonce) output[output[FOUND]++] = Xnonce 122 | 123 | if ((state3.y & 0xFFFFFFF0U) == 0) 124 | { 125 | SETFOUND(get_global_id(0)); 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /winsgminer561/panama.cl: -------------------------------------------------------------------------------- 1 | /* $Id: panama.c 216 2010-06-08 09:46:57Z tp $ */ 2 | /* 3 | * PANAMA implementation. 4 | * 5 | * ==========================(LICENSE BEGIN)============================ 6 | * 7 | * Copyright (c) 2007-2010 Projet RNRT SAPHIR 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining 10 | * a copy of this software and associated documentation files (the 11 | * "Software"), to deal in the Software without restriction, including 12 | * without limitation the rights to use, copy, modify, merge, publish, 13 | * distribute, sublicense, and/or sell copies of the Software, and to 14 | * permit persons to whom the Software is furnished to do so, subject to 15 | * the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | * 28 | * ===========================(LICENSE END)============================= 29 | * 30 | * @author Thomas Pornin 31 | */ 32 | 33 | #define LVAR17(b) sph_u32 \ 34 | b ## 0, b ## 1, b ## 2, b ## 3, b ## 4, b ## 5, \ 35 | b ## 6, b ## 7, b ## 8, b ## 9, b ## 10, b ## 11, \ 36 | b ## 12, b ## 13, b ## 14, b ## 15, b ## 16; 37 | 38 | #define LVARS \ 39 | LVAR17(a) \ 40 | LVAR17(g) \ 41 | LVAR17(p) \ 42 | LVAR17(t) 43 | 44 | #define M17(macro) do { \ 45 | macro( 0, 1, 2, 4); \ 46 | macro( 1, 2, 3, 5); \ 47 | macro( 2, 3, 4, 6); \ 48 | macro( 3, 4, 5, 7); \ 49 | macro( 4, 5, 6, 8); \ 50 | macro( 5, 6, 7, 9); \ 51 | macro( 6, 7, 8, 10); \ 52 | macro( 7, 8, 9, 11); \ 53 | macro( 8, 9, 10, 12); \ 54 | macro( 9, 10, 11, 13); \ 55 | macro(10, 11, 12, 14); \ 56 | macro(11, 12, 13, 15); \ 57 | macro(12, 13, 14, 16); \ 58 | macro(13, 14, 15, 0); \ 59 | macro(14, 15, 16, 1); \ 60 | macro(15, 16, 0, 2); \ 61 | macro(16, 0, 1, 3); \ 62 | } while (0) 63 | 64 | #define BUPDATE1(n0, n2) do { \ 65 | buffer[ptr24][n0] ^= buffer[ptr31][n2]; \ 66 | buffer[ptr31][n2] ^= INW1(n2); \ 67 | } while (0) 68 | 69 | #define BUPDATE do { \ 70 | BUPDATE1(0, 2); \ 71 | BUPDATE1(1, 3); \ 72 | BUPDATE1(2, 4); \ 73 | BUPDATE1(3, 5); \ 74 | BUPDATE1(4, 6); \ 75 | BUPDATE1(5, 7); \ 76 | BUPDATE1(6, 0); \ 77 | BUPDATE1(7, 1); \ 78 | } while (0) 79 | 80 | #define RSTATE(n0, n1, n2, n4) (a ## n0 = state[n0]) 81 | 82 | #define WSTATE(n0, n1, n2, n4) (state[n0] = a ## n0) 83 | 84 | #define GAMMA(n0, n1, n2, n4) \ 85 | (g ## n0 = a ## n0 ^ (a ## n1 | SPH_T32(~a ## n2))) 86 | 87 | #define PI_ALL do { \ 88 | p0 = g0; \ 89 | p1 = SPH_ROTL32( g7, 1); \ 90 | p2 = SPH_ROTL32(g14, 3); \ 91 | p3 = SPH_ROTL32( g4, 6); \ 92 | p4 = SPH_ROTL32(g11, 10); \ 93 | p5 = SPH_ROTL32( g1, 15); \ 94 | p6 = SPH_ROTL32( g8, 21); \ 95 | p7 = SPH_ROTL32(g15, 28); \ 96 | p8 = SPH_ROTL32( g5, 4); \ 97 | p9 = SPH_ROTL32(g12, 13); \ 98 | p10 = SPH_ROTL32( g2, 23); \ 99 | p11 = SPH_ROTL32( g9, 2); \ 100 | p12 = SPH_ROTL32(g16, 14); \ 101 | p13 = SPH_ROTL32( g6, 27); \ 102 | p14 = SPH_ROTL32(g13, 9); \ 103 | p15 = SPH_ROTL32( g3, 24); \ 104 | p16 = SPH_ROTL32(g10, 8); \ 105 | } while (0) 106 | 107 | #define THETA(n0, n1, n2, n4) \ 108 | (t ## n0 = p ## n0 ^ p ## n1 ^ p ## n4) 109 | 110 | #define SIGMA_ALL do { \ 111 | a0 = t0 ^ 1; \ 112 | a1 = t1 ^ INW2(0); \ 113 | a2 = t2 ^ INW2(1); \ 114 | a3 = t3 ^ INW2(2); \ 115 | a4 = t4 ^ INW2(3); \ 116 | a5 = t5 ^ INW2(4); \ 117 | a6 = t6 ^ INW2(5); \ 118 | a7 = t7 ^ INW2(6); \ 119 | a8 = t8 ^ INW2(7); \ 120 | a9 = t9 ^ buffer[ptr16][0]; \ 121 | a10 = t10 ^ buffer[ptr16][1]; \ 122 | a11 = t11 ^ buffer[ptr16][2]; \ 123 | a12 = t12 ^ buffer[ptr16][3]; \ 124 | a13 = t13 ^ buffer[ptr16][4]; \ 125 | a14 = t14 ^ buffer[ptr16][5]; \ 126 | a15 = t15 ^ buffer[ptr16][6]; \ 127 | a16 = t16 ^ buffer[ptr16][7]; \ 128 | } while (0) 129 | 130 | #define PANAMA_STEP do { \ 131 | unsigned ptr16, ptr24, ptr31; \ 132 | \ 133 | ptr24 = (ptr0 - 8) & 31; \ 134 | ptr31 = (ptr0 - 1) & 31; \ 135 | BUPDATE; \ 136 | M17(GAMMA); \ 137 | PI_ALL; \ 138 | M17(THETA); \ 139 | ptr16 = ptr0 ^ 16; \ 140 | SIGMA_ALL; \ 141 | ptr0 = ptr31; \ 142 | } while (0) 143 | 144 | /* 145 | * These macros are used to compute 146 | */ 147 | #define INC0 1 148 | #define INC1 2 149 | #define INC2 3 150 | #define INC3 4 151 | #define INC4 5 152 | #define INC5 6 153 | #define INC6 7 154 | #define INC7 8 155 | 156 | -------------------------------------------------------------------------------- /winsgminer561/sgminer.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/winsgminer561/sgminer.exe -------------------------------------------------------------------------------- /winsgminer561/sha256.cl: -------------------------------------------------------------------------------- 1 | #define ROL32(x, y) rotate(x, y ## U) 2 | #define SHR(x, y) (x >> y) 3 | #define SWAP32(a) (as_uint(as_uchar4(a).wzyx)) 4 | 5 | #define S0(x) (ROL32(x, 25) ^ ROL32(x, 14) ^ SHR(x, 3)) 6 | #define S1(x) (ROL32(x, 15) ^ ROL32(x, 13) ^ SHR(x, 10)) 7 | 8 | #define S2(x) (ROL32(x, 30) ^ ROL32(x, 19) ^ ROL32(x, 10)) 9 | #define S3(x) (ROL32(x, 26) ^ ROL32(x, 21) ^ ROL32(x, 7)) 10 | 11 | #define P(a,b,c,d,e,f,g,h,x,K) \ 12 | { \ 13 | temp1 = h + S3(e) + F1(e,f,g) + (K + x); \ 14 | d += temp1; h = temp1 + S2(a) + F0(a,b,c); \ 15 | } 16 | 17 | #define F0(y, x, z) bitselect(z, y, z ^ x) 18 | #define F1(x, y, z) bitselect(z, y, x) 19 | 20 | #define R0 (W0 = S1(W14) + W9 + S0(W1) + W0) 21 | #define R1 (W1 = S1(W15) + W10 + S0(W2) + W1) 22 | #define R2 (W2 = S1(W0) + W11 + S0(W3) + W2) 23 | #define R3 (W3 = S1(W1) + W12 + S0(W4) + W3) 24 | #define R4 (W4 = S1(W2) + W13 + S0(W5) + W4) 25 | #define R5 (W5 = S1(W3) + W14 + S0(W6) + W5) 26 | #define R6 (W6 = S1(W4) + W15 + S0(W7) + W6) 27 | #define R7 (W7 = S1(W5) + W0 + S0(W8) + W7) 28 | #define R8 (W8 = S1(W6) + W1 + S0(W9) + W8) 29 | #define R9 (W9 = S1(W7) + W2 + S0(W10) + W9) 30 | #define R10 (W10 = S1(W8) + W3 + S0(W11) + W10) 31 | #define R11 (W11 = S1(W9) + W4 + S0(W12) + W11) 32 | #define R12 (W12 = S1(W10) + W5 + S0(W13) + W12) 33 | #define R13 (W13 = S1(W11) + W6 + S0(W14) + W13) 34 | #define R14 (W14 = S1(W12) + W7 + S0(W15) + W14) 35 | #define R15 (W15 = S1(W13) + W8 + S0(W0) + W15) 36 | 37 | #define RD14 (S1(W12) + W7 + S0(W15) + W14) 38 | #define RD15 (S1(W13) + W8 + S0(W0) + W15) 39 | 40 | 41 | inline uint8 sha256_round(uint16 data, uint8 buf) 42 | { 43 | uint temp1; 44 | uint8 res; 45 | uint W0 = (data.s0); 46 | uint W1 = (data.s1); 47 | uint W2 = (data.s2); 48 | uint W3 = (data.s3); 49 | uint W4 = (data.s4); 50 | uint W5 = (data.s5); 51 | uint W6 = (data.s6); 52 | uint W7 = (data.s7); 53 | uint W8 = (data.s8); 54 | uint W9 = (data.s9); 55 | uint W10 = (data.sA); 56 | uint W11 = (data.sB); 57 | uint W12 = (data.sC); 58 | uint W13 = (data.sD); 59 | uint W14 = (data.sE); 60 | uint W15 = (data.sF); 61 | 62 | uint v0 = buf.s0; 63 | uint v1 = buf.s1; 64 | uint v2 = buf.s2; 65 | uint v3 = buf.s3; 66 | uint v4 = buf.s4; 67 | uint v5 = buf.s5; 68 | uint v6 = buf.s6; 69 | uint v7 = buf.s7; 70 | 71 | P(v0, v1, v2, v3, v4, v5, v6, v7, W0, 0x428A2F98); 72 | P(v7, v0, v1, v2, v3, v4, v5, v6, W1, 0x71374491); 73 | P(v6, v7, v0, v1, v2, v3, v4, v5, W2, 0xB5C0FBCF); 74 | P(v5, v6, v7, v0, v1, v2, v3, v4, W3, 0xE9B5DBA5); 75 | P(v4, v5, v6, v7, v0, v1, v2, v3, W4, 0x3956C25B); 76 | P(v3, v4, v5, v6, v7, v0, v1, v2, W5, 0x59F111F1); 77 | P(v2, v3, v4, v5, v6, v7, v0, v1, W6, 0x923F82A4); 78 | P(v1, v2, v3, v4, v5, v6, v7, v0, W7, 0xAB1C5ED5); 79 | P(v0, v1, v2, v3, v4, v5, v6, v7, W8, 0xD807AA98); 80 | P(v7, v0, v1, v2, v3, v4, v5, v6, W9, 0x12835B01); 81 | P(v6, v7, v0, v1, v2, v3, v4, v5, W10, 0x243185BE); 82 | P(v5, v6, v7, v0, v1, v2, v3, v4, W11, 0x550C7DC3); 83 | P(v4, v5, v6, v7, v0, v1, v2, v3, W12, 0x72BE5D74); 84 | P(v3, v4, v5, v6, v7, v0, v1, v2, W13, 0x80DEB1FE); 85 | P(v2, v3, v4, v5, v6, v7, v0, v1, W14, 0x9BDC06A7); 86 | P(v1, v2, v3, v4, v5, v6, v7, v0, W15, 0xC19BF174); 87 | 88 | P(v0, v1, v2, v3, v4, v5, v6, v7, R0, 0xE49B69C1); 89 | P(v7, v0, v1, v2, v3, v4, v5, v6, R1, 0xEFBE4786); 90 | P(v6, v7, v0, v1, v2, v3, v4, v5, R2, 0x0FC19DC6); 91 | P(v5, v6, v7, v0, v1, v2, v3, v4, R3, 0x240CA1CC); 92 | P(v4, v5, v6, v7, v0, v1, v2, v3, R4, 0x2DE92C6F); 93 | P(v3, v4, v5, v6, v7, v0, v1, v2, R5, 0x4A7484AA); 94 | P(v2, v3, v4, v5, v6, v7, v0, v1, R6, 0x5CB0A9DC); 95 | P(v1, v2, v3, v4, v5, v6, v7, v0, R7, 0x76F988DA); 96 | P(v0, v1, v2, v3, v4, v5, v6, v7, R8, 0x983E5152); 97 | P(v7, v0, v1, v2, v3, v4, v5, v6, R9, 0xA831C66D); 98 | P(v6, v7, v0, v1, v2, v3, v4, v5, R10, 0xB00327C8); 99 | P(v5, v6, v7, v0, v1, v2, v3, v4, R11, 0xBF597FC7); 100 | P(v4, v5, v6, v7, v0, v1, v2, v3, R12, 0xC6E00BF3); 101 | P(v3, v4, v5, v6, v7, v0, v1, v2, R13, 0xD5A79147); 102 | P(v2, v3, v4, v5, v6, v7, v0, v1, R14, 0x06CA6351); 103 | P(v1, v2, v3, v4, v5, v6, v7, v0, R15, 0x14292967); 104 | 105 | P(v0, v1, v2, v3, v4, v5, v6, v7, R0, 0x27B70A85); 106 | P(v7, v0, v1, v2, v3, v4, v5, v6, R1, 0x2E1B2138); 107 | P(v6, v7, v0, v1, v2, v3, v4, v5, R2, 0x4D2C6DFC); 108 | P(v5, v6, v7, v0, v1, v2, v3, v4, R3, 0x53380D13); 109 | P(v4, v5, v6, v7, v0, v1, v2, v3, R4, 0x650A7354); 110 | P(v3, v4, v5, v6, v7, v0, v1, v2, R5, 0x766A0ABB); 111 | P(v2, v3, v4, v5, v6, v7, v0, v1, R6, 0x81C2C92E); 112 | P(v1, v2, v3, v4, v5, v6, v7, v0, R7, 0x92722C85); 113 | P(v0, v1, v2, v3, v4, v5, v6, v7, R8, 0xA2BFE8A1); 114 | P(v7, v0, v1, v2, v3, v4, v5, v6, R9, 0xA81A664B); 115 | P(v6, v7, v0, v1, v2, v3, v4, v5, R10, 0xC24B8B70); 116 | P(v5, v6, v7, v0, v1, v2, v3, v4, R11, 0xC76C51A3); 117 | P(v4, v5, v6, v7, v0, v1, v2, v3, R12, 0xD192E819); 118 | P(v3, v4, v5, v6, v7, v0, v1, v2, R13, 0xD6990624); 119 | P(v2, v3, v4, v5, v6, v7, v0, v1, R14, 0xF40E3585); 120 | P(v1, v2, v3, v4, v5, v6, v7, v0, R15, 0x106AA070); 121 | 122 | P(v0, v1, v2, v3, v4, v5, v6, v7, R0, 0x19A4C116); 123 | P(v7, v0, v1, v2, v3, v4, v5, v6, R1, 0x1E376C08); 124 | P(v6, v7, v0, v1, v2, v3, v4, v5, R2, 0x2748774C); 125 | P(v5, v6, v7, v0, v1, v2, v3, v4, R3, 0x34B0BCB5); 126 | P(v4, v5, v6, v7, v0, v1, v2, v3, R4, 0x391C0CB3); 127 | P(v3, v4, v5, v6, v7, v0, v1, v2, R5, 0x4ED8AA4A); 128 | P(v2, v3, v4, v5, v6, v7, v0, v1, R6, 0x5B9CCA4F); 129 | P(v1, v2, v3, v4, v5, v6, v7, v0, R7, 0x682E6FF3); 130 | P(v0, v1, v2, v3, v4, v5, v6, v7, R8, 0x748F82EE); 131 | P(v7, v0, v1, v2, v3, v4, v5, v6, R9, 0x78A5636F); 132 | P(v6, v7, v0, v1, v2, v3, v4, v5, R10, 0x84C87814); 133 | P(v5, v6, v7, v0, v1, v2, v3, v4, R11, 0x8CC70208); 134 | P(v4, v5, v6, v7, v0, v1, v2, v3, R12, 0x90BEFFFA); 135 | P(v3, v4, v5, v6, v7, v0, v1, v2, R13, 0xA4506CEB); 136 | P(v2, v3, v4, v5, v6, v7, v0, v1, RD14, 0xBEF9A3F7); 137 | P(v1, v2, v3, v4, v5, v6, v7, v0, RD15, 0xC67178F2); 138 | 139 | res.s0 = (v0 + buf.s0); 140 | res.s1 = (v1 + buf.s1); 141 | res.s2 = (v2 + buf.s2); 142 | res.s3 = (v3 + buf.s3); 143 | res.s4 = (v4 + buf.s4); 144 | res.s5 = (v5 + buf.s5); 145 | res.s6 = (v6 + buf.s6); 146 | res.s7 = (v7 + buf.s7); 147 | return (res); 148 | } 149 | 150 | -------------------------------------------------------------------------------- /winsgminer561/sia.cl: -------------------------------------------------------------------------------- 1 | 2 | #if __ENDIAN_LITTLE__ 3 | #define SPH_LITTLE_ENDIAN 1 4 | #else 5 | #define SPH_BIG_ENDIAN 1 6 | #endif 7 | 8 | #define SPH_UPTR sph_u64 9 | 10 | typedef unsigned int sph_u32; 11 | typedef int sph_s32; 12 | #ifndef __OPENCL_VERSION__ 13 | typedef unsigned long long sph_u64; 14 | typedef long long sph_s64; 15 | #else 16 | typedef unsigned long sph_u64; 17 | typedef long sph_s64; 18 | #endif 19 | 20 | #define SPH_64 1 21 | #define SPH_64_TRUE 1 22 | 23 | #define SWAP4(x) as_uint(as_uchar4(x).wzyx) 24 | #define SWAP8(x) as_ulong(as_uchar8(x).s76543210) 25 | 26 | #if SPH_BIG_ENDIAN 27 | #define DEC64E(x) (x) 28 | #define DEC64BE(x) (*(const __global sph_u64 *) (x)); 29 | #define DEC32LE(x) SWAP4(*(const __global sph_u32 *) (x)); 30 | #else 31 | #define DEC64E(x) SWAP8(x) 32 | #define DEC64BE(x) SWAP8(*(const __global sph_u64 *) (x)); 33 | #define DEC64LE(x) (*(const __global sph_u64 *) (x)); 34 | #define DEC32LE(x) (*(const __global sph_u32 *) (x)); 35 | #endif 36 | 37 | inline static uint2 ror64(const uint2 x, const uint y) 38 | { 39 | return (uint2)(((x).x>>y)^((x).y<<(32-y)),((x).y>>y)^((x).x<<(32-y))); 40 | } 41 | inline static uint2 ror64_2(const uint2 x, const uint y) 42 | { 43 | return (uint2)(((x).y>>(y-32))^((x).x<<(64-y)),((x).x>>(y-32))^((x).y<<(64-y))); 44 | } 45 | __constant static const uchar blake2b_sigma[12][16] = { 46 | { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } , 47 | { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } , 48 | { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 } , 49 | { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 } , 50 | { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 } , 51 | { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } , 52 | { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 } , 53 | { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 } , 54 | { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 } , 55 | { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0 } , 56 | { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } , 57 | { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } }; 58 | 59 | __kernel void search(__global unsigned char* block, volatile __global uint* output, const ulong target) { 60 | sph_u32 gid = get_global_id(0); 61 | 62 | ulong m[16]; 63 | m[0] = DEC64LE(block + 0); 64 | m[1] = DEC64LE(block + 8); 65 | m[2] = DEC64LE(block + 16); 66 | m[3] = DEC64LE(block + 24); 67 | m[4] = DEC64LE(block + 32); 68 | m[4] &= 0xFFFFFFFF00000000; 69 | m[4] ^= (gid); 70 | m[5] = DEC64LE(block + 40); 71 | m[6] = DEC64LE(block + 48); 72 | m[7] = DEC64LE(block + 56); 73 | m[8] = DEC64LE(block + 64); 74 | m[9] = DEC64LE(block + 72); 75 | m[10] = m[11] = m[12] = m[13] = m[14] = m[15] = 0; 76 | 77 | ulong v[16] = { 0x6a09e667f2bdc928, 0xbb67ae8584caa73b, 0x3c6ef372fe94f82b, 0xa54ff53a5f1d36f1, 78 | 0x510e527fade682d1, 0x9b05688c2b3e6c1f, 0x1f83d9abfb41bd6b, 0x5be0cd19137e2179, 79 | 0x6a09e667f3bcc908, 0xbb67ae8584caa73b, 0x3c6ef372fe94f82b, 0xa54ff53a5f1d36f1, 80 | 0x510e527fade68281, 0x9b05688c2b3e6c1f, 0xe07c265404be4294, 0x5be0cd19137e2179 }; 81 | 82 | #define G(r,i,a,b,c,d) \ 83 | a = a + b + m[ blake2b_sigma[r][2*i] ]; \ 84 | ((uint2*)&d)[0] = ((uint2*)&d)[0].yx ^ ((uint2*)&a)[0].yx; \ 85 | c = c + d; \ 86 | ((uint2*)&b)[0] = ror64( ((uint2*)&b)[0] ^ ((uint2*)&c)[0], 24U); \ 87 | a = a + b + m[ blake2b_sigma[r][2*i+1] ]; \ 88 | ((uint2*)&d)[0] = ror64( ((uint2*)&d)[0] ^ ((uint2*)&a)[0], 16U); \ 89 | c = c + d; \ 90 | ((uint2*)&b)[0] = ror64_2( ((uint2*)&b)[0] ^ ((uint2*)&c)[0], 63U); 91 | 92 | #define ROUND(r) \ 93 | G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \ 94 | G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \ 95 | G(r,2,v[ 2],v[ 6],v[10],v[14]); \ 96 | G(r,3,v[ 3],v[ 7],v[11],v[15]); \ 97 | G(r,4,v[ 0],v[ 5],v[10],v[15]); \ 98 | G(r,5,v[ 1],v[ 6],v[11],v[12]); \ 99 | G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \ 100 | G(r,7,v[ 3],v[ 4],v[ 9],v[14]); 101 | ROUND( 0 ); 102 | ROUND( 1 ); 103 | ROUND( 2 ); 104 | ROUND( 3 ); 105 | ROUND( 4 ); 106 | ROUND( 5 ); 107 | ROUND( 6 ); 108 | ROUND( 7 ); 109 | ROUND( 8 ); 110 | ROUND( 9 ); 111 | ROUND( 10 ); 112 | ROUND( 11 ); 113 | 114 | #undef G 115 | #undef ROUND 116 | 117 | bool result = (SWAP8(0x6a09e667f2bdc928 ^ v[0] ^ v[8]) <= target); 118 | if (result) 119 | output[output[0xFF]++] = SWAP4(gid); 120 | } 121 | -------------------------------------------------------------------------------- /winsgminer561/skein256.cl: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * skein256 kernel implementation. 4 | * 5 | * ==========================(LICENSE BEGIN)============================ 6 | * Copyright (c) 2014 djm34 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining 9 | * a copy of this software and associated documentation files (the 10 | * "Software"), to deal in the Software without restriction, including 11 | * without limitation the rights to use, copy, modify, merge, publish, 12 | * distribute, sublicense, and/or sell copies of the Software, and to 13 | * permit persons to whom the Software is furnished to do so, subject to 14 | * the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 22 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 23 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 25 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | * 27 | * ===========================(LICENSE END)============================= 28 | * 29 | * @author djm34 30 | */ 31 | 32 | 33 | __constant static const sph_u64 SKEIN_IV512[] = { 34 | SPH_C64(0x4903ADFF749C51CE), SPH_C64(0x0D95DE399746DF03), 35 | SPH_C64(0x8FD1934127C79BCE), SPH_C64(0x9A255629FF352CB1), 36 | SPH_C64(0x5DB62599DF6CA7B0), SPH_C64(0xEABE394CA9D5C3F4), 37 | SPH_C64(0x991112C71A75B523), SPH_C64(0xAE18A40B660FCC33) 38 | }; 39 | 40 | __constant static const sph_u64 SKEIN_IV512_256[8] = { 41 | 0xCCD044A12FDB3E13UL, 0xE83590301A79A9EBUL, 42 | 0x55AEA0614F816E6FUL, 0x2A2767A4AE9B94DBUL, 43 | 0xEC06025E74DD7683UL, 0xE7A436CDC4746251UL, 44 | 0xC36FBAF9393AD185UL, 0x3EEDBA1833EDFC13UL 45 | }; 46 | 47 | 48 | 49 | __constant static const int ROT256[8][4] = 50 | { 51 | 46, 36, 19, 37, 52 | 33, 27, 14, 42, 53 | 17, 49, 36, 39, 54 | 44, 9, 54, 56, 55 | 39, 30, 34, 24, 56 | 13, 50, 10, 17, 57 | 25, 29, 39, 43, 58 | 8, 35, 56, 22, 59 | }; 60 | 61 | __constant static const sph_u64 skein_ks_parity = 0x1BD11BDAA9FC1A22; 62 | 63 | __constant static const sph_u64 t12[6] = 64 | { 0x20UL, 65 | 0xf000000000000000UL, 66 | 0xf000000000000020UL, 67 | 0x08UL, 68 | 0xff00000000000000UL, 69 | 0xff00000000000008UL 70 | }; 71 | 72 | 73 | #define Round512(p0,p1,p2,p3,p4,p5,p6,p7,ROT) { \ 74 | p0 += p1; p1 = SPH_ROTL64(p1, ROT256[ROT][0]); p1 ^= p0; \ 75 | p2 += p3; p3 = SPH_ROTL64(p3, ROT256[ROT][1]); p3 ^= p2; \ 76 | p4 += p5; p5 = SPH_ROTL64(p5, ROT256[ROT][2]); p5 ^= p4; \ 77 | p6 += p7; p7 = SPH_ROTL64(p7, ROT256[ROT][3]); p7 ^= p6; \ 78 | } 79 | 80 | #define Round_8_512(p0, p1, p2, p3, p4, p5, p6, p7, R) { \ 81 | Round512(p0, p1, p2, p3, p4, p5, p6, p7, 0); \ 82 | Round512(p2, p1, p4, p7, p6, p5, p0, p3, 1); \ 83 | Round512(p4, p1, p6, p3, p0, p5, p2, p7, 2); \ 84 | Round512(p6, p1, p0, p7, p2, p5, p4, p3, 3); \ 85 | p0 += h[((R)+0) % 9]; \ 86 | p1 += h[((R)+1) % 9]; \ 87 | p2 += h[((R)+2) % 9]; \ 88 | p3 += h[((R)+3) % 9]; \ 89 | p4 += h[((R)+4) % 9]; \ 90 | p5 += h[((R)+5) % 9] + t[((R)+0) % 3]; \ 91 | p6 += h[((R)+6) % 9] + t[((R)+1) % 3]; \ 92 | p7 += h[((R)+7) % 9] + R; \ 93 | Round512(p0, p1, p2, p3, p4, p5, p6, p7, 4); \ 94 | Round512(p2, p1, p4, p7, p6, p5, p0, p3, 5); \ 95 | Round512(p4, p1, p6, p3, p0, p5, p2, p7, 6); \ 96 | Round512(p6, p1, p0, p7, p2, p5, p4, p3, 7); \ 97 | p0 += h[((R)+1) % 9]; \ 98 | p1 += h[((R)+2) % 9]; \ 99 | p2 += h[((R)+3) % 9]; \ 100 | p3 += h[((R)+4) % 9]; \ 101 | p4 += h[((R)+5) % 9]; \ 102 | p5 += h[((R)+6) % 9] + t[((R)+1) % 3]; \ 103 | p6 += h[((R)+7) % 9] + t[((R)+2) % 3]; \ 104 | p7 += h[((R)+8) % 9] + (R+1); \ 105 | } -------------------------------------------------------------------------------- /winsgminer561/whirlpoolx.cl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aohas/MinerPool/27477b304450b669087eafc2a8571cb1d6058d88/winsgminer561/whirlpoolx.cl -------------------------------------------------------------------------------- /winsgminer561/wolf-sha512.cl: -------------------------------------------------------------------------------- 1 | static const __constant ulong K512[80] = 2 | { 3 | 0x428A2F98D728AE22UL, 0x7137449123EF65CDUL, 4 | 0xB5C0FBCFEC4D3B2FUL, 0xE9B5DBA58189DBBCUL, 5 | 0x3956C25BF348B538UL, 0x59F111F1B605D019UL, 6 | 0x923F82A4AF194F9BUL, 0xAB1C5ED5DA6D8118UL, 7 | 0xD807AA98A3030242UL, 0x12835B0145706FBEUL, 8 | 0x243185BE4EE4B28CUL, 0x550C7DC3D5FFB4E2UL, 9 | 0x72BE5D74F27B896FUL, 0x80DEB1FE3B1696B1UL, 10 | 0x9BDC06A725C71235UL, 0xC19BF174CF692694UL, 11 | 0xE49B69C19EF14AD2UL, 0xEFBE4786384F25E3UL, 12 | 0x0FC19DC68B8CD5B5UL, 0x240CA1CC77AC9C65UL, 13 | 0x2DE92C6F592B0275UL, 0x4A7484AA6EA6E483UL, 14 | 0x5CB0A9DCBD41FBD4UL, 0x76F988DA831153B5UL, 15 | 0x983E5152EE66DFABUL, 0xA831C66D2DB43210UL, 16 | 0xB00327C898FB213FUL, 0xBF597FC7BEEF0EE4UL, 17 | 0xC6E00BF33DA88FC2UL, 0xD5A79147930AA725UL, 18 | 0x06CA6351E003826FUL, 0x142929670A0E6E70UL, 19 | 0x27B70A8546D22FFCUL, 0x2E1B21385C26C926UL, 20 | 0x4D2C6DFC5AC42AEDUL, 0x53380D139D95B3DFUL, 21 | 0x650A73548BAF63DEUL, 0x766A0ABB3C77B2A8UL, 22 | 0x81C2C92E47EDAEE6UL, 0x92722C851482353BUL, 23 | 0xA2BFE8A14CF10364UL, 0xA81A664BBC423001UL, 24 | 0xC24B8B70D0F89791UL, 0xC76C51A30654BE30UL, 25 | 0xD192E819D6EF5218UL, 0xD69906245565A910UL, 26 | 0xF40E35855771202AUL, 0x106AA07032BBD1B8UL, 27 | 0x19A4C116B8D2D0C8UL, 0x1E376C085141AB53UL, 28 | 0x2748774CDF8EEB99UL, 0x34B0BCB5E19B48A8UL, 29 | 0x391C0CB3C5C95A63UL, 0x4ED8AA4AE3418ACBUL, 30 | 0x5B9CCA4F7763E373UL, 0x682E6FF3D6B2B8A3UL, 31 | 0x748F82EE5DEFB2FCUL, 0x78A5636F43172F60UL, 32 | 0x84C87814A1F0AB72UL, 0x8CC702081A6439ECUL, 33 | 0x90BEFFFA23631E28UL, 0xA4506CEBDE82BDE9UL, 34 | 0xBEF9A3F7B2C67915UL, 0xC67178F2E372532BUL, 35 | 0xCA273ECEEA26619CUL, 0xD186B8C721C0C207UL, 36 | 0xEADA7DD6CDE0EB1EUL, 0xF57D4F7FEE6ED178UL, 37 | 0x06F067AA72176FBAUL, 0x0A637DC5A2C898A6UL, 38 | 0x113F9804BEF90DAEUL, 0x1B710B35131C471BUL, 39 | 0x28DB77F523047D84UL, 0x32CAAB7B40C72493UL, 40 | 0x3C9EBE0A15C9BEBCUL, 0x431D67C49C100D4CUL, 41 | 0x4CC5D4BECB3E42B6UL, 0x597F299CFC657E2AUL, 42 | 0x5FCB6FAB3AD6FAECUL, 0x6C44198C4A475817UL 43 | }; 44 | 45 | static const __constant ulong SHA512_INIT[8] = 46 | { 47 | 0x6A09E667F3BCC908UL, 0xBB67AE8584CAA73BUL, 48 | 0x3C6EF372FE94F82BUL, 0xA54FF53A5F1D36F1UL, 49 | 0x510E527FADE682D1UL, 0x9B05688C2B3E6C1FUL, 50 | 0x1F83D9ABFB41BD6BUL, 0x5BE0CD19137E2179UL 51 | }; 52 | 53 | #define ROTR64(x, y) rotate((x), 64UL - (y)) 54 | 55 | ulong FAST_ROTR64_LO(const uint2 x, const uint y) { return(as_ulong(amd_bitalign(x.s10, x, y))); } 56 | ulong FAST_ROTR64_HI(const uint2 x, const uint y) { return(as_ulong(amd_bitalign(x, x.s10, (y - 32)))); } 57 | 58 | /* 59 | #define BSG5_0(x) (FAST_ROTR64_LO(x, 28) ^ FAST_ROTR64_HI(x, 34) ^ FAST_ROTR64_HI(x, 39)) 60 | #define BSG5_1(x) (FAST_ROTR64_LO(x, 14) ^ FAST_ROTR64_LO(x, 18) ^ ROTR64(x, 41)) 61 | #define SSG5_0(x) (FAST_ROTR64_LO(x, 1) ^ FAST_ROTR64_LO(x, 8) ^ ((x) >> 7)) 62 | #define SSG5_1(x) (FAST_ROTR64_LO(x, 19) ^ FAST_ROTR64_HI(x, 61) ^ ((x) >> 6)) 63 | */ 64 | 65 | #define BSG5_0(x) (FAST_ROTR64_LO(as_uint2(x), 28) ^ FAST_ROTR64_HI(as_uint2(x), 34) ^ FAST_ROTR64_HI(as_uint2(x), 39)) 66 | #define BSG5_1(x) (FAST_ROTR64_LO(as_uint2(x), 14) ^ FAST_ROTR64_LO(as_uint2(x), 18) ^ FAST_ROTR64_HI(as_uint2(x), 41)) 67 | #define SSG5_0(x) (FAST_ROTR64_LO(as_uint2(x), 1) ^ FAST_ROTR64_LO(as_uint2(x), 8) ^ ((x) >> 7)) 68 | #define SSG5_1(x) (FAST_ROTR64_LO(as_uint2(x), 19) ^ FAST_ROTR64_HI(as_uint2(x), 61) ^ ((x) >> 6)) 69 | 70 | #define CH(X, Y, Z) bitselect(Z, Y, X) 71 | #define MAJ(X, Y, Z) CH((X ^ Z), Y, Z) 72 | 73 | void SHA2_512_STEP2(const ulong *W, uint ord, ulong *r, int i) 74 | { 75 | ulong T1; 76 | int x = 8 - ord; 77 | 78 | ulong a = r[x & 7], b = r[(x + 1) & 7], c = r[(x + 2) & 7], d = r[(x + 3) & 7]; 79 | ulong e = r[(x + 4) & 7], f = r[(x + 5) & 7], g = r[(x + 6) & 7], h = r[(x + 7) & 7]; 80 | 81 | T1 = h + BSG5_1(e) + CH(e, f, g) + W[i] + K512[i]; 82 | r[(3 + x) & 7] = d + T1; 83 | r[(7 + x) & 7] = T1 + BSG5_0(a) + MAJ(a, b, c); 84 | } 85 | 86 | void SHA512Block(ulong *data, ulong *buf) 87 | { 88 | ulong W[80], r[8]; 89 | 90 | for(int i = 0; i < 8; ++i) r[i] = buf[i]; 91 | 92 | for(int i = 0; i < 16; ++i) W[i] = data[i]; 93 | 94 | #pragma unroll 4 95 | for(int i = 16; i < 80; ++i) W[i] = SSG5_1(W[i - 2]) + W[i - 7] + SSG5_0(W[i - 15]) + W[i - 16]; 96 | 97 | #pragma unroll 1 98 | for(int i = 0; i < 80; i += 8) 99 | { 100 | #pragma unroll 101 | for(int j = 0; j < 8; ++j) 102 | { 103 | SHA2_512_STEP2(W, j, r, i + j); 104 | } 105 | } 106 | 107 | for(int i = 0; i < 8; ++i) buf[i] += r[i]; 108 | } 109 | -------------------------------------------------------------------------------- /winsgminer561/yescrypt.cl: -------------------------------------------------------------------------------- 1 | /* 2 | * "yescrypt" kernel implementation. 3 | * 4 | * ==========================(LICENSE BEGIN)============================ 5 | * 6 | * Copyright (c) 2015 djm34 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining 9 | * a copy of this software and associated documentation files (the 10 | * "Software"), to deal in the Software without restriction, including 11 | * without limitation the rights to use, copy, modify, merge, publish, 12 | * distribute, sublicense, and/or sell copies of the Software, and to 13 | * permit persons to whom the Software is furnished to do so, subject to 14 | * the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 22 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 23 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 25 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | * 27 | * ===========================(LICENSE END)============================= 28 | * 29 | * @author djm34 30 | */ 31 | #if !defined(cl_khr_byte_addressable_store) 32 | #error "Device does not support unaligned stores" 33 | #endif 34 | 35 | #include "yescrypt_essential.cl" 36 | 37 | 38 | __attribute__((reqd_work_group_size(WORKSIZE, 1, 1))) 39 | __kernel void search(__global const uchar* restrict input, __global uint* restrict output, __global uchar *padcache, __global uchar* buff1, __global uchar* buff2, const uint target) 40 | { 41 | 42 | __global ulong16 *hashbuffer = (__global ulong16 *)(padcache + (2048 * 128 * sizeof(ulong)* (get_global_id(0) % MAX_GLOBAL_THREADS))); 43 | __global ulong16 *prevstate = (__global ulong16 *)(buff1 + (64 * 128 * sizeof(ulong)*(get_global_id(0) % MAX_GLOBAL_THREADS))); 44 | __global ulong16 *Bdev = (__global ulong16 *)(buff2 + (8 * 128 * sizeof(ulong)* (get_global_id(0) % MAX_GLOBAL_THREADS))); 45 | 46 | 47 | 48 | uint nonce = (get_global_id(0)); 49 | uint data[20]; 50 | uint16 in; 51 | uint8 state1, state2; 52 | uint8 sha256tokeep; 53 | 54 | ((uint16 *)data)[0] = ((__global const uint16 *)input)[0]; 55 | ((uint4 *)data)[4] = ((__global const uint4 *)input)[4]; 56 | for (int i = 0; i<20; i++) { data[i] = SWAP32(data[i]); } 57 | // if (nonce == 10) { printf("data %08x %08x\n", data[0], data[1]); } 58 | uint8 passwd = sha256_80(data, nonce); 59 | //pbkdf 60 | in.lo = pad1.lo ^ passwd; 61 | in.hi = pad1.hi; 62 | state1 = sha256_Transform(in, H256); 63 | 64 | in.lo = pad2.lo ^ passwd; 65 | in.hi = pad2.hi; 66 | state2 = sha256_Transform(in, H256); 67 | 68 | in = ((uint16*)data)[0]; 69 | state1 = sha256_Transform(in, state1); 70 | #pragma unroll 1 71 | for (int i = 0; i<8; i++) 72 | { 73 | uint16 result; 74 | in = pad3; 75 | in.s0 = data[16]; 76 | in.s1 = data[17]; 77 | in.s2 = data[18]; 78 | in.s3 = nonce; 79 | in.s4 = 4 * i + 1; 80 | in.lo = sha256_Transform(in, state1); 81 | in.hi = pad4; 82 | result.lo = swapvec(sha256_Transform(in, state2)); 83 | if (i == 0) sha256tokeep = result.lo; 84 | in = pad3; 85 | in.s0 = data[16]; 86 | in.s1 = data[17]; 87 | in.s2 = data[18]; 88 | in.s3 = nonce; 89 | in.s4 = 4 * i + 2; 90 | in.lo = sha256_Transform(in, state1); 91 | in.hi = pad4; 92 | result.hi = swapvec(sha256_Transform(in, state2)); 93 | Bdev[i].lo = as_ulong8(shuffle(result)); 94 | in = pad3; 95 | in.s0 = data[16]; 96 | in.s1 = data[17]; 97 | in.s2 = data[18]; 98 | in.s3 = nonce; 99 | in.s4 = 4 * i + 3; 100 | in.lo = sha256_Transform(in, state1); 101 | in.hi = pad4; 102 | result.lo = swapvec(sha256_Transform(in, state2)); 103 | in = pad3; 104 | in.s0 = data[16]; 105 | in.s1 = data[17]; 106 | in.s2 = data[18]; 107 | in.s3 = nonce; 108 | in.s4 = 4 * i + 4; 109 | in.lo = sha256_Transform(in, state1); 110 | in.hi = pad4; 111 | result.hi = swapvec(sha256_Transform(in, state2)); 112 | 113 | 114 | Bdev[i].hi = as_ulong8(shuffle(result)); 115 | } 116 | 117 | //mixing1 118 | 119 | prevstate[0] = Bdev[0]; 120 | Bdev[0] = blockmix_salsa8_small2(Bdev[0]); 121 | prevstate[1] = Bdev[0]; 122 | Bdev[0] = blockmix_salsa8_small2(Bdev[0]); 123 | 124 | uint n = 1; 125 | #pragma unroll 1 126 | for (uint i = 2; i < 64; i++) 127 | { 128 | 129 | prevstate[i] = Bdev[0]; 130 | 131 | if ((i&(i - 1)) == 0) n = n << 1; 132 | 133 | uint j = as_uint2(Bdev[0].hi.s0).x & (n - 1); 134 | 135 | j += i - n; 136 | Bdev[0] ^= prevstate[j]; 137 | 138 | Bdev[0] = blockmix_salsa8_small2(Bdev[0]); 139 | } 140 | 141 | 142 | for (int i = 0; i<8; i++) 143 | hashbuffer[i] = Bdev[i]; 144 | 145 | blockmix_pwxform((__global ulong8*)Bdev, prevstate); 146 | 147 | 148 | for (int i = 0; i<8; i++) 149 | hashbuffer[i + 8] = Bdev[i]; 150 | 151 | blockmix_pwxform((__global ulong8*)Bdev, prevstate); 152 | n = 1; 153 | #pragma unroll 1 154 | for (int i = 2; i < 2048; i++) 155 | { 156 | 157 | for (int k = 0; k<8; k++) 158 | (hashbuffer + 8 * i)[k] = Bdev[k]; 159 | 160 | 161 | if ((i&(i - 1)) == 0) n = n << 1; 162 | 163 | uint j = as_uint2(Bdev[7].hi.s0).x & (n - 1); 164 | j += i - n; 165 | 166 | for (int k = 0; k < 8; k++) 167 | Bdev[k] ^= (hashbuffer + 8 * j)[k]; 168 | 169 | 170 | blockmix_pwxform((__global ulong8*)Bdev, prevstate); 171 | } 172 | 173 | 174 | #pragma unroll 1 175 | for (int z = 0; z < 684; z++) 176 | { 177 | 178 | uint j = as_uint2(Bdev[7].hi.s0).x & 2047; 179 | 180 | 181 | for (int k = 0; k < 8; k++) 182 | Bdev[k] ^= (hashbuffer + 8 * j)[k]; 183 | 184 | if (z<682) 185 | for (int k = 0; k<8; k++) 186 | (hashbuffer + 8 * j)[k] = Bdev[k]; 187 | 188 | blockmix_pwxform((__global ulong8*)Bdev, prevstate); 189 | //// 190 | } 191 | 192 | 193 | 194 | uint8 swpass = swapvec(sha256tokeep); 195 | // uint16 in; 196 | // uint8 state1, state2; 197 | in.lo = pad1.lo ^ swpass; 198 | in.hi = pad1.hi; 199 | 200 | 201 | state1 = sha256_Transform(in, H256); 202 | 203 | in.lo = pad2.lo ^ swpass; 204 | in.hi = pad2.hi; 205 | state2 = sha256_Transform(in, H256); 206 | 207 | #pragma unroll 1 208 | for (int i = 0; i<8; i++) { 209 | in = unshuffle(Bdev[i].lo); 210 | in = swapvec16(in); 211 | state1 = sha256_Transform(in, state1); 212 | in = unshuffle(Bdev[i].hi); 213 | in = swapvec16(in); 214 | state1 = sha256_Transform(in, state1); 215 | } 216 | in = pad5; 217 | state1 = sha256_Transform(in, state1); 218 | in.lo = state1; 219 | in.hi = pad4; 220 | uint8 res = sha256_Transform(in, state2); 221 | 222 | //hmac and final sha 223 | 224 | in.lo = pad1.lo ^ res; 225 | in.hi = pad1.hi; 226 | state1 = sha256_Transform(in, H256); 227 | in.lo = pad2.lo ^ res; 228 | in.hi = pad2.hi; 229 | state2 = sha256_Transform(in, H256); 230 | in = ((uint16*)data)[0]; 231 | state1 = sha256_Transform(in, state1); 232 | in = padsha80; 233 | in.s0 = data[16]; 234 | in.s1 = data[17]; 235 | in.s2 = data[18]; 236 | in.s3 = get_global_id(0); 237 | in.sf = 0x480; 238 | state1 = sha256_Transform(in, state1); 239 | in.lo = state1; 240 | in.hi = pad4; 241 | state1 = sha256_Transform(in, state2); 242 | // state2 = H256; 243 | in.lo = state1; 244 | in.hi = pad4; 245 | in.sf = 0x100; 246 | res = sha256_Transform(in, H256); 247 | 248 | 249 | if (SWAP32(res.s7) <= (target)) 250 | output[atomic_inc(output + 0xFF)] = (nonce); 251 | 252 | } 253 | 254 | -------------------------------------------------------------------------------- /x11_sgminer_linux.cmd: -------------------------------------------------------------------------------- 1 | cd linuxsgminer561 2 | ./sgminer --kernel darkcoin-mod -o stratum+tcp://stratum.aikapool.com:7954 -u aohas.aohas5 -p 888888 3 | -------------------------------------------------------------------------------- /x11_sgminer_win.cmd: -------------------------------------------------------------------------------- 1 | cd winsgminer561 2 | sgminer --kernel darkcoin-mod -o stratum+tcp://stratum.aikapool.com:7917 -u aohas.aohas5 -p 888888 3 | --------------------------------------------------------------------------------