Skip to content

Commit

Permalink
polytimos algo
Browse files Browse the repository at this point in the history
  • Loading branch information
tpruvot committed Nov 16, 2017
1 parent a1d3ecd commit bfd6148
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stratum/algos/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ SOURCES=lyra2re.c lyra2v2.c Lyra2.c lyra2z.c Lyra2z.c Sponge.c \
m7m.c magimath.cpp velvet.c \
argon2a.c ar2/blake2b.c ar2/argon2.c ar2/ref.c ar2/cores.c ar2/ar2-scrypt-jane.c \
hive.c pomelo.c \
phi.c skunk.c sib.c veltor.c gost.c x11evo.c
phi.c polytimos.c skunk.c sib.c veltor.c gost.c x11evo.c

OBJECTS=$(SOURCES:%.c=%.o) $(SOURCES:%.cpp=%.o)
OUTPUT=libalgos.a
Expand Down
52 changes: 52 additions & 0 deletions stratum/algos/polytimos.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <stdio.h>

#include <sha3/sph_skein.h>
#include <sha3/sph_shabal.h>
#include <sha3/sph_echo.h>
#include <sha3/sph_luffa.h>
#include <sha3/sph_fugue.h>
#include "gost.h"

#include "common.h"

void polytimos_hash(const char *input, char* output, uint32_t len)
{
uint32_t _ALIGN(64) hash[16];

sph_skein512_context ctx_skein;
sph_shabal512_context ctx_shabal;
sph_echo512_context ctx_echo;
sph_luffa512_context ctx_luffa;
sph_fugue512_context ctx_fugue;
sph_gost512_context ctx_gost;

sph_skein512_init(&ctx_skein);
sph_skein512(&ctx_skein, input, 80);
sph_skein512_close(&ctx_skein, (void*) hash);

sph_shabal512_init(&ctx_shabal);
sph_shabal512(&ctx_shabal, hash, 64);
sph_shabal512_close(&ctx_shabal, hash);

sph_echo512_init(&ctx_echo);
sph_echo512(&ctx_echo, hash, 64);
sph_echo512_close(&ctx_echo, hash);

sph_luffa512_init(&ctx_luffa);
sph_luffa512(&ctx_luffa, hash, 64);
sph_luffa512_close(&ctx_luffa, hash);

sph_fugue512_init(&ctx_fugue);
sph_fugue512(&ctx_fugue, hash, 64);
sph_fugue512_close(&ctx_fugue, hash);

sph_gost512_init(&ctx_gost);
sph_gost512(&ctx_gost, (const void*) hash, 64);
sph_gost512_close(&ctx_gost, (void*) hash);

memcpy(output, hash, 32);
}

16 changes: 16 additions & 0 deletions stratum/algos/polytimos.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifndef POLYTIMOS_H
#define POLYTIMOS_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>

void polytimos_hash(const char* input, char* output, uint32_t len);

#ifdef __cplusplus
}
#endif

#endif
16 changes: 16 additions & 0 deletions stratum/config.sample/polytimos.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[TCP]
server = yaamp.com
port = 8463
password = tu8tu5

[SQL]
host = yaampdb
database = yaamp
username = root
password = patofpaq

[STRATUM]
algo = polytimos
difficulty = 0.125
max_ttf = 40000

1 change: 1 addition & 0 deletions stratum/stratum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ YAAMP_ALGO g_algos[] =
{"tribus", tribus_hash, 1, 0, 0},
{"keccak", keccak256_hash, 0x80, 0, sha256_hash_hex },
{"phi", phi_hash, 1, 0, 0},
{"polytimos", polytimos_hash, 1, 0, 0},
{"skunk", skunk_hash, 1, 0, 0},

{"bmw", bmw_hash, 1, 0, 0},
Expand Down
1 change: 1 addition & 0 deletions stratum/stratum.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ void sha256_double_hash_hex(const char *input, char *output, unsigned int len);
#include "algos/sib.h"
#include "algos/m7m.h"
#include "algos/phi.h"
#include "algos/polytimos.h"
#include "algos/tribus.h"
#include "algos/veltor.h"
#include "algos/velvet.h"
Expand Down
2 changes: 2 additions & 0 deletions web/yaamp/core/functions/yaamp.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ function getAlgoColors($algo)
'lyra2v2' => '#80c0f0',
'lyra2z' => '#80b0f0',
'phi' => '#a0a0e0',
'polytimos' => '#dedefe',
'sib' => '#a0a0c0',
'skein' => '#80a0a0',
'skein2' => '#c8a060',
Expand Down Expand Up @@ -230,6 +231,7 @@ function getAlgoPort($algo)
'bastion' => 6433,
'hsr' => 7433,
'phi' => 8333,
'polytimos' => 8463,
'skunk' => 8433,
'tribus' => 8533,
);
Expand Down

0 comments on commit bfd6148

Please sign in to comment.