diff --git a/crypt.h b/crypt.h index ca7669498f..2048f76b1a 100644 --- a/crypt.h +++ b/crypt.h @@ -216,34 +216,13 @@ typedef union { #define CHUNKBITS (1< 0..63 */ - - /* Initial key schedule permutation */ - C_block PC1ROT[64/CHUNKBITS][1< final permutation table */ - C_block CF6464[64/CHUNKBITS][1< ascii-64 */ "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; +/* ===== Tables that are initialized at run time ==================== */ + +typedef struct { + /* table that converts chars "./0-9A-Za-z"to integers 0-63. */ + unsigned char a64toi[128]; + + /* Initial key schedule permutation */ + C_block PC1ROT[64/CHUNKBITS][1< final permutation table */ + C_block CF6464[64/CHUNKBITS][1<a64toi) +#define PC1ROT (des_tables->PC1ROT) +#define PC2ROT (des_tables->PC2ROT) +#define IE3264 (des_tables->IE3264) +#define SPE (des_tables->SPE) +#define CF6464 (des_tables->CF6464) -#define a64toi (data->a64toi) -#define PC1ROT (data->PC1ROT) -#define PC2ROT (data->PC2ROT) -#define IE3264 (data->IE3264) -#define SPE (data->SPE) -#define CF6464 (data->CF6464) #define KS (data->KS) -#define constdatablock (data->constdatablock) #define cryptresult (data->cryptresult) #define des_ready (data->initialized) -STATIC void init_des(struct crypt_data *); +STATIC void init_des(void); STATIC void init_perm(C_block perm[64/CHUNKBITS][1<ready) return; + /* * table that converts chars "./0-9A-Za-z"to integers 0-63. */ @@ -695,6 +728,8 @@ init_des(struct crypt_data *data) TO_SIX_BIT(SPE[1][tableno][j], k); } } + + des_tables->ready = 1; } /*