]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/nonce2key/crapto1.h
FIX: Coverity, out-of-bounds read, 124 is less than (0x10*8)+2 (130)
[proxmark3-svn] / client / nonce2key / crapto1.h
index f6653124e67196219145d5ab0eb65bec34da1b2a..7f8345283772df27f9f37312efb6069eb992ac9f 100644 (file)
@@ -80,6 +80,12 @@ static inline int parity(uint32_t x)
        return x;
 #endif
 }
+
+#if !defined LOWMEM && defined __GNUC__
+extern uint8_t filterlut[1 << 20];
+#define filter(x) (filterlut[(x) & 0xfffff])
+#define filter_unsafe(x) (filterlut[x])
+#else
 static inline int filter(uint32_t const x)
 {
        uint32_t f;
@@ -91,6 +97,9 @@ static inline int filter(uint32_t const x)
        f |= 0x0d938 >> (x >> 16 & 0xf) &  1;
        return BIT(0xEC57E80A, f);
 }
+#define filter_unsafe(x) (filter(x))
+#endif
+
 #ifdef __cplusplus
 }
 #endif
Impressum, Datenschutz