blowfish::core Namespace ReferenceLow-level utilities - for advanced users only. More...
Detailed DescriptionLow-level utilities - for advanced users only.
Function DocumentationStandard sixteen round deciphering of block using pad.
swapped L and R ! Definition at line 406 of file blowfish.cpp. 00407 { 00408 uint32 L = block.L; 00409 uint32 R = block.R; 00410 L ^= pad.P[17]; 00411 R ^= F(pad,L)^pad.P[16]; L ^= F(pad,R)^pad.P[15]; 00412 R ^= F(pad,L)^pad.P[14]; L ^= F(pad,R)^pad.P[13]; 00413 R ^= F(pad,L)^pad.P[12]; L ^= F(pad,R)^pad.P[11]; 00414 R ^= F(pad,L)^pad.P[10]; L ^= F(pad,R)^pad.P[9]; 00415 R ^= F(pad,L)^pad.P[8]; L ^= F(pad,R)^pad.P[7]; 00416 R ^= F(pad,L)^pad.P[6]; L ^= F(pad,R)^pad.P[5]; 00417 R ^= F(pad,L)^pad.P[4]; L ^= F(pad,R)^pad.P[3]; 00418 R ^= F(pad,L)^pad.P[2]; L ^= F(pad,R)^pad.P[1]; 00419 R ^= pad.P[0]; 00420 return Block( R, L ); //! swapped L and R ! 00421 }
Standard sixteen round enciphering of block using pad. Initial and final x-oring of the data ( = whitening ) helps prevent some attacks. swapping L and R one more time... ! Definition at line 387 of file blowfish.cpp. 00388 { 00389 uint32 L = block.L; 00390 uint32 R = block.R; 00391 L ^= pad.P[0]; 00392 R ^= F(pad,L)^pad.P[1]; L ^= F(pad,R)^pad.P[2]; 00393 R ^= F(pad,L)^pad.P[3]; L ^= F(pad,R)^pad.P[4]; 00394 R ^= F(pad,L)^pad.P[5]; L ^= F(pad,R)^pad.P[6]; 00395 R ^= F(pad,L)^pad.P[7]; L ^= F(pad,R)^pad.P[8]; 00396 R ^= F(pad,L)^pad.P[9]; L ^= F(pad,R)^pad.P[10]; 00397 R ^= F(pad,L)^pad.P[11]; L ^= F(pad,R)^pad.P[12]; 00398 R ^= F(pad,L)^pad.P[13]; L ^= F(pad,R)^pad.P[14]; 00399 R ^= F(pad,L)^pad.P[15]; L ^= F(pad,R)^pad.P[16]; 00400 R ^= pad.P[17]; 00401 return Block( R, L ); //! swapping L and R one more time... ! 00402 }
The base scrambling function of Blowfish, using the S boxes.
Definition at line 373 of file blowfish.cpp. 00374 { 00375 uint8 const a = uint8(u>>24); 00376 uint8 const b = uint8(u>>16); 00377 uint8 const c = uint8(u>> 8); 00378 uint8 const d = uint8(u ); 00379 00380 return ( ( pad.S[0][a] + pad.S[1][b] ) ^ pad.S[2][c] ) + pad.S[3][d]; 00381 }
Variable Documentationdefault pad based on the decimals of pi The standard initial pad used for Blowfish. This pad is made out of the decimals of PI (calculated in binary). The pad will be scrambled based on the provided password. Definition at line 27 of file blowfish.cpp.
|