This commit is contained in:
Thorben 2019-02-28 11:25:16 +01:00
parent ff732c5678
commit c45cbd968b
8 changed files with 28 additions and 23 deletions

View File

@ -1,6 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
</head>
<body>
<!--A TEXT FIELD-->
@ -24,7 +28,6 @@
/* start mining, use a local server */
server = "ws://localhost:8181";
startMining("moneroocean.stream",
"422QQNhnhX8hmMEkF3TWePWSvKm6DiV7sS3Za2dXrynsJ1w8U6AzwjEdnewdhmP3CDaqvaS6BjEjGMK9mnumtufvLmz5HJi");

View File

@ -241,6 +241,7 @@ function informWorker(wrk) {
}
function on_servermsg(e) {
console.log(e.data);
var obj = JSON.parse(e.data);
receiveStack.push(obj);

View File

@ -135,11 +135,6 @@
// -------------------------------------- VARIANT 4 ---------------------------------------------
struct V4_Instruction code[NUM_INSTRUCTIONS_MAX + 1];
int lastHeight = -1;
v4_reg r[9];
#define V4_REG_LOAD(dst, src) \
do \
{ \
@ -148,16 +143,14 @@ v4_reg r[9];
} while (0)
#define VARIANT4_RANDOM_MATH_INIT() \
struct V4_Instruction code[NUM_INSTRUCTIONS_MAX + 1]; \
v4_reg r[9]; \
do \
if (variant >= 4) \
{ \
for (int i = 0; i < 4; ++i) \
V4_REG_LOAD(r + i, (uint8_t *)(state.hs.w + 12) + sizeof(v4_reg) * i); \
if (lastHeight != height) \
{ \
v4_random_math_init(code, height); \
lastHeight = height; \
} \
v4_random_math_init(code, height); \
} \
while (0)
@ -500,10 +493,10 @@ void SubAndShiftAndMixAddRoundInPlace(uint32_t *temp, uint32_t *AesEncKey)
temp[3] = TestTable2[saved[3]] ^ TestTable3[saved[4]] ^ TestTable4[saved[5]] ^ TestTable1[state[12]] ^ AesEncKey[3];
}
uint8_t text[INIT_SIZE_BYTE];
void cryptonight_hash_ctx(void *output, const void *input, size_t len, int algo, int variant, int height)
{
uint8_t text[INIT_SIZE_BYTE];
uint8_t *long_state;
oaes_ctx *aes_ctx;

View File

@ -1,10 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
</head>
<body>
<p id="demo"></p>
<script src="cn.js"></script>
<button onclick="profile()">Click me</button>
@ -30,7 +32,6 @@ function checkvariants() {
blob = "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111113";
alert(cn(blob,1,1,0)); // c2e3bd88bffd1bd7855af2dae2a52fef6efd36f00db514a6594718c5b67fab21
blob = "6465206f6d6e69627573206475626974616e64756d";
alert(cn(blob,0,0,0)); // 2f8e3df40bd11f9ac90c743ca8e32bb391da4fb98612aa3b6cdc639ee00b31f5

View File

@ -49,6 +49,11 @@ namespace Server
{ "cn/half", new Tuple<string, int>("cn-half", 2) }
};
public static bool ValidAlgorithm(string algo)
{
return lookup.ContainsKey(algo);
}
public static bool NormalizeAlgorithmAndVariant(JsonData job)
{
int possibleHeight = 0;

View File

@ -66,7 +66,6 @@ namespace Server
foreach (string pool in data.Keys)
{
JsonData jinfo = data[pool] as JsonData;
PoolInfo pi = new PoolInfo();
@ -76,10 +75,14 @@ namespace Server
pi.Url = jinfo["url"].GetString();
pi.EmptyPassword = jinfo["emptypassword"].GetString();
pi.DefaultAlgorithm = jinfo["algorithm"].GetString();
pi.Port = int.Parse(jinfo["port"].GetString());
pl.pools.Add(pool, pi);
if (!AlgorithmHelper.ValidAlgorithm(pi.DefaultAlgorithm))
throw new Exception("Invalid algorithm found in pools.json: " + pi.DefaultAlgorithm );
pl.pools.Add(pool, pi);
}

View File

@ -37,7 +37,6 @@ namespace Server
public class Client
{
public PoolConnection PoolConnection;
public IWebSocketConnection WebSocket;
public string Pool = string.Empty;
@ -536,7 +535,7 @@ namespace Server
{
string testStr = new string('1', 151) + '3';
IntPtr ptr = hash_cn(testStr, 1, 0,0);
IntPtr ptr = hash_cn(testStr,1, 0,0);
string str = Marshal.PtrToStringAnsi(ptr);
hash_free(ptr);

View File

@ -31,7 +31,7 @@
"aeonpool.xyz" : { "url" : "mine.aeonpool.xyz", "port" : 3333, "emptypassword" : "", "algorithm" : "cn-lite/1" },
"aeonpool.dreamitsystems.com" : { "url" : "aeonpool.dreamitsystems.com", "port" : 13333, "emptypassword" : "x", "algorithm" : "cn-lite/1" },
"aeonminingpool.com" : { "url" : "pool.aeonminingpool.com", "port" : 3333, "emptypassword" : "x", "algorithm" : "cn-lite/1" },
"aeonhash.com" : { "url" : "pool.aeonhash.com", "port" : 3333, "emptypassword" : "", "algorithm" : "cn-lite" },
"aeonhash.com" : { "url" : "pool.aeonhash.com", "port" : 3333, "emptypassword" : "", "algorithm" : "cn-lite/1" },
"durinsmine.com" : { "url" : "mine.durinsmine.com", "port" : 3333, "emptypassword" : "x", "algorithm" : "cn-lite/1" },
"aeon.uax.io" : { "url" : "mine.uax.io", "port" : 4446, "emptypassword" : "", "algorithm" : "cn-lite/1" },
"aeon-pool.sytes.net" : { "url" : "aeon-pool.sytes.net", "port" : 3333, "emptypassword" : "", "algorithm" : "cn-lite/1" },
@ -40,9 +40,9 @@
"pooltupi.com" : { "url" : "pooltupi.com", "port" : 8080, "emptypassword" : "x", "algorithm" : "cn-lite/1" },
"aeon.semipool.com" : { "url" : "pool.aeon.semipool.com", "port" : 3333, "emptypassword" : "x", "algorithm" : "cn-lite/1" },
"turtlepool.space" : { "url" : "eu.turtlepool.space", "port" : 3333, "emptypassword" : "", "algorithm" : "cn-pico" },
"turtlepool.space" : { "url" : "eu.turtlepool.space", "port" : 3333, "emptypassword" : "", "algorithm" : "cn-pico/trtl" },
"masari.miner.rocks" : { "url" : "masari.miner.rocks", "port" : 5005, "emptypassword" : "", "algorithm" : "cn-half/half" },
"masari.miner.rocks" : { "url" : "masari.miner.rocks", "port" : 5005, "emptypassword" : "", "algorithm" : "cn/half" },
"etn.spacepools.org" : { "url" : "pool.etn.spacepools.org", "port" : 80, "emptypassword" : "", "algorithm" : "cn/0"},
"etn.nanopool.org" : { "url" : "etn-eu1.nanopool.org", "port" : 13333, "emptypassword" : "x", "algorithm" : "cn/0" },