Cleanup
This commit is contained in:
parent
2c6fea0a28
commit
e2bc90fd10
1 changed files with 2 additions and 8 deletions
|
@ -144,7 +144,7 @@ bool CryptoNight::init(int algo, int variant)
|
||||||
|
|
||||||
bool CryptoNight::selfTest(int algo)
|
bool CryptoNight::selfTest(int algo)
|
||||||
{
|
{
|
||||||
if (cryptonight_hash_ctx_d == nullptr) {
|
if (cryptonight_hash_ctx_s == nullptr || cryptonight_hash_ctx_d == nullptr) {
|
||||||
return false;
|
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);
|
struct cryptonight_ctx *ctx = (struct cryptonight_ctx*) _mm_malloc(sizeof(struct cryptonight_ctx), 16);
|
||||||
ctx->memory = (uint8_t *) _mm_malloc(MEMORY * 2, 16);
|
ctx->memory = (uint8_t *) _mm_malloc(MEMORY * 2, 16);
|
||||||
|
|
||||||
cryptonight_hash_ctx_d(test_input, 76, output, ctx);
|
cryptonight_hash_ctx_s(test_input, 76, output, ctx);
|
||||||
|
|
||||||
_mm_free(ctx->memory);
|
|
||||||
_mm_free(ctx);
|
|
||||||
|
|
||||||
bool resultSingle = memcmp(output, algo == Options::ALGO_CRYPTONIGHT_LITE ? test_output1 : test_output0, 32) == 0;
|
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);
|
cryptonight_hash_ctx_d(test_input, 76, output, ctx);
|
||||||
|
|
||||||
_mm_free(ctx->memory);
|
_mm_free(ctx->memory);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue