A whole host of changes to start supporting more unified approach to uniqueness
Lots of refactoring still to be done in the codebase, and currently TRANSFER method does not work - the daemon does not send the real output for some reason. Lots still to do - please be patient. This code is NOT ready for use. Or testing. Or anything else.
This commit is contained in:
@@ -263,11 +263,11 @@ namespace crypto {
|
||||
|
||||
/**
|
||||
* The following functions are designed to perform the correct encoding / decoding for protocol_tx outputs,
|
||||
* which use a hash of a crypto::key_image for uniqueness
|
||||
* which use an ec_scalar to provide uniqueness
|
||||
*/
|
||||
void crypto_ops::derivation_to_scalar(const key_derivation &derivation, const hash& uniqueness, ec_scalar &res) {
|
||||
void crypto_ops::derivation_to_scalar(const key_derivation &derivation, const ec_scalar& uniqueness, ec_scalar &res) {
|
||||
struct {
|
||||
hash uniqueness;
|
||||
ec_scalar uniqueness;
|
||||
key_derivation derivation;
|
||||
} buf;
|
||||
buf.uniqueness = uniqueness;
|
||||
@@ -275,7 +275,7 @@ namespace crypto {
|
||||
hash_to_scalar(&buf, sizeof(buf), res);
|
||||
}
|
||||
|
||||
bool crypto_ops::derive_public_key(const key_derivation &derivation, const hash& uniqueness,
|
||||
bool crypto_ops::derive_public_key(const key_derivation &derivation, const ec_scalar& uniqueness,
|
||||
const public_key &base, public_key &derived_key) {
|
||||
ec_scalar scalar;
|
||||
ge_p3 point1;
|
||||
@@ -295,7 +295,7 @@ namespace crypto {
|
||||
return true;
|
||||
}
|
||||
|
||||
void crypto_ops::derive_secret_key(const key_derivation &derivation, const hash& uniqueness,
|
||||
void crypto_ops::derive_secret_key(const key_derivation &derivation, const ec_scalar& uniqueness,
|
||||
const secret_key &base, secret_key &derived_key) {
|
||||
ec_scalar scalar;
|
||||
assert(sc_check(&base) == 0);
|
||||
@@ -303,7 +303,7 @@ namespace crypto {
|
||||
sc_add(&unwrap(derived_key), &unwrap(base), &scalar);
|
||||
}
|
||||
|
||||
bool crypto_ops::derive_subaddress_public_key(const public_key &out_key, const key_derivation &derivation, const hash& uniqueness, public_key &derived_key) {
|
||||
bool crypto_ops::derive_subaddress_public_key(const public_key &out_key, const key_derivation &derivation, const ec_scalar& uniqueness, public_key &derived_key) {
|
||||
ec_scalar scalar;
|
||||
ge_p3 point1;
|
||||
ge_p3 point2;
|
||||
|
||||
Reference in New Issue
Block a user