|
Electroneum
|
crypto namespace. More...
Namespaces | |
| ElectrumWords | |
| Mnemonic seed word generation and wallet restoration helper functions. | |
Classes | |
| class | crypto_ops |
| struct | ec_point_pair |
| struct | ge_cached |
| struct | ge_p1p1 |
| struct | ge_p2 |
| struct | ge_p3 |
| struct | ge_precomp |
| union | hash_state |
| struct | random_device |
| struct | rs_comm |
| struct | s_comm |
| struct | s_comm_2 |
| struct | s_comm_3 |
Typedefs | |
| typedef int32_t | fe[10] |
| typedef ge_cached | ge_dsmp[8] |
| using | secret_key = epee::mlocked< tools::scrubbed< ec_scalar > > |
Enumerations | |
| enum | { HASH_SIZE = 32, HASH_DATA_AREA = 136 } |
Functions | |
| void | ge_add (ge_p1p1 *, const ge_p3 *, const ge_cached *) |
| void | ge_dsm_precomp (ge_dsmp r, const ge_p3 *s) |
| void | ge_double_scalarmult_base_vartime (ge_p2 *, const unsigned char *, const ge_p3 *, const unsigned char *) |
| void | ge_double_scalarmult_base_vartime_p3 (ge_p3 *, const unsigned char *, const ge_p3 *, const unsigned char *) |
| int | ge_frombytes_vartime (ge_p3 *, const unsigned char *) |
| void | ge_p1p1_to_p2 (ge_p2 *, const ge_p1p1 *) |
| void | ge_p1p1_to_p3 (ge_p3 *, const ge_p1p1 *) |
| void | ge_p2_dbl (ge_p1p1 *, const ge_p2 *) |
| void | ge_p3_to_cached (ge_cached *, const ge_p3 *) |
| void | ge_p3_to_p2 (ge_p2 *, const ge_p3 *) |
| void | ge_p3_tobytes (unsigned char *, const ge_p3 *) |
| void | ge_scalarmult_base (ge_p3 *, const unsigned char *) |
| void | ge_tobytes (unsigned char *, const ge_p2 *) |
| void | sc_reduce (unsigned char *) |
| void | ge_scalarmult (ge_p2 *, const unsigned char *, const ge_p3 *) |
| void | ge_scalarmult_p3 (ge_p3 *, const unsigned char *, const ge_p3 *) |
| void | ge_double_scalarmult_precomp_vartime (ge_p2 *, const unsigned char *, const ge_p3 *, const unsigned char *, const ge_dsmp) |
| void | ge_double_scalarmult_precomp_vartime2 (ge_p2 *, const unsigned char *, const ge_dsmp, const unsigned char *, const ge_dsmp) |
| void | ge_double_scalarmult_precomp_vartime2_p3 (ge_p3 *, const unsigned char *, const ge_dsmp, const unsigned char *, const ge_dsmp) |
| void | ge_mul8 (ge_p1p1 *, const ge_p2 *) |
| void | ge_fromfe_frombytes_vartime (ge_p2 *, const unsigned char *) |
| void | sc_0 (unsigned char *) |
| void | sc_reduce32 (unsigned char *) |
| void | sc_add (unsigned char *, const unsigned char *, const unsigned char *) |
| void | sc_sub (unsigned char *, const unsigned char *, const unsigned char *) |
| void | sc_mulsub (unsigned char *, const unsigned char *, const unsigned char *, const unsigned char *) |
| void | sc_mul (unsigned char *, const unsigned char *, const unsigned char *) |
| void | sc_muladd (unsigned char *s, const unsigned char *a, const unsigned char *b, const unsigned char *c) |
| int | sc_check (const unsigned char *) |
| int | sc_isnonzero (const unsigned char *) |
| uint64_t | load_3 (const unsigned char *in) |
| uint64_t | load_4 (const unsigned char *in) |
| void | ge_sub (ge_p1p1 *r, const ge_p3 *p, const ge_cached *q) |
| void | fe_add (fe h, const fe f, const fe g) |
| void | fe_tobytes (unsigned char *, const fe) |
| void | fe_invert (fe out, const fe z) |
| int | ge_p3_is_point_at_infinity (const ge_p3 *p) |
| void | generate_random_bytes_not_thread_safe (size_t n, void *result) |
| void | generate_random_bytes_thread_safe (size_t N, uint8_t *bytes) |
| void | random32_unbiased (unsigned char *bytes) |
| void | random_scalar (ec_scalar &res) |
| void | hash_to_scalar (const void *data, size_t length, ec_scalar &res) |
| void | hash_to_ec (const public_key &key, ge_p3 &res) |
| void | hash_to_ec (const hash &h, ge_p3 &res) |
| void | hash_to_point (const crypto::hash &h, crypto::ec_point &res) |
| size_t | rs_comm_size (size_t pubs_count) |
| void | rand (size_t N, uint8_t *bytes) |
| template<typename T > | |
| std::enable_if< std::is_pod< T >::value, T >::type | rand () |
| template<typename T > | |
| std::enable_if< std::is_integral< T >::value, T >::type | rand_range (T range_min, T range_max) |
| template<typename T > | |
| std::enable_if< std::is_unsigned< T >::value, T >::type | rand_idx (T sz) |
| secret_key | generate_keys (public_key &pub, secret_key &sec, const secret_key &recovery_key=secret_key(), bool recover=false) |
| bool | check_key (const public_key &key) |
| bool | secret_key_to_public_key (const secret_key &sec, public_key &pub) |
| bool | generate_key_derivation (const public_key &key1, const secret_key &key2, key_derivation &derivation) |
| bool | derive_public_key (const key_derivation &derivation, std::size_t output_index, const public_key &base, public_key &derived_key) |
| void | derivation_to_scalar (const key_derivation &derivation, size_t output_index, ec_scalar &res) |
| void | derive_secret_key (const key_derivation &derivation, std::size_t output_index, const secret_key &base, secret_key &derived_key) |
| bool | derive_subaddress_public_key (const public_key &out_key, const key_derivation &derivation, std::size_t output_index, public_key &result) |
| void | generate_signature (const hash &prefix_hash, const public_key &pub, const secret_key &sec, signature &sig) |
| bool | check_signature (const hash &prefix_hash, const public_key &pub, const signature &sig) |
| void | generate_input_signature (const hash prefix_hash, const uint32_t input_index, const secret_key sec_view, const secret_key sec_spend, signature &sig) |
| bool | verify_input_signature (const hash &prefix_hash, const uint32_t input_index, const public_key pub_view, const public_key pub_spend, signature sig) |
| void | generate_tx_proof (const hash &prefix_hash, const public_key &R, const public_key &A, const boost::optional< public_key > &B, const public_key &D, const secret_key &r, signature &sig) |
| bool | check_tx_proof (const hash &prefix_hash, const public_key &R, const public_key &A, const boost::optional< public_key > &B, const public_key &D, const signature &sig) |
| void | generate_key_image (const public_key &pub, const secret_key &sec, key_image &image) |
| 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) |
| 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) |
| public_key | addKeys (const public_key &A, const public_key &B) |
| void | generate_ring_signature (const hash &prefix_hash, const key_image &image, const std::vector< const public_key *> &pubs, const secret_key &sec, std::size_t sec_index, signature *sig) |
| bool | check_ring_signature (const hash &prefix_hash, const key_image &image, const std::vector< const public_key *> &pubs, const signature *sig) |
| std::ostream & | operator<< (std::ostream &o, const crypto::public_key &v) |
| std::ostream & | operator<< (std::ostream &o, const crypto::secret_key &v) |
| std::ostream & | operator<< (std::ostream &o, const crypto::key_derivation &v) |
| std::ostream & | operator<< (std::ostream &o, const crypto::key_image &v) |
| std::ostream & | operator<< (std::ostream &o, const crypto::signature &v) |
| std::string | sign_message (const std::string &message, const std::string &privateKey) |
| bool | verify_signature (const std::string &message, const std::string &publicKey, const std::string &signature) |
| bool | verify_signature (const std::string &message, std::vector< std::string > publicKey, const std::string &signature) |
| std::vector< std::string > | create_ed25519_keypair () |
| std::string | base64_decode (const std::string &val) |
| std::string | base64_encode (const std::string &val) |
| void | hash_permutation (union hash_state *state) |
| void | hash_process (union hash_state *state, const uint8_t *buf, size_t count) |
| void | cn_fast_hash (const void *data, size_t length, char *hash) |
| void | cn_slow_hash (const void *data, size_t length, char *hash, int variant, int prehashed, uint64_t height) |
| void | hash_extra_blake (const void *data, size_t length, char *hash) |
| void | hash_extra_groestl (const void *data, size_t length, char *hash) |
| void | hash_extra_jh (const void *data, size_t length, char *hash) |
| void | hash_extra_skein (const void *data, size_t length, char *hash) |
| void | tree_hash (const char(*hashes)[HASH_SIZE], size_t count, char *root_hash) |
| void | cn_fast_hash (const void *data, std::size_t length, hash &hash) |
| hash | cn_fast_hash (const void *data, std::size_t length) |
| void | cn_slow_hash (const void *data, std::size_t length, hash &hash, int variant=0, uint64_t height=0) |
| void | cn_slow_hash_prehashed (const void *data, std::size_t length, hash &hash, int variant=0, uint64_t height=0) |
| void | tree_hash (const hash *hashes, std::size_t count, hash &root_hash) |
| std::ostream & | operator<< (std::ostream &o, const crypto::hash &v) |
| std::ostream & | operator<< (std::ostream &o, const crypto::hash8 &v) |
| std::ostream & | operator<< (std::ostream &o, const crypto::hash64 &v) |
Variables | |
| const ge_precomp | ge_Bi [8] |
| const fe | fe_sqrtm1 |
| const fe | fe_d |
| const fe | fe_d2 |
| const ge_precomp | ge_base [32][8] |
| const fe | fe_ma2 |
| const fe | fe_ma |
| const fe | fe_fffb1 |
| const fe | fe_fffb2 |
| const fe | fe_fffb3 |
| const fe | fe_fffb4 |
| const ge_p3 | ge_p3_identity |
| const ge_p3 | ge_p3_H |
| const crypto::public_key | null_pkey = crypto::public_key{} |
| const crypto::secret_key | null_skey = crypto::secret_key{} |
| POD_CLASS | ec_point |
| POD_CLASS | ec_scalar |
| POD_CLASS | public_key |
| POD_CLASS | public_keyV |
| int | rows |
| POD_CLASS | secret_keyV |
| POD_CLASS | public_keyM |
| std::vector< secret_keyV > | column_vectors |
| POD_CLASS | key_derivation |
| POD_CLASS | key_image |
| POD_CLASS | signature |
| PUSH_WARNINGS | |
| POD_CLASS | hash |
| POD_CLASS | hash8 |
| POD_CLASS | hash64 |
crypto namespace.
| typedef int32_t crypto::fe[10] |
Definition at line 37 of file crypto.cpp.
| typedef ge_cached crypto::ge_dsmp[8] |
Definition at line 80 of file crypto.cpp.
| using crypto::secret_key = typedef epee::mlocked<tools::scrubbed<ec_scalar> > |
| anonymous enum |
|
inline |
|
inline |
Definition at line 392 of file crypto.h.
|
inline |
|
inline |
|
inline |
Definition at line 333 of file crypto.h.

|
inline |
Definition at line 351 of file crypto.h.

|
inline |
Definition at line 295 of file crypto.h.

|
inline |
Definition at line 314 of file crypto.h.


|
inline |
|
inline |
| void crypto::cn_fast_hash | ( | const void * | data, |
| size_t | length, | ||
| char * | hash | ||
| ) |

|
inline |
| void crypto::cn_slow_hash | ( | const void * | data, |
| size_t | length, | ||
| char * | hash, | ||
| int | variant, | ||
| int | prehashed, | ||
| uint64_t | height | ||
| ) |

|
inline |
|
inline |
Definition at line 388 of file crypto.h.

|
inline |
Definition at line 279 of file crypto.h.

|
inline |
Definition at line 275 of file crypto.h.

|
inline |
Definition at line 282 of file crypto.h.

|
inline |
Definition at line 286 of file crypto.h.

| void crypto::fe_tobytes | ( | unsigned char * | , |
| const fe | |||
| ) |

| void crypto::ge_double_scalarmult_base_vartime | ( | ge_p2 * | , |
| const unsigned char * | , | ||
| const ge_p3 * | , | ||
| const unsigned char * | |||
| ) |

| void crypto::ge_double_scalarmult_base_vartime_p3 | ( | ge_p3 * | , |
| const unsigned char * | , | ||
| const ge_p3 * | , | ||
| const unsigned char * | |||
| ) |
| void crypto::ge_double_scalarmult_precomp_vartime | ( | ge_p2 * | , |
| const unsigned char * | , | ||
| const ge_p3 * | , | ||
| const unsigned char * | , | ||
| const ge_dsmp | |||
| ) |

| void crypto::ge_double_scalarmult_precomp_vartime2 | ( | ge_p2 * | , |
| const unsigned char * | , | ||
| const ge_dsmp | , | ||
| const unsigned char * | , | ||
| const ge_dsmp | |||
| ) |

| void crypto::ge_double_scalarmult_precomp_vartime2_p3 | ( | ge_p3 * | , |
| const unsigned char * | , | ||
| const ge_dsmp | , | ||
| const unsigned char * | , | ||
| const ge_dsmp | |||
| ) |

| int crypto::ge_frombytes_vartime | ( | ge_p3 * | , |
| const unsigned char * | |||
| ) |

| void crypto::ge_fromfe_frombytes_vartime | ( | ge_p2 * | , |
| const unsigned char * | |||
| ) |



| int crypto::ge_p3_is_point_at_infinity | ( | const ge_p3 * | p | ) |

| void crypto::ge_p3_tobytes | ( | unsigned char * | , |
| const ge_p3 * | |||
| ) |


| void crypto::ge_scalarmult_base | ( | ge_p3 * | , |
| const unsigned char * | |||
| ) |


| void crypto::ge_tobytes | ( | unsigned char * | , |
| const ge_p2 * | |||
| ) |

|
inline |
Definition at line 299 of file crypto.h.
|
inline |
Definition at line 272 of file crypto.h.

|
inline |
Definition at line 324 of file crypto.h.

|
inline |
Definition at line 250 of file crypto.h.

| void crypto::generate_random_bytes_not_thread_safe | ( | size_t | n, |
| void * | result | ||
| ) |

| void crypto::generate_random_bytes_thread_safe | ( | size_t | N, |
| uint8_t * | bytes | ||
| ) |
Definition at line 91 of file crypto.cpp.


|
inline |
Definition at line 327 of file crypto.h.

|
inline |
Definition at line 345 of file crypto.h.

|
inline |
Definition at line 292 of file crypto.h.

|
inline |
Definition at line 311 of file crypto.h.


| void crypto::hash_extra_blake | ( | const void * | data, |
| size_t | length, | ||
| char * | hash | ||
| ) |
| void crypto::hash_extra_groestl | ( | const void * | data, |
| size_t | length, | ||
| char * | hash | ||
| ) |
| void crypto::hash_extra_jh | ( | const void * | data, |
| size_t | length, | ||
| char * | hash | ||
| ) |
| void crypto::hash_extra_skein | ( | const void * | data, |
| size_t | length, | ||
| char * | hash | ||
| ) |
| void crypto::hash_permutation | ( | union hash_state * | state | ) |
| void crypto::hash_process | ( | union hash_state * | state, |
| const uint8_t * | buf, | ||
| size_t | count | ||
| ) |
| POP_WARNINGS void crypto::hash_to_ec | ( | const public_key & | key, |
| ge_p3 & | res | ||
| ) |
Definition at line 479 of file crypto.cpp.


Definition at line 488 of file crypto.cpp.

| void crypto::hash_to_point | ( | const crypto::hash & | h, |
| crypto::ec_point & | res | ||
| ) |
Definition at line 496 of file crypto.cpp.


| void crypto::hash_to_scalar | ( | const void * | data, |
| size_t | length, | ||
| ec_scalar & | res | ||
| ) |
Definition at line 126 of file crypto.cpp.


| uint64_t crypto::load_3 | ( | const unsigned char * | in | ) |
| uint64_t crypto::load_4 | ( | const unsigned char * | in | ) |
|
inline |
Definition at line 91 of file hash.h.

|
inline |
Definition at line 94 of file hash.h.

|
inline |
Definition at line 97 of file hash.h.

|
inline |
Definition at line 357 of file crypto.h.

|
inline |
Definition at line 360 of file crypto.h.

|
inline |
Definition at line 363 of file crypto.h.

|
inline |
Definition at line 366 of file crypto.h.

|
inline |
Definition at line 369 of file crypto.h.

|
inline |
Definition at line 209 of file crypto.h.


Definition at line 216 of file crypto.h.

| std::enable_if<std::is_integral<T>::value, T>::type crypto::rand_range | ( | T | range_min, |
| T | range_max | ||
| ) |
Definition at line 235 of file crypto.h.
| void crypto::random32_unbiased | ( | unsigned char * | bytes | ) |
Definition at line 110 of file crypto.cpp.


| void crypto::random_scalar | ( | ec_scalar & | res | ) |
Definition at line 122 of file crypto.cpp.


| size_t crypto::rs_comm_size | ( | size_t | pubs_count | ) |
Definition at line 511 of file crypto.cpp.
| void crypto::sc_0 | ( | unsigned char * | ) |

| void crypto::sc_add | ( | unsigned char * | , |
| const unsigned char * | , | ||
| const unsigned char * | |||
| ) |

| int crypto::sc_check | ( | const unsigned char * | ) |

| int crypto::sc_isnonzero | ( | const unsigned char * | ) |

| void crypto::sc_mul | ( | unsigned char * | , |
| const unsigned char * | , | ||
| const unsigned char * | |||
| ) |
| void crypto::sc_muladd | ( | unsigned char * | s, |
| const unsigned char * | a, | ||
| const unsigned char * | b, | ||
| const unsigned char * | c | ||
| ) |
| void crypto::sc_mulsub | ( | unsigned char * | , |
| const unsigned char * | , | ||
| const unsigned char * | , | ||
| const unsigned char * | |||
| ) |

| void crypto::sc_reduce | ( | unsigned char * | ) |
| void crypto::sc_reduce32 | ( | unsigned char * | ) |

| void crypto::sc_sub | ( | unsigned char * | , |
| const unsigned char * | , | ||
| const unsigned char * | |||
| ) |

|
inline |
Definition at line 262 of file crypto.h.

|
inline |
Definition at line 376 of file crypto.h.


Definition at line 87 of file hash.h.

| void crypto::tree_hash | ( | const char(*) | hashes[HASH_SIZE], |
| size_t | count, | ||
| char * | root_hash | ||
| ) |

|
inline |
Definition at line 303 of file crypto.h.
|
inline |
Definition at line 380 of file crypto.h.


|
inline |
Definition at line 384 of file crypto.h.

| std::vector<secret_keyV> crypto::column_vectors |
| const fe crypto::fe_d |
| const fe crypto::fe_d2 |
| const fe crypto::fe_fffb1 |
| const fe crypto::fe_fffb2 |
| const fe crypto::fe_fffb3 |
| const fe crypto::fe_fffb4 |
| const fe crypto::fe_ma |
| const fe crypto::fe_ma2 |
| const fe crypto::fe_sqrtm1 |
| const ge_precomp crypto::ge_base[32][8] |
| const ge_precomp crypto::ge_Bi[8] |
| const ge_p3 crypto::ge_p3_H |
| const ge_p3 crypto::ge_p3_identity |
| POD_CLASS crypto::hash |
| const crypto::public_key crypto::null_pkey = crypto::public_key{} |
Definition at line 72 of file crypto.cpp.
| const crypto::secret_key crypto::null_skey = crypto::secret_key{} |
Definition at line 73 of file crypto.cpp.
| POD_CLASS crypto::public_keyV |
| POD_CLASS crypto::secret_keyV |
| POD_CLASS crypto::signature |