#include <sha3.hpp>
|
template<typename T > |
T & | operator<< (T &ds, const sha3 &ep) |
|
template<typename T > |
T & | operator>> (T &ds, sha3 &ep) |
|
sha3 | operator<< (const sha3 &h1, uint32_t i) |
|
sha3 | operator>> (const sha3 &h1, uint32_t i) |
|
bool | operator== (const sha3 &h1, const sha3 &h2) |
|
bool | operator!= (const sha3 &h1, const sha3 &h2) |
|
sha3 | operator^ (const sha3 &h1, const sha3 &h2) |
|
bool | operator>= (const sha3 &h1, const sha3 &h2) |
|
bool | operator> (const sha3 &h1, const sha3 &h2) |
|
bool | operator< (const sha3 &h1, const sha3 &h2) |
|
Definition at line 10 of file sha3.hpp.
◆ sha3() [1/3]
Definition at line 176 of file sha3.cpp.
177{
179}
memset(pInfo->slotDescription, ' ', 64)
◆ ~sha3()
◆ sha3() [2/3]
fc::sha3::sha3 |
( |
const string & | hex_str | ) |
|
|
explicit |
Definition at line 186 of file sha3.cpp.
187{
189 if (bytes_written <
sizeof(
_hash))
191}
◆ sha3() [3/3]
fc::sha3::sha3 |
( |
const char * | data, |
|
|
size_t | size ) |
|
explicit |
Definition at line 180 of file sha3.cpp.
181{
182 if (size !=
sizeof(
_hash))
185}
#define FC_THROW_EXCEPTION(EXCEPTION, FORMAT,...)
memcpy((char *) pInfo->slotDescription, s, l)
◆ data() [1/2]
char * fc::sha3::data |
( |
| ) |
|
◆ data() [2/2]
const char * fc::sha3::data |
( |
| ) |
const |
◆ data_size()
size_t fc::sha3::data_size |
( |
| ) |
const |
|
inline |
◆ hash() [1/4]
static sha3 fc::sha3::hash |
( |
const char * | d, |
|
|
uint32_t | dlen, |
|
|
bool | is_nist = true ) |
|
inlinestatic |
Definition at line 25 of file sha3.hpp.
25 {
26 encoder e;
27 e.write(d, dlen);
28 const auto& sha = e.result(is_nist);
29 return sha;
30 }
◆ hash() [2/4]
static sha3 fc::sha3::hash |
( |
const sha3 & | s, |
|
|
bool | is_nist = true ) |
|
inlinestatic |
Definition at line 32 of file sha3.hpp.
32{
return hash(
s.data(),
sizeof(
s._hash), is_nist); }
static sha3 hash(const char *d, uint32_t dlen, bool is_nist=true)
◆ hash() [3/4]
static sha3 fc::sha3::hash |
( |
const string & | s, |
|
|
bool | is_nist = true ) |
|
inlinestatic |
Definition at line 31 of file sha3.hpp.
31{
return hash(
s.c_str(),
s.size(), is_nist); }
◆ hash() [4/4]
static sha3 fc::sha3::hash |
( |
const T & | t, |
|
|
bool | is_nist = true ) |
|
inlinestatic |
Definition at line 35 of file sha3.hpp.
36 {
37 sha3::encoder e;
39 return e.result(is_nist);
40 }
void pack(Stream &s, const std::deque< T > &value)
◆ operator string()
fc::sha3::operator string |
( |
| ) |
const |
◆ str()
string fc::sha3::str |
( |
| ) |
const |
Definition at line 193 of file sha3.cpp.
194{
196}
fc::string to_hex(const char *d, uint32_t s)
◆ operator!=
Definition at line 262 of file sha3.cpp.
263{
264 return !(h1 == h2);
265}
◆ operator<
bool operator< |
( |
const sha3 & | h1, |
|
|
const sha3 & | h2 ) |
|
friend |
Definition at line 258 of file sha3.cpp.
259{
260 return memcmp(h1._hash, h2._hash, sizeof(h1._hash)) < 0;
261}
◆ operator<< [1/2]
Definition at line 229 of file sha3.cpp.
230{
232 fc::detail::shift_l(h1.data(), result.data(), result.data_size(), i);
233 return result;
234}
◆ operator<< [2/2]
T & operator<< |
( |
T & | ds, |
|
|
const sha3 & | ep ) |
|
friend |
Definition at line 59 of file sha3.hpp.
60 {
61 ds.write(ep.data(),
sizeof(ep));
63 }
static const Segment ds(Segment::ds)
◆ operator==
bool operator== |
( |
const sha3 & | h1, |
|
|
const sha3 & | h2 ) |
|
friend |
Definition at line 266 of file sha3.cpp.
267{
268
269
270 return h1._hash[0] == h2._hash[0] &&
271 h1._hash[1] == h2._hash[1] &&
272 h1._hash[2] == h2._hash[2] &&
273 h1._hash[3] == h2._hash[3];
274}
◆ operator>
bool operator> |
( |
const sha3 & | h1, |
|
|
const sha3 & | h2 ) |
|
friend |
Definition at line 254 of file sha3.cpp.
255{
256 return memcmp(h1._hash, h2._hash, sizeof(h1._hash)) > 0;
257}
◆ operator>=
bool operator>= |
( |
const sha3 & | h1, |
|
|
const sha3 & | h2 ) |
|
friend |
Definition at line 250 of file sha3.cpp.
251{
252 return memcmp(h1._hash, h2._hash, sizeof(h1._hash)) >= 0;
253}
◆ operator>> [1/2]
Definition at line 235 of file sha3.cpp.
236{
238 fc::detail::shift_r(h1.data(), result.data(), result.data_size(), i);
239 return result;
240}
◆ operator>> [2/2]
T & operator>> |
( |
T & | ds, |
|
|
sha3 & | ep ) |
|
friend |
Definition at line 66 of file sha3.hpp.
67 {
68 ds.read(ep.data(),
sizeof(ep));
70 }
◆ operator^
Definition at line 241 of file sha3.cpp.
242{
244 result._hash[0] = h1._hash[0] ^ h2._hash[0];
245 result._hash[1] = h1._hash[1] ^ h2._hash[1];
246 result._hash[2] = h1._hash[2] ^ h2._hash[2];
247 result._hash[3] = h1._hash[3] ^ h2._hash[3];
248 return result;
249}
◆ _hash
The documentation for this class was generated from the following files: