Hi, I am currently porting some code from C++ to C# but I found something (the syntax) i have never seen before so I don't know what to do.
Below is part of the original source code.
The 3 lines I marked is the part that I don't understand.
MakeH1, f and DissH1 are actually three functions.
Can somebody tell me what these lines mean?
void F8_Encrypt( unsigned char *Plain, unsigned char *Cipher )
{
HalfWord L, R, NewR ;
int r ;
HalfWord MakeH1( unsigned char * ); // <<<<<<
HalfWord f( HalfWord, QuarterWord ); // <<<<<<
void DissH1( HalfWord, unsigned char * ); // <<<<<<
L = MakeH1( Plain ) ;
R = MakeH1( Plain+4 ) ;
L ^= K89 ;
R ^= K1011 ;
R ^= L ;
for ( r = 0 ; r < 8 ; ++r )
{
NewR = L ^ f( R, K[r] ) ;
L = R ;
R = NewR ;
}
L ^= R ;
R ^= K1213 ;
L ^= K1415 ;
DissH1( R, Cipher ) ;
DissH1( L, Cipher + 4 ) ;
}
Body of one of the methods:
/*
* Disassemble the given halfword into 4 bytes.
*/
static void DissH1( HalfWord H, unsigned char *D )
{
union {
HalfWord All ;
unsigned char Byte[4] ;
} T ;
T.All = H ;
*D++ = T.Byte[0] ;
*D++ = T.Byte[1] ;
*D++ = T.Byte[2] ;
*D = T.Byte[3] ;
}
[Edited by - fantasyz on January 3, 2008 11:18:33 PM]