func:  SMBNTencrypt(unsigned char *passwd, unsigned char *c8, unsigned char const struct nls_table *codepage) int rc ; unsigned char p16 [ 16 ] , p21 [ 21 ] ; memset ( p16 , '\0' , 16 ); memset ( p21 , '\0' , 21 ); rc = E_md4hash ( passwd , p16 , codepage );  E_md4hash(const unsigned char *passwd, unsigned char const struct nls_table *codepage) int rc ; int len ; __le16 wpwd [ 129 ] ; if ( passwd )  len = cifs_strtoUTF16 ( wpwd , passwd , 128 , codepage ); len = 0; * wpwd = 0; rc = mdfour ( p16 , ( unsigned char * ) wpwd , len * sizeof ( __le16 ) );  mdfour(unsigned char *md4_hash, unsigned char *link_str, int link_len) int rc ; unsigned int size ; struct crypto_shash * md4 ; struct sdesc * sdescmd4 ; md4 = crypto_alloc_shash ( "md4" , 0 , 0 ); if ( IS_ERR ( md4 ) )  rc = PTR_ERR ( md4 ); return rc ; size = sizeof ( struct shash_desc ) + crypto_shash_descsize ( md4 ); sdescmd4 = kmalloc ( size , GFP_KERNEL ); if ( ! sdescmd4 )  rc = - ENOMEM; sdescmd4 -> shash . tfm = md4; sdescmd4 -> shash . flags = 0x0; rc = crypto_shash_init ( & sdescmd4 -> shash ); if ( rc )  rc = crypto_shash_update ( & sdescmd4 -> shash , link_str , link_len ); if ( rc )  rc = crypto_shash_final ( & sdescmd4 -> shash , md4_hash ); return rc ; return rc ; if ( rc )  memcpy ( p21 , p16 , 16 ); rc = E_P24 ( p21 , c8 , p24 ); static E_P24(unsigned char *p21, const unsigned char *c8, unsigned char *p24) rc = smbhash ( p24 , c8 , p21 ); static smbhash(unsigned char *out, const unsigned char *in, unsigned char *key) str_to_key ( key , key2 ); static str_to_key(unsigned char *str, unsigned char *key) key [ 0 ] = str [ 0 ] >> 1; key [ 1 ] = ( ( str [ 0 ] & 0x01 ) << 6 ) | ( str [ 1 ] >> 2 ); key [ 2 ] = ( ( str [ 1 ] & 0x03 ) << 5 ) | ( str [ 2 ] >> 3 ); key [ 3 ] = ( ( str [ 2 ] & 0x07 ) << 4 ) | ( str [ 3 ] >> 4 ); key [ 4 ] = ( ( str [ 3 ] & 0x0F ) << 3 ) | ( str [ 4 ] >> 5 ); key [ 5 ] = ( ( str [ 4 ] & 0x1F ) << 2 ) | ( str [ 5 ] >> 6 ); key [ 6 ] = ( ( str [ 5 ] & 0x3F ) << 1 ) | ( str [ 6 ] >> 7 ); key [ 7 ] = str [ 6 ] & 0x7F; key [ i ] = ( key [ i ] << 1 ); sg_init_one ( & sgin , in , 8 ); sg_init_one ( & sgout , out , 8 ); if ( rc )  return rc ; rc = smbhash ( p24 + 8 , c8 , p21 + 7 ); static smbhash(unsigned char *out, const unsigned char *in, unsigned char *key) str_to_key ( key , key2 ); sg_init_one ( & sgin , in , 8 ); sg_init_one ( & sgout , out , 8 ); if ( rc )  return rc ; rc = smbhash ( p24 + 16 , c8 , p21 + 14 ); static smbhash(unsigned char *out, const unsigned char *in, unsigned char *key) str_to_key ( key , key2 ); sg_init_one ( & sgin , in , 8 ); sg_init_one ( & sgout , out , 8 ); return rc ; return rc ; 