diff options
Diffstat (limited to 'src/crypto/crypto.h')
-rw-r--r-- | src/crypto/crypto.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/crypto/crypto.h b/src/crypto/crypto.h index 3b8c7996b..e99b6651f 100644 --- a/src/crypto/crypto.h +++ b/src/crypto/crypto.h @@ -123,6 +123,10 @@ namespace crypto { friend void generate_signature(const hash &, const public_key &, const secret_key &, signature &); static bool check_signature(const hash &, const public_key &, const signature &); friend bool check_signature(const hash &, const public_key &, const signature &); + static void generate_tx_proof(const hash &, const public_key &, const public_key &, const public_key &, const secret_key &, signature &); + friend void generate_tx_proof(const hash &, const public_key &, const public_key &, const public_key &, const secret_key &, signature &); + static bool check_tx_proof(const hash &, const public_key &, const public_key &, const public_key &, const signature &); + friend bool check_tx_proof(const hash &, const public_key &, const public_key &, const public_key &, const signature &); static void generate_key_image(const public_key &, const secret_key &, key_image &); friend void generate_key_image(const public_key &, const secret_key &, key_image &); static void generate_ring_signature(const hash &, const key_image &, @@ -200,6 +204,16 @@ namespace crypto { return crypto_ops::check_signature(prefix_hash, pub, sig); } + /* Generation and checking of a tx proof; given a tx pubkey R, the recipient's view pubkey A, and the key + * derivation D, the signature proves the knowledge of the tx secret key r such that R=r*G and D=r*A + */ + inline void generate_tx_proof(const hash &prefix_hash, const public_key &R, const public_key &A, const public_key &D, const secret_key &r, signature &sig) { + crypto_ops::generate_tx_proof(prefix_hash, R, A, D, r, sig); + } + inline bool check_tx_proof(const hash &prefix_hash, const public_key &R, const public_key &A, const public_key &D, const signature &sig) { + return crypto_ops::check_tx_proof(prefix_hash, R, A, D, sig); + } + /* To send money to a key: * * The sender generates an ephemeral key and includes it in transaction output. * * To spend the money, the receiver generates a key image from it. |