stdlibs/libcrypt/inc/wsd_solution.h
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef EMULATOR
       
    21 #define EMULATOR ((defined(__WINS__) || defined(__WINSCW__)))
       
    22 #endif
       
    23 
       
    24 #if EMULATOR
       
    25 #include <sys/types.h>
       
    26 
       
    27 typedef struct TLibcryptWsd
       
    28 {
       
    29 	/* encrypt.cpp desKey */
       
    30 	unsigned char desKey[64];				// For persistence between calls 
       
    31 											// to setkey() and encrypt()
       
    32 	int bSetkeyInvoked;
       
    33 	/* encrypt.cpp desKey */
       
    34 	
       
    35 	/* crypt_md5() crypt-md5.c */
       
    36 	const char *sp, *ep;
       
    37 	char passwd[120], *p;
       
    38 	/* crypt_md5() crypt-md5.c */
       
    39 	
       
    40 	/* crypt-des.c */
       
    41 	u_int32_t	bits32[32];		/* Initialialize this array */
       
    42 	
       
    43 	u_char	inv_key_perm[64];   /* No specific initial values. However, initialize
       
    44 								 * the array to zero.
       
    45 								 */
       
    46 								 
       
    47 	u_char	inv_comp_perm[56];	/* No specific initial values. However, initialize
       
    48 								 * the array to zero.
       
    49 								 */
       
    50 	u_char	u_sbox[8][64];
       
    51 	
       
    52 	u_char	un_pbox[32];
       
    53 	
       
    54 	u_int32_t	saltbits;
       
    55 	u_int32_t	old_salt;
       
    56 	u_int32_t	*bits28, *bits24;
       
    57 	u_char		init_perm[64], final_perm[64];
       
    58 	u_int32_t	en_keysl[16], en_keysr[16];
       
    59 	u_int32_t	de_keysl[16], de_keysr[16];
       
    60 	int		des_initialised; /*  = 0 ... inportant */
       
    61 	
       
    62 	u_char      **m_sbox;   		// [4][4096]      bytes of dynamic storage
       
    63 	__uint32_t  **psbox;			// ([4][256] * 4) bytes of dynamic storage
       
    64 
       
    65 	__uint32_t	**ip_maskl,		    // ([8][256] * 4) bytes of dynamic storage
       
    66 			    **ip_maskr;    		// ([8][256] * 4) bytes of dynamic storage
       
    67 
       
    68 	__uint32_t	**fp_maskl,			// ([8][256] * 4) bytes of dynamic storage
       
    69 			    **fp_maskr;			// ([8][256] * 4) bytes of dynamic storage
       
    70 
       
    71 	__uint32_t	**key_perm_maskl,	// ([8][128] * 4) bytes of dynamic storage
       
    72 			    **key_perm_maskr;	// ([8][128] * 4) bytes of dynamic storage
       
    73 
       
    74 	__uint32_t	**comp_maskl,		// ([8][128] * 4) bytes of dynamic storage
       
    75 			    **comp_maskr;		// ([8][128] * 4) bytes of dynamic storage
       
    76 
       
    77 	u_int32_t	old_rawkey0, old_rawkey1;	/* initialize this to zero */
       
    78 	
       
    79 	char	output[21];
       
    80 	/* crypt-des.c */
       
    81 	
       
    82 }TLibcryptWsd;
       
    83 
       
    84 #ifdef __cplusplus
       
    85 extern "C" TLibcryptWsd *GetGlobals();
       
    86 #else
       
    87 TLibcryptWsd *GetGlobals();
       
    88 #endif	/* End __cplusplus */
       
    89 
       
    90 #endif