lib/md4.c

ソースコードを見る。

関数

static uint32 F (uint32 X, uint32 Y, uint32 Z)
static uint32 G (uint32 X, uint32 Y, uint32 Z)
static uint32 H (uint32 X, uint32 Y, uint32 Z)
static uint32 lshift (uint32 x, int s)
static void mdfour64 (uint32 *M)
static void copy64 (uint32 *M, const unsigned char *in)
static void copy4 (unsigned char *out, uint32 x)
void mdfour (unsigned char *out, const unsigned char *in, int n)

変数

static uint32 A
static uint32 B
static uint32 C
static uint32 D


関数

static uint32 F ( uint32  X,
uint32  Y,
uint32  Z 
) [static]

md4.c30 行で定義されています。

参照元 sys_get_xfs_quota()sys_set_xfs_quota().

00031 {
00032         return (X&Y) | ((~X)&Z);
00033 }

static uint32 G ( uint32  X,
uint32  Y,
uint32  Z 
) [static]

md4.c35 行で定義されています。

00036 {
00037         return (X&Y) | (X&Z) | (Y&Z); 
00038 }

static uint32 H ( uint32  X,
uint32  Y,
uint32  Z 
) [static]

md4.c40 行で定義されています。

00041 {
00042         return X^Y^Z;
00043 }

static uint32 lshift ( uint32  x,
int  s 
) [static]

md4.c45 行で定義されています。

参照元 dohash().

00046 {
00047         x &= 0xFFFFFFFF;
00048         return ((x<<s)&0xFFFFFFFF) | (x>>(32-s));
00049 }

static void mdfour64 ( uint32 *  M  )  [static]

md4.c56 行で定義されています。

参照先 ABCD.

参照元 mdfour().

00057 {
00058         int j;
00059         uint32 AA, BB, CC, DD;
00060         uint32 X[16];
00061 
00062         for (j=0;j<16;j++)
00063                 X[j] = M[j];
00064 
00065         AA = A; BB = B; CC = C; DD = D;
00066 
00067         ROUND1(A,B,C,D,  0,  3);  ROUND1(D,A,B,C,  1,  7);  
00068         ROUND1(C,D,A,B,  2, 11);  ROUND1(B,C,D,A,  3, 19);
00069         ROUND1(A,B,C,D,  4,  3);  ROUND1(D,A,B,C,  5,  7);  
00070         ROUND1(C,D,A,B,  6, 11);  ROUND1(B,C,D,A,  7, 19);
00071         ROUND1(A,B,C,D,  8,  3);  ROUND1(D,A,B,C,  9,  7);  
00072         ROUND1(C,D,A,B, 10, 11);  ROUND1(B,C,D,A, 11, 19);
00073         ROUND1(A,B,C,D, 12,  3);  ROUND1(D,A,B,C, 13,  7);  
00074         ROUND1(C,D,A,B, 14, 11);  ROUND1(B,C,D,A, 15, 19);      
00075 
00076         ROUND2(A,B,C,D,  0,  3);  ROUND2(D,A,B,C,  4,  5);  
00077         ROUND2(C,D,A,B,  8,  9);  ROUND2(B,C,D,A, 12, 13);
00078         ROUND2(A,B,C,D,  1,  3);  ROUND2(D,A,B,C,  5,  5);  
00079         ROUND2(C,D,A,B,  9,  9);  ROUND2(B,C,D,A, 13, 13);
00080         ROUND2(A,B,C,D,  2,  3);  ROUND2(D,A,B,C,  6,  5);  
00081         ROUND2(C,D,A,B, 10,  9);  ROUND2(B,C,D,A, 14, 13);
00082         ROUND2(A,B,C,D,  3,  3);  ROUND2(D,A,B,C,  7,  5);  
00083         ROUND2(C,D,A,B, 11,  9);  ROUND2(B,C,D,A, 15, 13);
00084 
00085         ROUND3(A,B,C,D,  0,  3);  ROUND3(D,A,B,C,  8,  9);  
00086         ROUND3(C,D,A,B,  4, 11);  ROUND3(B,C,D,A, 12, 15);
00087         ROUND3(A,B,C,D,  2,  3);  ROUND3(D,A,B,C, 10,  9);  
00088         ROUND3(C,D,A,B,  6, 11);  ROUND3(B,C,D,A, 14, 15);
00089         ROUND3(A,B,C,D,  1,  3);  ROUND3(D,A,B,C,  9,  9);  
00090         ROUND3(C,D,A,B,  5, 11);  ROUND3(B,C,D,A, 13, 15);
00091         ROUND3(A,B,C,D,  3,  3);  ROUND3(D,A,B,C, 11,  9);  
00092         ROUND3(C,D,A,B,  7, 11);  ROUND3(B,C,D,A, 15, 15);
00093 
00094         A += AA; B += BB; C += CC; D += DD;
00095         
00096         A &= 0xFFFFFFFF; B &= 0xFFFFFFFF;
00097         C &= 0xFFFFFFFF; D &= 0xFFFFFFFF;
00098 
00099         for (j=0;j<16;j++)
00100                 X[j] = 0;
00101 }

static void copy64 ( uint32 *  M,
const unsigned char *  in 
) [static]

md4.c103 行で定義されています。

参照元 mdfour().

00104 {
00105         int i;
00106 
00107         for (i=0;i<16;i++)
00108                 M[i] = (in[i*4+3]<<24) | (in[i*4+2]<<16) |
00109                         (in[i*4+1]<<8) | (in[i*4+0]<<0);
00110 }

static void copy4 ( unsigned char *  out,
uint32  x 
) [static]

md4.c112 行で定義されています。

参照元 mdfour().

00113 {
00114         out[0] = x&0xFF;
00115         out[1] = (x>>8)&0xFF;
00116         out[2] = (x>>16)&0xFF;
00117         out[3] = (x>>24)&0xFF;
00118 }

void mdfour ( unsigned char *  out,
const unsigned char *  in,
int  n 
)

md4.c121 行で定義されています。

参照先 ABbufCcopy4()copy64()Dmdfour64().

参照元 decrypt_trustdom_secret()do_filehash()do_reseed()E_md4hash()generate_random_buffer()ntlm_password_check()SMBsesskeygen_ntv1().

00122 {
00123         unsigned char buf[128];
00124         uint32 M[16];
00125         uint32 b = n * 8;
00126         int i;
00127 
00128         A = 0x67452301;
00129         B = 0xefcdab89;
00130         C = 0x98badcfe;
00131         D = 0x10325476;
00132 
00133         while (n > 64) {
00134                 copy64(M, in);
00135                 mdfour64(M);
00136                 in += 64;
00137                 n -= 64;
00138         }
00139 
00140         for (i=0;i<128;i++)
00141                 buf[i] = 0;
00142         memcpy(buf, in, n);
00143         buf[n] = 0x80;
00144         
00145         if (n <= 55) {
00146                 copy4(buf+56, b);
00147                 copy64(M, buf);
00148                 mdfour64(M);
00149         } else {
00150                 copy4(buf+120, b); 
00151                 copy64(M, buf);
00152                 mdfour64(M);
00153                 copy64(M, buf+64);
00154                 mdfour64(M);
00155         }
00156 
00157         for (i=0;i<128;i++)
00158                 buf[i] = 0;
00159         copy64(M, buf);
00160 
00161         copy4(out, A);
00162         copy4(out+4, B);
00163         copy4(out+8, C);
00164         copy4(out+12, D);
00165 
00166         A = B = C = D = 0;
00167 }


変数

uint32 A [static]

md4.c28 行で定義されています。

参照元 mdfour()mdfour64().

uint32 B [static]

md4.c28 行で定義されています。

参照元 mdfour()mdfour64().

uint32 C [static]

md4.c28 行で定義されています。

参照元 mdfour()mdfour64().

uint32 D [static]

md4.c28 行で定義されています。

参照元 disk_quotas()get_smb_linux_gen_quota()get_smb_linux_v1_quota()get_smb_linux_v2_quota()get_smb_linux_xfs_quota()mdfour()mdfour64()sys_get_linux_gen_quota()sys_get_linux_v1_quota()sys_get_linux_v2_quota()sys_get_xfs_quota()sys_set_linux_gen_quota()sys_set_linux_v1_quota()sys_set_linux_v2_quota()sys_set_xfs_quota()vfs_get_ntquota()vfs_set_ntquota().


Sambaに対してSat Aug 29 21:23:36 2009に生成されました。  doxygen 1.4.7