summaryrefslogtreecommitdiff
path: root/src/unit/blowfish.unit
diff options
context:
space:
mode:
Diffstat (limited to 'src/unit/blowfish.unit')
-rw-r--r--src/unit/blowfish.unit44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/unit/blowfish.unit b/src/unit/blowfish.unit
index abab63d..1b4ca18 100644
--- a/src/unit/blowfish.unit
+++ b/src/unit/blowfish.unit
@@ -50,29 +50,29 @@ static const char *testdat[34][3] ={
50 50
51suite Blowfish 51suite Blowfish
52{ 52{
53 test standard 53 test standard
54 { 54 {
55 for( int j = 0; j < 34; j++ ) 55 for( int j = 0; j < 34; j++ )
56 { 56 {
57 Bu::MemBuf mb; 57 Bu::MemBuf mb;
58 Bu::BlowfishEcb bf( mb ); 58 Bu::BlowfishEcb bf( mb );
59 bf.setPassword( Bu::decodeStr<Bu::Hex>( testdat[j][0] ) ); 59 bf.setPassword( Bu::decodeStr<Bu::Hex>( testdat[j][0] ) );
60 bf.write( Bu::decodeStr<Bu::Hex>( testdat[j][1] ) ); 60 bf.write( Bu::decodeStr<Bu::Hex>( testdat[j][1] ) );
61 unitTest( 61 unitTest(
62 mb.getString() == Bu::decodeStr<Bu::Hex>( testdat[j][2] ) 62 mb.getString() == Bu::decodeStr<Bu::Hex>( testdat[j][2] )
63 ); 63 );
64 64
65 mb.setPos( 0 ); 65 mb.setPos( 0 );
66 Bu::BlowfishEcb bf2( mb ); 66 Bu::BlowfishEcb bf2( mb );
67 bf2.setPassword( Bu::decodeStr<Bu::Hex>( testdat[j][0] ) ); 67 bf2.setPassword( Bu::decodeStr<Bu::Hex>( testdat[j][0] ) );
68 char buf[8]; 68 char buf[8];
69 bf2.read( buf, 8 ); 69 bf2.read( buf, 8 );
70 70
71 unitTest( 71 unitTest(
72 Bu::String(testdat[j][1]) == 72 Bu::String(testdat[j][1]) ==
73 Bu::encodeStr<Bu::Hex>(Bu::String(buf,8),true) 73 Bu::encodeStr<Bu::Hex>(Bu::String(buf,8),true)
74 ); 74 );
75 } 75 }
76 } 76 }
77} 77}
78 78