diff --git a/rc.local b/rc.local index d23346f..e635776 100644 --- a/rc.local +++ b/rc.local @@ -15,6 +15,7 @@ screen -dmS main /var/web/main.sh screen -dmS loop2 /var/web/loop2.sh screen -dmS blocks /var/web/blocks.sh +screen -dmS bmw /var/stratum/run.sh bmw screen -dmS c11 /var/stratum/run.sh c11 screen -dmS x11 /var/stratum/run.sh x11 screen -dmS x13 /var/stratum/run.sh x13 diff --git a/stratum/algos/bmw.c b/stratum/algos/bmw.c new file mode 100644 index 0000000..9ffd3d5 --- /dev/null +++ b/stratum/algos/bmw.c @@ -0,0 +1,21 @@ +#include +#include +#include +#include + +#include "bmw.h" + +#include "../sha3/sph_bmw.h" + +void bmw_hash(const char* input, char* output, uint32_t len) +{ + uint32_t hash[32]; + sph_bmw256_context ctx_bmw; + + sph_bmw256_init(&ctx_bmw); + sph_bmw256 (&ctx_bmw, input, 80); + sph_bmw256_close(&ctx_bmw, hash); + + memcpy(output, hash, 32); +} + diff --git a/stratum/algos/bmw.h b/stratum/algos/bmw.h new file mode 100644 index 0000000..59687e3 --- /dev/null +++ b/stratum/algos/bmw.h @@ -0,0 +1,16 @@ +#ifndef BMW_H +#define BMW_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +void bmw_hash(const char* input, char* output, uint32_t len); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/stratum/algos/makefile b/stratum/algos/makefile index dd84444..98ccf0a 100644 --- a/stratum/algos/makefile +++ b/stratum/algos/makefile @@ -9,7 +9,7 @@ LDFLAGS=-O2 SOURCES=Lyra2RE.c Lyra2.c Sponge.c blake.c scrypt.c c11.c x11.c x13.c sha256.c keccak.c \ x14.c x15.c nist5.c fresh.c quark.c neoscrypt.c scryptn.c qubit.c skein.c groestl.c \ - skein2.c zr5.c drop.c + skein2.c zr5.c drop.c bmw.c OBJECTS=$(SOURCES:.c=.o) OUTPUT=libalgos.a diff --git a/stratum/stratum.cpp b/stratum/stratum.cpp index 1936c03..14582dd 100644 --- a/stratum/stratum.cpp +++ b/stratum/stratum.cpp @@ -107,6 +107,7 @@ YAAMP_ALGO g_algos[] = {"skein", skein_hash, 1, 0, 0}, {"keccak", keccak_hash, 1, 0, 0}, + {"bmw", bmw_hash, 1, 0, 0}, {"skein2", skein2_hash, 1, 0, 0}, {"zr5", zr5_hash, 1, 0, 0}, {"drop", drop_hash, 0x10000, 0x10000, 0}, diff --git a/stratum/stratum.h b/stratum/stratum.h index c594ff7..053b363 100644 --- a/stratum/stratum.h +++ b/stratum/stratum.h @@ -137,6 +137,7 @@ void sha256_double_hash_hex(const char *input, char *output, unsigned int len); #include "algos/skein.h" #include "algos/keccak.h" +#include "algos/bmw.h" //#include "algos/whirlpoolx.h" #include "algos/skein2.h" #include "algos/zr5.h" diff --git a/web/yaamp/core/functions/yaamp.php b/web/yaamp/core/functions/yaamp.php index d6aaa45..103d265 100755 --- a/web/yaamp/core/functions/yaamp.php +++ b/web/yaamp/core/functions/yaamp.php @@ -18,6 +18,7 @@ function yaamp_get_algos() 'groestl', // dmd-gr -m 256 'skein', 'skein2', + 'bmw', 'drop', 'zr5', ); @@ -48,6 +49,7 @@ function yaamp_get_algo_norm($algo) 'skein2' => 300, 'zr5' => 5.5, 'drop' => 1.5, + 'bmw' => 100, ); if(!isset($a[$algo])) @@ -76,6 +78,7 @@ function getAlgoColors($algo) 'skein2' => '#a0a0a0', 'zr5' => '#d0b0d0', 'drop' => '#d0b0d0', + 'bmw' => '#a0a0a0', ); if(!isset($a[$algo])) @@ -110,6 +113,7 @@ function getAlgoPort($algo) 'skein2' => 5233, 'groestl' => 5333, 'zr5' => 5533, + 'bmw' => 5633, ); if(!isset($a[$algo])) @@ -148,8 +152,9 @@ function yaamp_fee($algo) $fee = 25.0; // i don't like this one :p break; case 'zr5': - $fee = 5.0; + $fee = 15.0; break; +// case 'bmw': case 'drop': $fee *= 2.0; break;