rename
This commit is contained in:
@@ -16,10 +16,10 @@ struct Autolykos2Context {
|
||||
void* backend;
|
||||
};
|
||||
|
||||
#ifdef MINICOIN_AUTOLYKOS2_REF_AVAILABLE
|
||||
extern void* minicoin_autolykos2_ref_create(void);
|
||||
extern void minicoin_autolykos2_ref_destroy(void* handle);
|
||||
extern bool minicoin_autolykos2_ref_check_target(
|
||||
#ifdef SKALACOIN_AUTOLYKOS2_REF_AVAILABLE
|
||||
extern void* skalacoin_autolykos2_ref_create(void);
|
||||
extern void skalacoin_autolykos2_ref_destroy(void* handle);
|
||||
extern bool skalacoin_autolykos2_ref_check_target(
|
||||
void* handle,
|
||||
const uint8_t message32[32],
|
||||
uint64_t nonce,
|
||||
@@ -247,8 +247,8 @@ Autolykos2Context* Autolykos2_Create(void) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef MINICOIN_AUTOLYKOS2_REF_AVAILABLE
|
||||
ctx->backend = minicoin_autolykos2_ref_create();
|
||||
#ifdef SKALACOIN_AUTOLYKOS2_REF_AVAILABLE
|
||||
ctx->backend = skalacoin_autolykos2_ref_create();
|
||||
#endif
|
||||
|
||||
return ctx;
|
||||
@@ -259,9 +259,9 @@ void Autolykos2_Destroy(Autolykos2Context* ctx) {
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef MINICOIN_AUTOLYKOS2_REF_AVAILABLE
|
||||
#ifdef SKALACOIN_AUTOLYKOS2_REF_AVAILABLE
|
||||
if (ctx->backend) {
|
||||
minicoin_autolykos2_ref_destroy(ctx->backend);
|
||||
skalacoin_autolykos2_ref_destroy(ctx->backend);
|
||||
ctx->backend = NULL;
|
||||
}
|
||||
#endif
|
||||
@@ -430,9 +430,9 @@ bool Autolykos2_CheckTarget(
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef MINICOIN_AUTOLYKOS2_REF_AVAILABLE
|
||||
#ifdef SKALACOIN_AUTOLYKOS2_REF_AVAILABLE
|
||||
if (ctx->backend) {
|
||||
const bool ok = minicoin_autolykos2_ref_check_target(ctx->backend, message32, nonce, height, target32);
|
||||
const bool ok = skalacoin_autolykos2_ref_check_target(ctx->backend, message32, nonce, height, target32);
|
||||
if (Autolykos2_Hash(ctx, message32, 32, nonce, height, outHash)) {
|
||||
return ok;
|
||||
}
|
||||
|
||||
@@ -28,27 +28,27 @@ uint32_t calcN(uint32_t Hblock) {
|
||||
return newN;
|
||||
}
|
||||
|
||||
struct minicoin_autolykos2_ref_handle {
|
||||
struct skalacoin_autolykos2_ref_handle {
|
||||
AutolykosAlg* alg;
|
||||
};
|
||||
|
||||
extern "C" void* minicoin_autolykos2_ref_create(void) {
|
||||
minicoin_autolykos2_ref_handle* h = new minicoin_autolykos2_ref_handle();
|
||||
extern "C" void* skalacoin_autolykos2_ref_create(void) {
|
||||
skalacoin_autolykos2_ref_handle* h = new skalacoin_autolykos2_ref_handle();
|
||||
h->alg = new AutolykosAlg();
|
||||
return h;
|
||||
}
|
||||
|
||||
extern "C" void minicoin_autolykos2_ref_destroy(void* handle) {
|
||||
extern "C" void skalacoin_autolykos2_ref_destroy(void* handle) {
|
||||
if (!handle) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto* h = static_cast<minicoin_autolykos2_ref_handle*>(handle);
|
||||
auto* h = static_cast<skalacoin_autolykos2_ref_handle*>(handle);
|
||||
delete h->alg;
|
||||
delete h;
|
||||
}
|
||||
|
||||
extern "C" bool minicoin_autolykos2_ref_check_target(
|
||||
extern "C" bool skalacoin_autolykos2_ref_check_target(
|
||||
void* handle,
|
||||
const uint8_t message32[32],
|
||||
uint64_t nonce,
|
||||
@@ -59,7 +59,7 @@ extern "C" bool minicoin_autolykos2_ref_check_target(
|
||||
return false;
|
||||
}
|
||||
|
||||
auto* h = static_cast<minicoin_autolykos2_ref_handle*>(handle);
|
||||
auto* h = static_cast<skalacoin_autolykos2_ref_handle*>(handle);
|
||||
if (!h->alg) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -42,9 +42,9 @@ static bool Blake2_HashInternal(
|
||||
}
|
||||
|
||||
bool Blake2b_Hash(const uint8_t* input, size_t inputLen, uint8_t* out, size_t outLen) {
|
||||
return Blake2_HashInternal(EVP_blake2b512(), MINICOIN_BLAKE2B_OUTBYTES, input, inputLen, out, outLen);
|
||||
return Blake2_HashInternal(EVP_blake2b512(), SKALACOIN_BLAKE2B_OUTBYTES, input, inputLen, out, outLen);
|
||||
}
|
||||
|
||||
bool Blake2s_Hash(const uint8_t* input, size_t inputLen, uint8_t* out, size_t outLen) {
|
||||
return Blake2_HashInternal(EVP_blake2s256(), MINICOIN_BLAKE2S_OUTBYTES, input, inputLen, out, outLen);
|
||||
return Blake2_HashInternal(EVP_blake2s256(), SKALACOIN_BLAKE2S_OUTBYTES, input, inputLen, out, outLen);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ static bool GenerateTestMinerIdentity(uint8_t privateKey[32], uint8_t compressed
|
||||
secp256k1_pubkey pubkey;
|
||||
|
||||
for (uint64_t counter = 0; counter < 1024; ++counter) {
|
||||
const char* base = "minicoin-test-miner-key";
|
||||
const char* base = "skalacoin-test-miner-key";
|
||||
size_t baseLen = strlen(base);
|
||||
memcpy(seed, base, baseLen);
|
||||
memcpy(seed + baseLen, &counter, sizeof(counter));
|
||||
@@ -85,7 +85,7 @@ static void MakeTestRecipientAddress(uint8_t outAddress[32]) {
|
||||
return;
|
||||
}
|
||||
|
||||
const char* label = "minicoin-test-recipient-address";
|
||||
const char* label = "skalacoin-test-recipient-address";
|
||||
SHA256((const unsigned char*)label, strlen(label), outAddress);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user