X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/b19bd5d6898f929de30e9110e011204a6c5622ad..63c236144bee1fb2a077f0b833945c94cb29865a:/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