X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/b19bd5d6898f929de30e9110e011204a6c5622ad..e72d1fbba2281c5868c3cf6b9a93b4faaf18c2a7:/client/nonce2key/crapto1.h diff --git a/client/nonce2key/crapto1.h b/client/nonce2key/crapto1.h index f6653124..7f834528 100644 --- a/client/nonce2key/crapto1.h +++ b/client/nonce2key/crapto1.h @@ -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