mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-03 19:13:43 +02:00
Various cleanup...
This commit is contained in:
parent
d6969c41f0
commit
053452b4a0
2 changed files with 177 additions and 337 deletions
505
core/ECC384.cpp
505
core/ECC384.cpp
File diff suppressed because it is too large
Load diff
|
@ -27,6 +27,8 @@ namespace ZeroTier {
|
|||
|
||||
namespace {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// This is the memory-intensive hash function used to compute v0 identities from v0 public keys.
|
||||
#define ZT_V0_IDENTITY_GEN_MEMORY 2097152
|
||||
|
||||
|
@ -80,12 +82,15 @@ struct identityV0ProofOfWorkCriteria
|
|||
char *genmem;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define ZT_IDENTITY_V1_POW_MEMORY_SIZE 131072
|
||||
|
||||
struct p_CompareLittleEndian
|
||||
{
|
||||
#if __BYTE_ORDER == __BIG_ENDIAN
|
||||
ZT_INLINE bool operator()(const uint64_t a,const uint64_t b) const noexcept { return Utils::swapBytes(a) < Utils::swapBytes(b); }
|
||||
ZT_INLINE bool operator()(const uint64_t a,const uint64_t b) const noexcept
|
||||
{ return Utils::swapBytes(a) < Utils::swapBytes(b); }
|
||||
#else
|
||||
ZT_INLINE bool operator()(const uint64_t a, const uint64_t b) const noexcept
|
||||
{ return a < b; }
|
||||
|
@ -136,6 +141,8 @@ bool identityV1ProofOfWorkCriteria(const void *in, const unsigned int len, uint6
|
|||
return (Utils::ntoh(w[0]) % 1000U) == 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
const Identity Identity::NIL;
|
||||
|
|
Loading…
Add table
Reference in a new issue