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:
Some Random Crypto Guy
2023-12-20 01:06:23 +00:00
parent 8bf55dbfef
commit 6d08d5aabf
27 changed files with 575 additions and 936 deletions
+13 -13
View File
@@ -140,14 +140,14 @@ 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
*/
static void derivation_to_scalar(const key_derivation &derivation, const hash& uniqueness, ec_scalar &res);
friend void derivation_to_scalar(const key_derivation &derivation, const hash& uniqueness, ec_scalar &res);
static bool derive_public_key(const key_derivation &, const hash&, const public_key &, public_key &);
friend bool derive_public_key(const key_derivation &, const hash&, const public_key &, public_key &);
static void derive_secret_key(const key_derivation &, const hash&, const secret_key &, secret_key &);
friend void derive_secret_key(const key_derivation &, const hash&, const secret_key &, secret_key &);
static bool derive_subaddress_public_key(const public_key &, const key_derivation &, const hash&, public_key &);
friend bool derive_subaddress_public_key(const public_key &, const key_derivation &, const hash&, public_key &);
static void derivation_to_scalar(const key_derivation &derivation, const ec_scalar& uniqueness, ec_scalar &res);
friend void derivation_to_scalar(const key_derivation &derivation, const ec_scalar& uniqueness, ec_scalar &res);
static bool derive_public_key(const key_derivation &, const ec_scalar&, const public_key &, public_key &);
friend bool derive_public_key(const key_derivation &, const ec_scalar&, const public_key &, public_key &);
static void derive_secret_key(const key_derivation &, const ec_scalar&, const secret_key &, secret_key &);
friend void derive_secret_key(const key_derivation &, const ec_scalar&, const secret_key &, secret_key &);
static bool derive_subaddress_public_key(const public_key &, const key_derivation &, const ec_scalar&, public_key &);
friend bool derive_subaddress_public_key(const public_key &, const key_derivation &, const ec_scalar&, public_key &);
static void generate_signature(const hash &, const public_key &, const secret_key &, signature &);
friend void generate_signature(const hash &, const public_key &, const secret_key &, signature &);
@@ -261,20 +261,20 @@ 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
*/
inline bool derive_public_key(const key_derivation &derivation, const hash& uniqueness,
inline bool derive_public_key(const key_derivation &derivation, const ec_scalar& uniqueness,
const public_key &base, public_key &derived_key) {
return crypto_ops::derive_public_key(derivation, uniqueness, base, derived_key);
}
inline void derivation_to_scalar(const key_derivation &derivation, const hash& uniqueness, ec_scalar &res) {
inline void derivation_to_scalar(const key_derivation &derivation, const ec_scalar& uniqueness, ec_scalar &res) {
return crypto_ops::derivation_to_scalar(derivation, uniqueness, res);
}
inline void derive_secret_key(const key_derivation &derivation, const hash& uniqueness,
inline void derive_secret_key(const key_derivation &derivation, const ec_scalar& uniqueness,
const secret_key &base, secret_key &derived_key) {
crypto_ops::derive_secret_key(derivation, uniqueness, base, derived_key);
}
inline bool derive_subaddress_public_key(const public_key &out_key, const key_derivation &derivation, const hash& uniqueness, public_key &result) {
inline bool derive_subaddress_public_key(const public_key &out_key, const key_derivation &derivation, const ec_scalar& uniqueness, public_key &result) {
return crypto_ops::derive_subaddress_public_key(out_key, derivation, uniqueness, result);
}