Features of 1.6.5 (#140)
* Hashrate improve -> add autodetection mode for cpu-affinity * Hashrate improve, more stable hashrates -> refactor memory allocation * Add TubeV4 support (cn-heavy + ipbc mod + soft-aes mod) * Update ccp-httpd lib to fix stop/freeze of cc communication on some miners * Fix cn-heavy on arm processors
This commit is contained in:
parent
7897f8f645
commit
90699d58ec
38 changed files with 5525 additions and 3114 deletions
|
@ -26,10 +26,10 @@ const static char input2[] = "This is a test";
|
|||
const static char input3[] = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus pellentesque metus.";
|
||||
|
||||
|
||||
void cryptonight_av1_aesni(const void* input, size_t size, void* output, struct cryptonight_ctx* ctx);
|
||||
void cryptonight_av2_aesni_double(const void* input, size_t size, void* output, struct cryptonight_ctx* ctx);
|
||||
void cryptonight_av3_softaes(const void* input, size_t size, void* output, struct cryptonight_ctx* ctx);
|
||||
void cryptonight_av4_softaes_double(const void* input, size_t size, void* output, struct cryptonight_ctx* ctx);
|
||||
void cryptonight_av1_aesni(const void* input, size_t size, void* output, struct ScratchPad* ctx);
|
||||
void cryptonight_av2_aesni_double(const void* input, size_t size, void* output, struct ScratchPad* ctx);
|
||||
void cryptonight_av3_softaes(const void* input, size_t size, void* output, struct ScratchPad* ctx);
|
||||
void cryptonight_av4_softaes_double(const void* input, size_t size, void* output, struct ScratchPad* ctx);
|
||||
|
||||
|
||||
static char hash[64];
|
||||
|
@ -55,21 +55,21 @@ static char *bin2hex(const unsigned char *p, size_t len)
|
|||
|
||||
|
||||
static void * create_ctx(int ratio) {
|
||||
struct cryptonight_ctx *ctx = (struct cryptonight_ctx*) _mm_malloc(sizeof(struct cryptonight_ctx), 16);
|
||||
struct ScratchPad *ctx = (struct ScratchPad*) _mm_malloc(sizeof(struct ScratchPad), 16);
|
||||
ctx->memory = (uint8_t *) _mm_malloc(MEMORY * ratio, 16);
|
||||
|
||||
return ctx;
|
||||
}
|
||||
|
||||
|
||||
static void free_ctx(struct cryptonight_ctx *ctx) {
|
||||
static void free_ctx(struct ScratchPad *ctx) {
|
||||
_mm_free(ctx->memory);
|
||||
_mm_free(ctx);
|
||||
}
|
||||
|
||||
|
||||
void test_cryptonight_av1_should_CalcHash(void) {
|
||||
struct cryptonight_ctx *ctx = (struct cryptonight_ctx*) create_ctx(1);
|
||||
struct ScratchPad *ctx = (struct ScratchPad*) create_ctx(1);
|
||||
|
||||
cryptonight_av1_aesni(input1, 76, &hash, ctx);
|
||||
TEST_ASSERT_EQUAL_STRING(RESULT1, bin2hex(hash, 32));
|
||||
|
@ -86,7 +86,7 @@ void test_cryptonight_av1_should_CalcHash(void) {
|
|||
|
||||
void test_cryptonight_av2_should_CalcHash(void)
|
||||
{
|
||||
struct cryptonight_ctx *ctx = (struct cryptonight_ctx*) create_ctx(2);
|
||||
struct ScratchPad *ctx = (struct ScratchPad*) create_ctx(2);
|
||||
|
||||
cryptonight_av2_aesni_double(input1, 76, &hash, ctx);
|
||||
TEST_ASSERT_EQUAL_STRING(RESULT1_DOUBLE, bin2hex(hash, 64));
|
||||
|
@ -97,7 +97,7 @@ void test_cryptonight_av2_should_CalcHash(void)
|
|||
|
||||
void test_cryptonight_av3_should_CalcHash(void)
|
||||
{
|
||||
struct cryptonight_ctx *ctx = (struct cryptonight_ctx*) create_ctx(1);
|
||||
struct ScratchPad *ctx = (struct ScratchPad*) create_ctx(1);
|
||||
|
||||
cryptonight_av3_softaes(input1, 76, &hash, ctx);
|
||||
TEST_ASSERT_EQUAL_STRING(RESULT1, bin2hex(hash, 32));
|
||||
|
@ -114,7 +114,7 @@ void test_cryptonight_av3_should_CalcHash(void)
|
|||
|
||||
void test_cryptonight_av4_should_CalcHash(void)
|
||||
{
|
||||
struct cryptonight_ctx *ctx = (struct cryptonight_ctx*) create_ctx(2);
|
||||
struct ScratchPad *ctx = (struct ScratchPad*) create_ctx(2);
|
||||
|
||||
cryptonight_av4_softaes_double(input1, 76, &hash, ctx);
|
||||
TEST_ASSERT_EQUAL_STRING(RESULT1_DOUBLE, bin2hex(hash, 64));
|
||||
|
|
|
@ -24,15 +24,15 @@ const static char input1[152] = {
|
|||
};
|
||||
|
||||
|
||||
void cryptonight_av1_aesni(const void* input, size_t size, void* output, struct cryptonight_ctx* ctx) {}
|
||||
void cryptonight_av2_aesni_double(const void* input, size_t size, void* output, struct cryptonight_ctx* ctx) {}
|
||||
void cryptonight_av3_softaes(const void* input, size_t size, void* output, struct cryptonight_ctx* ctx) {}
|
||||
void cryptonight_av4_softaes_double(const void* input, size_t size, void* output, struct cryptonight_ctx* ctx) {}
|
||||
void cryptonight_av1_aesni(const void* input, size_t size, void* output, struct ScratchPad* ctx) {}
|
||||
void cryptonight_av2_aesni_double(const void* input, size_t size, void* output, struct ScratchPad* ctx) {}
|
||||
void cryptonight_av3_softaes(const void* input, size_t size, void* output, struct ScratchPad* ctx) {}
|
||||
void cryptonight_av4_softaes_double(const void* input, size_t size, void* output, struct ScratchPad* ctx) {}
|
||||
|
||||
void cryptonight_lite_av1_aesni(const void* input, size_t size, void* output, struct cryptonight_ctx* ctx);
|
||||
void cryptonight_lite_av2_aesni_double(const void* input, size_t size, void* output, struct cryptonight_ctx* ctx);
|
||||
void cryptonight_lite_av3_softaes(const void* input, size_t size, void* output, struct cryptonight_ctx* ctx);
|
||||
void cryptonight_lite_av4_softaes_double(const void* input, size_t size, void* output, struct cryptonight_ctx* ctx);
|
||||
void cryptonight_lite_av1_aesni(const void* input, size_t size, void* output, struct ScratchPad* ctx);
|
||||
void cryptonight_lite_av2_aesni_double(const void* input, size_t size, void* output, struct ScratchPad* ctx);
|
||||
void cryptonight_lite_av3_softaes(const void* input, size_t size, void* output, struct ScratchPad* ctx);
|
||||
void cryptonight_lite_av4_softaes_double(const void* input, size_t size, void* output, struct ScratchPad* ctx);
|
||||
|
||||
|
||||
static char hash[64];
|
||||
|
@ -56,21 +56,21 @@ static char *bin2hex(const unsigned char *p, size_t len)
|
|||
|
||||
|
||||
static void * create_ctx(int ratio) {
|
||||
struct cryptonight_ctx *ctx = (struct cryptonight_ctx*) _mm_malloc(sizeof(struct cryptonight_ctx), 16);
|
||||
struct ScratchPad *ctx = (struct ScratchPad*) _mm_malloc(sizeof(struct ScratchPad), 16);
|
||||
ctx->memory = (uint8_t *) _mm_malloc(MEMORY_LITE * ratio, 16);
|
||||
|
||||
return ctx;
|
||||
}
|
||||
|
||||
|
||||
static void free_ctx(struct cryptonight_ctx *ctx) {
|
||||
static void free_ctx(struct ScratchPad *ctx) {
|
||||
_mm_free(ctx->memory);
|
||||
_mm_free(ctx);
|
||||
}
|
||||
|
||||
|
||||
void test_cryptonight_lite_av1_should_CalcHash(void) {
|
||||
struct cryptonight_ctx *ctx = (struct cryptonight_ctx*) create_ctx(1);
|
||||
struct ScratchPad *ctx = (struct ScratchPad*) create_ctx(1);
|
||||
|
||||
cryptonight_lite_av1_aesni(input1, 76, &hash, ctx);
|
||||
TEST_ASSERT_EQUAL_STRING(RESULT1, bin2hex(hash, 32));
|
||||
|
@ -81,7 +81,7 @@ void test_cryptonight_lite_av1_should_CalcHash(void) {
|
|||
|
||||
void test_cryptonight_lite_av2_should_CalcHash(void)
|
||||
{
|
||||
struct cryptonight_ctx *ctx = (struct cryptonight_ctx*) create_ctx(2);
|
||||
struct ScratchPad *ctx = (struct ScratchPad*) create_ctx(2);
|
||||
|
||||
cryptonight_lite_av2_aesni_double(input1, 76, &hash, ctx);
|
||||
TEST_ASSERT_EQUAL_STRING(RESULT1_DOUBLE, bin2hex(hash, 64));
|
||||
|
@ -91,7 +91,7 @@ void test_cryptonight_lite_av2_should_CalcHash(void)
|
|||
|
||||
|
||||
void test_cryptonight_lite_av3_should_CalcHash(void) {
|
||||
struct cryptonight_ctx *ctx = (struct cryptonight_ctx*) create_ctx(1);
|
||||
struct ScratchPad *ctx = (struct ScratchPad*) create_ctx(1);
|
||||
|
||||
cryptonight_lite_av3_softaes(input1, 76, &hash, ctx);
|
||||
TEST_ASSERT_EQUAL_STRING(RESULT1, bin2hex(hash, 32));
|
||||
|
@ -102,7 +102,7 @@ void test_cryptonight_lite_av3_should_CalcHash(void) {
|
|||
|
||||
void test_cryptonight_lite_av4_should_CalcHash(void)
|
||||
{
|
||||
struct cryptonight_ctx *ctx = (struct cryptonight_ctx*) create_ctx(2);
|
||||
struct ScratchPad *ctx = (struct ScratchPad*) create_ctx(2);
|
||||
|
||||
cryptonight_lite_av4_softaes_double(input1, 76, &hash, ctx);
|
||||
TEST_ASSERT_EQUAL_STRING(RESULT1_DOUBLE, bin2hex(hash, 64));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue