LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
Macros | Typedefs
tomcrypt_macros.h File Reference

Go to the source code of this file.

Macros

#define CONST64(n)   n ## ULL
 
#define BSWAP(x)
 
#define ROL(x, y)   ( (((unsigned long)(x)<<(unsigned long)((y)&31)) | (((unsigned long)(x)&0xFFFFFFFFUL)>>(unsigned long)(32-((y)&31)))) & 0xFFFFFFFFUL)
 
#define ROR(x, y)   ( ((((unsigned long)(x)&0xFFFFFFFFUL)>>(unsigned long)((y)&31)) | ((unsigned long)(x)<<(unsigned long)(32-((y)&31)))) & 0xFFFFFFFFUL)
 
#define ROLc(x, y)   ( (((unsigned long)(x)<<(unsigned long)((y)&31)) | (((unsigned long)(x)&0xFFFFFFFFUL)>>(unsigned long)(32-((y)&31)))) & 0xFFFFFFFFUL)
 
#define RORc(x, y)   ( ((((unsigned long)(x)&0xFFFFFFFFUL)>>(unsigned long)((y)&31)) | ((unsigned long)(x)<<(unsigned long)(32-((y)&31)))) & 0xFFFFFFFFUL)
 
#define ROL64(x, y)
 
#define ROR64(x, y)
 
#define ROL64c(x, y)
 
#define ROR64c(x, y)
 
#define MAX(x, y)   ( ((x)>(y))?(x):(y) )
 
#define MIN(x, y)   ( ((x)<(y))?(x):(y) )
 
#define byte(x, n)   (((x) >> (8 * (n))) & 255)
 

Typedefs

typedef unsigned long long ulong64
 
typedef unsigned long ulong32
 

Macro Definition Documentation

◆ BSWAP

#define BSWAP (   x)
Value:
( ((x>>24)&0x000000FFUL) | ((x<<24)&0xFF000000UL) | \
((x>>8)&0x0000FF00UL) | ((x<<8)&0x00FF0000UL) )

◆ byte

#define byte (   x,
 
)    (((x) >> (8 * (n))) & 255)

◆ CONST64

#define CONST64 (   n)    n ## ULL

◆ MAX

#define MAX (   x,
 
)    ( ((x)>(y))?(x):(y) )

◆ MIN

#define MIN (   x,
 
)    ( ((x)<(y))?(x):(y) )

◆ ROL

#define ROL (   x,
 
)    ( (((unsigned long)(x)<<(unsigned long)((y)&31)) | (((unsigned long)(x)&0xFFFFFFFFUL)>>(unsigned long)(32-((y)&31)))) & 0xFFFFFFFFUL)

◆ ROL64

#define ROL64 (   x,
 
)
Value:
( (((x)<<((ulong64)(y)&63)) | \
(((x)&CONST64(0xFFFFFFFFFFFFFFFF))>>((ulong64)64-((y)&63)))) & CONST64(0xFFFFFFFFFFFFFFFF))
#define CONST64(n)
Definition: tomcrypt_macros.h:6
unsigned long long ulong64
Definition: tomcrypt_macros.h:7

◆ ROL64c

#define ROL64c (   x,
 
)
Value:
( (((x)<<((ulong64)(y)&63)) | \
(((x)&CONST64(0xFFFFFFFFFFFFFFFF))>>((ulong64)64-((y)&63)))) & CONST64(0xFFFFFFFFFFFFFFFF))

◆ ROLc

#define ROLc (   x,
 
)    ( (((unsigned long)(x)<<(unsigned long)((y)&31)) | (((unsigned long)(x)&0xFFFFFFFFUL)>>(unsigned long)(32-((y)&31)))) & 0xFFFFFFFFUL)

◆ ROR

#define ROR (   x,
 
)    ( ((((unsigned long)(x)&0xFFFFFFFFUL)>>(unsigned long)((y)&31)) | ((unsigned long)(x)<<(unsigned long)(32-((y)&31)))) & 0xFFFFFFFFUL)

◆ ROR64

#define ROR64 (   x,
 
)
Value:
( ((((x)&CONST64(0xFFFFFFFFFFFFFFFF))>>((ulong64)(y)&CONST64(63))) | \
((x)<<((ulong64)(64-((y)&CONST64(63)))))) & CONST64(0xFFFFFFFFFFFFFFFF))

◆ ROR64c

#define ROR64c (   x,
 
)
Value:
( ((((x)&CONST64(0xFFFFFFFFFFFFFFFF))>>((ulong64)(y)&CONST64(63))) | \
((x)<<((ulong64)(64-((y)&CONST64(63)))))) & CONST64(0xFFFFFFFFFFFFFFFF))

◆ RORc

#define RORc (   x,
 
)    ( ((((unsigned long)(x)&0xFFFFFFFFUL)>>(unsigned long)((y)&31)) | ((unsigned long)(x)<<(unsigned long)(32-((y)&31)))) & 0xFFFFFFFFUL)

Typedef Documentation

◆ ulong32

typedef unsigned long ulong32

◆ ulong64

typedef unsigned long long ulong64