mirror of
https://github.com/xmrig/xmrig.git
synced 2026-04-18 05:22:28 -04:00
Proxy miner signature support (WIP)
This commit is contained in:
@@ -167,6 +167,30 @@ void derive_secret_key(const uint8_t* derivation, size_t output_index, const uin
|
||||
}
|
||||
|
||||
|
||||
bool derive_public_key(const uint8_t* derivation, size_t output_index, const uint8_t* base, uint8_t* derived_key)
|
||||
{
|
||||
ec_scalar scalar;
|
||||
ge_p3 point1;
|
||||
ge_p3 point2;
|
||||
ge_cached point3;
|
||||
ge_p1p1 point4;
|
||||
ge_p2 point5;
|
||||
|
||||
if (ge_frombytes_vartime(&point1, base) != 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
derivation_to_scalar(derivation, output_index, scalar);
|
||||
ge_scalarmult_base(&point2, (uint8_t*) &scalar);
|
||||
ge_p3_to_cached(&point3, &point2);
|
||||
ge_add(&point4, &point1, &point3);
|
||||
ge_p1p1_to_p2(&point5, &point4);
|
||||
ge_tobytes(derived_key, &point5);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void derive_view_secret_key(const uint8_t* spend_secret_key, uint8_t* view_secret_key)
|
||||
{
|
||||
keccak(spend_secret_key, 32, view_secret_key, 32);
|
||||
|
||||
Reference in New Issue
Block a user