From e2bc90fd107d898b19149286ec61616cab5aaf77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ben=20Gr=C3=A4f?= Date: Mon, 4 Dec 2017 17:26:25 +0100 Subject: [PATCH] Cleanup --- src/crypto/CryptoNight.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/crypto/CryptoNight.cpp b/src/crypto/CryptoNight.cpp index 95119fa8..76fd9f8a 100644 --- a/src/crypto/CryptoNight.cpp +++ b/src/crypto/CryptoNight.cpp @@ -144,7 +144,7 @@ bool CryptoNight::init(int algo, int variant) bool CryptoNight::selfTest(int algo) { - if (cryptonight_hash_ctx_d == nullptr) { + if (cryptonight_hash_ctx_s == nullptr || cryptonight_hash_ctx_d == nullptr) { return false; } @@ -153,16 +153,10 @@ bool CryptoNight::selfTest(int algo) struct cryptonight_ctx *ctx = (struct cryptonight_ctx*) _mm_malloc(sizeof(struct cryptonight_ctx), 16); ctx->memory = (uint8_t *) _mm_malloc(MEMORY * 2, 16); - cryptonight_hash_ctx_d(test_input, 76, output, ctx); - - _mm_free(ctx->memory); - _mm_free(ctx); + cryptonight_hash_ctx_s(test_input, 76, output, ctx); bool resultSingle = memcmp(output, algo == Options::ALGO_CRYPTONIGHT_LITE ? test_output1 : test_output0, 32) == 0; - ctx = (struct cryptonight_ctx*) _mm_malloc(sizeof(struct cryptonight_ctx), 16); - ctx->memory = (uint8_t *) _mm_malloc(MEMORY * 2, 16); - cryptonight_hash_ctx_d(test_input, 76, output, ctx); _mm_free(ctx->memory);