mirror of
https://github.com/monero-project/monero.git
synced 2025-06-19 09:34:12 -04:00
Simplified the implementation and features of span
This commit is contained in:
parent
4a8f96f95d
commit
93e10f1cc4
7 changed files with 169 additions and 208 deletions
|
@ -34,6 +34,7 @@
|
|||
#include "crypto/crypto.h"
|
||||
#include "crypto/hash.h"
|
||||
#include "hex.h"
|
||||
#include "span.h"
|
||||
|
||||
|
||||
namespace cryptonote {
|
||||
|
@ -127,11 +128,25 @@ namespace cryptonote {
|
|||
bool parse_hash256(const std::string str_hash, crypto::hash& hash);
|
||||
|
||||
namespace crypto {
|
||||
inline std::ostream &operator <<(std::ostream &o, const crypto::public_key &v) { epee::to_hex::formatted_from_pod(o, v); return o; }
|
||||
inline std::ostream &operator <<(std::ostream &o, const crypto::secret_key &v) { epee::to_hex::formatted_from_pod(o, v); return o; }
|
||||
inline std::ostream &operator <<(std::ostream &o, const crypto::key_derivation &v) { epee::to_hex::formatted_from_pod(o, v); return o; }
|
||||
inline std::ostream &operator <<(std::ostream &o, const crypto::key_image &v) { epee::to_hex::formatted_from_pod(o, v); return o; }
|
||||
inline std::ostream &operator <<(std::ostream &o, const crypto::signature &v) { epee::to_hex::formatted_from_pod(o, v); return o; }
|
||||
inline std::ostream &operator <<(std::ostream &o, const crypto::hash &v) { epee::to_hex::formatted_from_pod(o, v); return o; }
|
||||
inline std::ostream &operator <<(std::ostream &o, const crypto::hash8 &v) { epee::to_hex::formatted_from_pod(o, v); return o; }
|
||||
inline std::ostream &operator <<(std::ostream &o, const crypto::public_key &v) {
|
||||
epee::to_hex::formatted(o, epee::as_byte_span(v)); return o;
|
||||
}
|
||||
inline std::ostream &operator <<(std::ostream &o, const crypto::secret_key &v) {
|
||||
epee::to_hex::formatted(o, epee::as_byte_span(v)); return o;
|
||||
}
|
||||
inline std::ostream &operator <<(std::ostream &o, const crypto::key_derivation &v) {
|
||||
epee::to_hex::formatted(o, epee::as_byte_span(v)); return o;
|
||||
}
|
||||
inline std::ostream &operator <<(std::ostream &o, const crypto::key_image &v) {
|
||||
epee::to_hex::formatted(o, epee::as_byte_span(v)); return o;
|
||||
}
|
||||
inline std::ostream &operator <<(std::ostream &o, const crypto::signature &v) {
|
||||
epee::to_hex::formatted(o, epee::as_byte_span(v)); return o;
|
||||
}
|
||||
inline std::ostream &operator <<(std::ostream &o, const crypto::hash &v) {
|
||||
epee::to_hex::formatted(o, epee::as_byte_span(v)); return o;
|
||||
}
|
||||
inline std::ostream &operator <<(std::ostream &o, const crypto::hash8 &v) {
|
||||
epee::to_hex::formatted(o, epee::as_byte_span(v)); return o;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,6 +48,7 @@ extern "C" {
|
|||
#include "crypto/crypto.h"
|
||||
|
||||
#include "hex.h"
|
||||
#include "span.h"
|
||||
#include "serialization/serialization.h"
|
||||
#include "serialization/debug_archive.h"
|
||||
#include "serialization/binary_archive.h"
|
||||
|
@ -444,7 +445,9 @@ namespace cryptonote {
|
|||
static inline bool operator!=(const crypto::secret_key &k0, const rct::key &k1) { return memcmp(&k0, &k1, 32); }
|
||||
}
|
||||
|
||||
inline std::ostream &operator <<(std::ostream &o, const rct::key &v) { epee::to_hex::formatted_from_pod(o, v); return o; }
|
||||
inline std::ostream &operator <<(std::ostream &o, const rct::key &v) {
|
||||
epee::to_hex::formatted(o, epee::as_byte_span(v)); return o;
|
||||
}
|
||||
|
||||
|
||||
BLOB_SERIALIZER(rct::key);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue