35 #include <boost/thread/mutex.hpp> 36 #include <boost/thread/lock_guard.hpp> 69 std::vector<public_key> keys;
74 std::vector<secret_key> keys;
101 sizeof(
signature) == 64,
"Invalid structure size");
145 inline void rand(
size_t N, uint8_t *bytes) {
153 typename std::enable_if<std::is_pod<T>::value,
T>::type
rand() {
154 typename std::remove_cv<T>::type res;
228 const public_key *
const *pubs, std::size_t pubs_count,
234 const public_key *
const *pubs, std::size_t pubs_count,
242 const std::vector<const public_key *> &pubs,
248 const std::vector<const public_key *> &pubs,
void derivation_to_scalar(const key_derivation &derivation, size_t output_index, ec_scalar &res)
Definition: crypto.h:191
POD_CLASS ec_point
Definition: crypto.h:52
const uint32_t T[512]
Definition: groestl_tables.h:34
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)
Definition: crypto.h:211
#define CRYPTO_MAKE_COMPARABLE(type)
Definition: generic-ops.h:38
static bool derive_public_key(const key_derivation &, std::size_t, const public_key &, public_key &)
void derive_secret_key(const key_derivation &derivation, std::size_t output_index, const secret_key &base, secret_key &derived_key)
Definition: crypto.h:194
static bool secret_key_to_public_key(const secret_key &, public_key &)
Definition: crypto.cpp:128
static bool check_signature(const hash &, const public_key &, const signature &)
Definition: crypto.cpp:229
static void generate_key_image(const public_key &, const secret_key &, key_image &)
Definition: crypto.cpp:378
POD_CLASS key_derivation
Definition: crypto.h:82
static bool check_key(const public_key &)
Definition: crypto.cpp:123
bool check_ring_signature(const hash &prefix_hash, const key_image &image, const public_key *const *pubs, std::size_t pubs_count, const signature *sig)
Definition: crypto.h:233
void generate_signature(const hash &prefix_hash, const public_key &pub, const secret_key &sec, signature &sig)
Definition: crypto.h:201
crypto namespace.
Definition: crypto.cpp:47
POD_CLASS secret_keyV
Definition: crypto.h:73
#define POD_CLASS
Definition: pod-class.h:44
bool generate_key_derivation(const public_key &key1, const secret_key &key2, key_derivation &derivation)
Definition: crypto.h:184
void generate_random_bytes_not_thread_safe(size_t n, void *result)
Definition: random.c:117
boost::mutex random_lock
Definition: crypto.cpp:61
void generate_key_image(const public_key &pub, const secret_key &sec, key_image &image)
Definition: crypto.h:224
void rand(size_t N, uint8_t *bytes)
Definition: crypto.h:145
POD_CLASS public_keyM
Definition: crypto.h:78
POD_CLASS ec_scalar
Definition: crypto.h:56
static void generate_tx_proof(const hash &, const public_key &, const public_key &, const public_key &, const secret_key &, signature &)
Definition: crypto.cpp:250
static secret_key generate_keys(public_key &pub, secret_key &sec, const secret_key &recovery_key=secret_key(), bool recover=false)
Definition: crypto.cpp:101
void generate_ring_signature(const hash &prefix_hash, const key_image &image, const public_key *const *pubs, std::size_t pubs_count, const secret_key &sec, std::size_t sec_index, signature *sig)
Definition: crypto.h:227
friend class crypto_ops
Definition: crypto.h:94
static void derive_secret_key(const key_derivation &, std::size_t, const secret_key &, secret_key &)
secret_key generate_keys(public_key &pub, secret_key &sec, const secret_key &recovery_key=secret_key(), bool recover=false)
Definition: crypto.h:162
static bool check_tx_proof(const hash &, const public_key &, const public_key &, const public_key &, const signature &)
Definition: crypto.cpp:300
POD_CLASS public_key
Definition: crypto.h:58
bool check_tx_proof(const hash &prefix_hash, const public_key &R, const public_key &A, const public_key &D, const signature &sig)
Definition: crypto.h:214
static bool generate_key_derivation(const public_key &, const secret_key &, key_derivation &)
Definition: crypto.cpp:138
POD_CLASS signature
Definition: crypto.h:92
POD_CLASS key_image
Definition: crypto.h:86
POD_CLASS secret_key
Definition: crypto.h:62
void operator=(const crypto_ops &)
bool derive_public_key(const key_derivation &derivation, std::size_t output_index, const public_key &base, public_key &derived_key)
Definition: crypto.h:187
bool check_key(const public_key &key)
Definition: crypto.h:168
static bool check_ring_signature(const hash &, const key_image &, const public_key *const *, std::size_t, const signature *)
POD_CLASS hash
Definition: hash.h:46
static void generate_ring_signature(const hash &, const key_image &, const public_key *const *, std::size_t, const secret_key &, std::size_t, signature *)
std::vector< secret_keyV > column_vectors
Definition: crypto.h:81
bool secret_key_to_public_key(const secret_key &sec, public_key &pub)
Definition: crypto.h:174
POD_CLASS public_keyV
Definition: crypto.h:68
static void generate_signature(const hash &, const public_key &, const secret_key &, signature &)
Definition: crypto.cpp:206
#define CRYPTO_MAKE_HASHABLE(type)
Definition: generic-ops.h:48
static void derivation_to_scalar(const key_derivation &derivation, size_t output_index, ec_scalar &res)
Definition: crypto.cpp:153
bool check_signature(const hash &prefix_hash, const public_key &pub, const signature &sig)
Definition: crypto.h:204
int rows
Definition: crypto.h:70