Submitters: Bruce Schneier, Counterpane Systems Doug Whiting, Hi/fn John Kelsey, Counterpane Systems Chris Hall, Counterpane Systems David Wagner, UC Berkeley
Code Author: Doug Whiting, Hi/fn
Version 1.00 April 1998
Copyright 1998, Hi/fn and Counterpane Systems. All rights reserved.
Notes: Tab size is set to 4 characters in this file
Definition in file thig_platform.h.
Go to the source code of this file.
Defines | |
| #define | ROL(x, n) (((x) << ((n) & 0x1F)) | ((x) >> (32-((n) & 0x1F)))) |
| use intrinsic rotate if possible | |
| #define | ROR(x, n) (((x) >> ((n) & 0x1F)) | ((x) << (32-((n) & 0x1F)))) |
| non-Intel platforms | |
| #define | LittleEndian 0 |
| (assume big endian | |
| #define | ALIGN32 1 |
| (assume need alignment for non-Intel) | |
| #define | Bswap(x) ((ROR(x,8) & 0xFF00FF00) | (ROL(x,8) & 0x00FF00FF)) |
| #define | ADDR_XOR 3 |
| convert byte address in dword | |
| #define | _b(x, N) (((BYTE *)&x)[((N) & 3) ^ ADDR_XOR]) |
| Macros for extracting bytes from dwords (correct for endianness). | |
| #define | b0(x) _b(x,0) |
| extract LSB of DWORD | |
| #define | b1(x) _b(x,1) |
| #define | b2(x) _b(x,2) |
| #define | b3(x) _b(x,3) |
| extract MSB of DWORD | |
| #define ROL | ( | x, | |||
| n | ) | (((x) << ((n) & 0x1F)) | ((x) >> (32-((n) & 0x1F)))) |
use intrinsic rotate if possible
Definition at line 72 of file thig_platform.h.
Referenced by blockDecrypt(), blockEncrypt(), and reKey().
| #define ROR | ( | x, | |||
| n | ) | (((x) >> ((n) & 0x1F)) | ((x) << (32-((n) & 0x1F)))) |
non-Intel platforms
Definition at line 73 of file thig_platform.h.
Referenced by blockDecrypt(), and blockEncrypt().
| #define LittleEndian 0 |
| #define ALIGN32 1 |
| #define Bswap | ( | x | ) | ((ROR(x,8) & 0xFF00FF00) | (ROL(x,8) & 0x00FF00FF)) |
Definition at line 144 of file thig_platform.h.
Referenced by blockDecrypt(), blockEncrypt(), cipherInit(), and f32().
| #define ADDR_XOR 3 |
convert byte address in dword
Definition at line 145 of file thig_platform.h.
Referenced by ParseHexDword().
| #define _b | ( | x, | |||
| N | ) | (((BYTE *)&x)[((N) & 3) ^ ADDR_XOR]) |
Macros for extracting bytes from dwords (correct for endianness).
Definition at line 149 of file thig_platform.h.
| #define b0 | ( | x | ) | _b(x,0) |
| #define b1 | ( | x | ) | _b(x,1) |
| #define b2 | ( | x | ) | _b(x,2) |
| #define b3 | ( | x | ) | _b(x,3) |
1.5.2