summaryrefslogtreecommitdiff
path: root/node/Utils.hpp
diff options
context:
space:
mode:
authorGrant Limberg <glimberg@gmail.com>2015-07-07 19:24:02 -0700
committerGrant Limberg <glimberg@gmail.com>2015-07-07 19:24:02 -0700
commit1ad2cfeedfa2a9f4fc1f512e1009e5bb1b0630cb (patch)
treed8264c9bd4f6b9dce3f5237b94fe1f2fc521cf19 /node/Utils.hpp
parent6d398beefddb48d91f27e5f41bf39f40eb77222f (diff)
parent412389ec755528108e0254e75a9cf43fc53e331a (diff)
downloadinfinitytier-1ad2cfeedfa2a9f4fc1f512e1009e5bb1b0630cb.tar.gz
infinitytier-1ad2cfeedfa2a9f4fc1f512e1009e5bb1b0630cb.zip
Merge branch 'adamierymenko-dev' into android-jni
Diffstat (limited to 'node/Utils.hpp')
-rw-r--r--node/Utils.hpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/node/Utils.hpp b/node/Utils.hpp
index bd567cf5..70918eb5 100644
--- a/node/Utils.hpp
+++ b/node/Utils.hpp
@@ -60,20 +60,10 @@ public:
static inline bool secureEq(const void *a,const void *b,unsigned int len)
throw()
{
- const char *p1 = (const char *)a;
- const char *p2 = (const char *)b;
- uint64_t diff = 0;
-
- while (len >= 8) {
- diff |= (*((const uint64_t *)p1) ^ *((const uint64_t *)p2));
- p1 += 8;
- p2 += 8;
- len -= 8;
- }
- while (len--)
- diff |= (uint64_t)(*p1++ ^ *p2++);
-
- return (diff == 0ULL);
+ char diff = 0;
+ for(unsigned int i=0;i<len;++i)
+ diff |= ( (reinterpret_cast<const char *>(a))[i] ^ (reinterpret_cast<const char *>(b))[i] );
+ return (diff == 0);
}
/**