1*87d2adbcSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*87d2adbcSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*87d2adbcSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*87d2adbcSAndrew Rist * distributed with this work for additional information 6*87d2adbcSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*87d2adbcSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*87d2adbcSAndrew Rist * "License"); you may not use this file except in compliance 9*87d2adbcSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*87d2adbcSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*87d2adbcSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*87d2adbcSAndrew Rist * software distributed under the License is distributed on an 15*87d2adbcSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*87d2adbcSAndrew Rist * KIND, either express or implied. See the License for the 17*87d2adbcSAndrew Rist * specific language governing permissions and limitations 18*87d2adbcSAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*87d2adbcSAndrew Rist *************************************************************/ 21*87d2adbcSAndrew Rist 22*87d2adbcSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir 25cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 26cdf0e10cSrcweir #include "precompiled_sal.hxx" 27cdf0e10cSrcweir 28cdf0e10cSrcweir #include <testshl/simpleheader.hxx> 29cdf0e10cSrcweir #include <rtl/strbuf.hxx> 30cdf0e10cSrcweir #include <rtl/cipher.h> 31cdf0e10cSrcweir 32cdf0e10cSrcweir // ----------------------------------------------------------------------------- 33cdf0e10cSrcweir namespace rtl_cipher 34cdf0e10cSrcweir { 35cdf0e10cSrcweir 36cdf0e10cSrcweir rtl::OString createHex(sal_uInt8 *_pKeyBuffer, sal_uInt32 _nKeyLen) 37cdf0e10cSrcweir { 38cdf0e10cSrcweir // Create hex-value string from the value to keep the string size minimal 39cdf0e10cSrcweir rtl::OStringBuffer aBuffer( _nKeyLen * 2 + 1 ); 40cdf0e10cSrcweir for ( sal_uInt32 i = 0; i < _nKeyLen; i++ ) 41cdf0e10cSrcweir { 42cdf0e10cSrcweir sal_Int32 nValue = (sal_Int32)_pKeyBuffer[i]; 43cdf0e10cSrcweir if (nValue < 16) // maximul hex value for 1 byte 44cdf0e10cSrcweir { 45cdf0e10cSrcweir aBuffer.append( sal_Int32(0), 16 /* radix */ ); 46cdf0e10cSrcweir } 47cdf0e10cSrcweir aBuffer.append( nValue, 16 /* radix */ ); 48cdf0e10cSrcweir } 49cdf0e10cSrcweir 50cdf0e10cSrcweir return aBuffer.makeStringAndClear(); 51cdf0e10cSrcweir } 52cdf0e10cSrcweir 53cdf0e10cSrcweir // ----------------------------------------------------------------------------- 54cdf0e10cSrcweir 55cdf0e10cSrcweir class create : public CppUnit::TestFixture 56cdf0e10cSrcweir { 57cdf0e10cSrcweir public: 58cdf0e10cSrcweir // initialise your test code values here. 59cdf0e10cSrcweir void setUp() 60cdf0e10cSrcweir { 61cdf0e10cSrcweir } 62cdf0e10cSrcweir 63cdf0e10cSrcweir void tearDown() 64cdf0e10cSrcweir { 65cdf0e10cSrcweir } 66cdf0e10cSrcweir 67cdf0e10cSrcweir void create_001() 68cdf0e10cSrcweir { 69cdf0e10cSrcweir rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeECB); 70cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL); 71cdf0e10cSrcweir rtl_cipher_destroy(aCipher); 72cdf0e10cSrcweir } 73cdf0e10cSrcweir void create_002() 74cdf0e10cSrcweir { 75cdf0e10cSrcweir rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmInvalid, rtl_Cipher_ModeECB); 76cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == NULL); 77cdf0e10cSrcweir } 78cdf0e10cSrcweir void create_003() 79cdf0e10cSrcweir { 80cdf0e10cSrcweir rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeCBC); 81cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL); 82cdf0e10cSrcweir rtl_cipher_destroy(aCipher); 83cdf0e10cSrcweir } 84cdf0e10cSrcweir void create_004() 85cdf0e10cSrcweir { 86cdf0e10cSrcweir rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmInvalid, rtl_Cipher_ModeCBC); 87cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == NULL); 88cdf0e10cSrcweir } 89cdf0e10cSrcweir void create_005() 90cdf0e10cSrcweir { 91cdf0e10cSrcweir rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeStream); 92cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL); 93cdf0e10cSrcweir rtl_cipher_destroy(aCipher); 94cdf0e10cSrcweir } 95cdf0e10cSrcweir void create_006() 96cdf0e10cSrcweir { 97cdf0e10cSrcweir rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmInvalid, rtl_Cipher_ModeStream); 98cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == NULL); 99cdf0e10cSrcweir } 100cdf0e10cSrcweir void create_007() 101cdf0e10cSrcweir { 102cdf0e10cSrcweir rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeInvalid); 103cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == NULL); 104cdf0e10cSrcweir } 105cdf0e10cSrcweir void create_008() 106cdf0e10cSrcweir { 107cdf0e10cSrcweir rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmInvalid, rtl_Cipher_ModeInvalid); 108cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == NULL); 109cdf0e10cSrcweir } 110cdf0e10cSrcweir 111cdf0e10cSrcweir // Change the following lines only, if you add, remove or rename 112cdf0e10cSrcweir // member functions of the current class, 113cdf0e10cSrcweir // because these macros are need by auto register mechanism. 114cdf0e10cSrcweir 115cdf0e10cSrcweir CPPUNIT_TEST_SUITE(create); 116cdf0e10cSrcweir CPPUNIT_TEST(create_001); 117cdf0e10cSrcweir CPPUNIT_TEST(create_002); 118cdf0e10cSrcweir CPPUNIT_TEST(create_003); 119cdf0e10cSrcweir CPPUNIT_TEST(create_004); 120cdf0e10cSrcweir CPPUNIT_TEST(create_005); 121cdf0e10cSrcweir CPPUNIT_TEST(create_006); 122cdf0e10cSrcweir CPPUNIT_TEST(create_007); 123cdf0e10cSrcweir CPPUNIT_TEST(create_008); 124cdf0e10cSrcweir CPPUNIT_TEST_SUITE_END(); 125cdf0e10cSrcweir }; // class create 126cdf0e10cSrcweir 127cdf0e10cSrcweir // ----------------------------------------------------------------------------- 128cdf0e10cSrcweir class createBF : public CppUnit::TestFixture 129cdf0e10cSrcweir { 130cdf0e10cSrcweir public: 131cdf0e10cSrcweir // initialise your test code values here. 132cdf0e10cSrcweir void setUp() 133cdf0e10cSrcweir { 134cdf0e10cSrcweir } 135cdf0e10cSrcweir 136cdf0e10cSrcweir void tearDown() 137cdf0e10cSrcweir { 138cdf0e10cSrcweir } 139cdf0e10cSrcweir 140cdf0e10cSrcweir void createBF_001() 141cdf0e10cSrcweir { 142cdf0e10cSrcweir rtlCipher aCipher = rtl_cipher_createBF(rtl_Cipher_ModeECB); 143cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL); 144cdf0e10cSrcweir rtl_cipher_destroy(aCipher); 145cdf0e10cSrcweir } 146cdf0e10cSrcweir void createBF_002() 147cdf0e10cSrcweir { 148cdf0e10cSrcweir rtlCipher aCipher = rtl_cipher_createBF(rtl_Cipher_ModeCBC); 149cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL); 150cdf0e10cSrcweir rtl_cipher_destroy(aCipher); 151cdf0e10cSrcweir } 152cdf0e10cSrcweir void createBF_003() 153cdf0e10cSrcweir { 154cdf0e10cSrcweir rtlCipher aCipher = rtl_cipher_createBF(rtl_Cipher_ModeStream); 155cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL); 156cdf0e10cSrcweir rtl_cipher_destroy(aCipher); 157cdf0e10cSrcweir } 158cdf0e10cSrcweir void createBF_004() 159cdf0e10cSrcweir { 160cdf0e10cSrcweir rtlCipher aCipher = rtl_cipher_createBF(rtl_Cipher_ModeInvalid); 161cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("create provide wrong object.", aCipher == NULL); 162cdf0e10cSrcweir // rtl_cipher_destroy(aCipher); 163cdf0e10cSrcweir } 164cdf0e10cSrcweir // Change the following lines only, if you add, remove or rename 165cdf0e10cSrcweir // member functions of the current class, 166cdf0e10cSrcweir // because these macros are need by auto register mechanism. 167cdf0e10cSrcweir 168cdf0e10cSrcweir CPPUNIT_TEST_SUITE(createBF); 169cdf0e10cSrcweir CPPUNIT_TEST(createBF_001); 170cdf0e10cSrcweir CPPUNIT_TEST(createBF_002); 171cdf0e10cSrcweir CPPUNIT_TEST(createBF_003); 172cdf0e10cSrcweir CPPUNIT_TEST(createBF_004); 173cdf0e10cSrcweir CPPUNIT_TEST_SUITE_END(); 174cdf0e10cSrcweir }; // class createBF 175cdf0e10cSrcweir // ----------------------------------------------------------------------------- 176cdf0e10cSrcweir class decode : public CppUnit::TestFixture 177cdf0e10cSrcweir { 178cdf0e10cSrcweir public: 179cdf0e10cSrcweir // initialise your test code values here. 180cdf0e10cSrcweir void setUp() 181cdf0e10cSrcweir { 182cdf0e10cSrcweir } 183cdf0e10cSrcweir 184cdf0e10cSrcweir void tearDown() 185cdf0e10cSrcweir { 186cdf0e10cSrcweir } 187cdf0e10cSrcweir 188cdf0e10cSrcweir void test_encode(sal_uInt8 _nKeyValue, sal_uInt8 _nArgValue, rtl::OString const& _sPlainTextStr) 189cdf0e10cSrcweir { 190cdf0e10cSrcweir rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeECB); 191cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL); 192cdf0e10cSrcweir 193cdf0e10cSrcweir sal_uInt32 nKeyLen = 16; 194cdf0e10cSrcweir sal_uInt8 *pKeyBuffer = new sal_uInt8[ nKeyLen ]; 195cdf0e10cSrcweir memset(pKeyBuffer, 0, nKeyLen); 196cdf0e10cSrcweir pKeyBuffer[0] = _nKeyValue; 197cdf0e10cSrcweir 198cdf0e10cSrcweir sal_uInt32 nArgLen = 16; 199cdf0e10cSrcweir sal_uInt8 *pArgBuffer = new sal_uInt8[ nArgLen ]; 200cdf0e10cSrcweir memset(pArgBuffer, 0, nArgLen); 201cdf0e10cSrcweir pArgBuffer[0] = _nArgValue; 202cdf0e10cSrcweir 203cdf0e10cSrcweir t_print(T_VERBOSE, " init Key: %s\n", createHex(pKeyBuffer, nKeyLen).getStr()); 204cdf0e10cSrcweir t_print(T_VERBOSE, " init Arg: %s\n", createHex(pArgBuffer, nArgLen).getStr()); 205cdf0e10cSrcweir 206cdf0e10cSrcweir rtlCipherError aError = rtl_cipher_init(aCipher, rtl_Cipher_DirectionEncode, pKeyBuffer, nKeyLen, pArgBuffer, nArgLen); 207cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("wrong init", aError == rtl_Cipher_E_None); 208cdf0e10cSrcweir 209cdf0e10cSrcweir sal_uInt32 nPlainTextLen = 16; 210cdf0e10cSrcweir sal_uInt8 *pPlainTextBuffer = new sal_uInt8[ nPlainTextLen ]; 211cdf0e10cSrcweir memset(pPlainTextBuffer, 0, nPlainTextLen); 212cdf0e10cSrcweir strncpy((char*)pPlainTextBuffer, _sPlainTextStr.getStr(), 16); 213cdf0e10cSrcweir 214cdf0e10cSrcweir sal_uInt32 nCipherLen = 16; 215cdf0e10cSrcweir sal_uInt8 *pCipherBuffer = new sal_uInt8[ nCipherLen ]; 216cdf0e10cSrcweir memset(pCipherBuffer, 0, nCipherLen); 217cdf0e10cSrcweir 218cdf0e10cSrcweir /* rtlCipherError */ aError = rtl_cipher_encode(aCipher, pPlainTextBuffer, nPlainTextLen, pCipherBuffer, nCipherLen); 219cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("wrong encode", aError == rtl_Cipher_E_None); 220cdf0e10cSrcweir 221cdf0e10cSrcweir t_print(T_VERBOSE, " Key: %s\n", createHex(pKeyBuffer, nKeyLen).getStr()); 222cdf0e10cSrcweir t_print(T_VERBOSE, " Arg: %s\n", createHex(pArgBuffer, nArgLen).getStr()); 223cdf0e10cSrcweir t_print(T_VERBOSE, " Plain: %s\n", createHex(pPlainTextBuffer, nPlainTextLen).getStr()); 224cdf0e10cSrcweir t_print( "Cipher Buf: %s\n", createHex(pCipherBuffer, nCipherLen).getStr()); 225cdf0e10cSrcweir 226cdf0e10cSrcweir sal_uInt32 nPlainText2Len = 16; 227cdf0e10cSrcweir sal_uInt8 *pPlainText2Buffer = new sal_uInt8[ nPlainText2Len ]; 228cdf0e10cSrcweir memset(pPlainText2Buffer, 0, nPlainText2Len); 229cdf0e10cSrcweir 230cdf0e10cSrcweir /* rtlCipherError */ aError = rtl_cipher_decode(aCipher, pCipherBuffer, nCipherLen, pPlainText2Buffer, nPlainText2Len); 231cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("decode should not work", aError != rtl_Cipher_E_None); 232cdf0e10cSrcweir 233cdf0e10cSrcweir // rtl::OString sPlainText2Str((char*)pPlainText2Buffer, nPlainText2Len); 234cdf0e10cSrcweir // t_print(T_VERBOSE, " Plain: %s\n", createHex(pPlainText2Buffer, nPlainText2Len).getStr()); 235cdf0e10cSrcweir // t_print(T_VERBOSE, " ascii: %s\n", sPlainText2Str.getStr()); 236cdf0e10cSrcweir // 237cdf0e10cSrcweir // // t_print(" Buf: %s\n", createHex(pCipherBuffer, nCipherLen).getStr()); 238cdf0e10cSrcweir // 239cdf0e10cSrcweir // sal_Int32 nCompare = memcmp(pPlainTextBuffer, pPlainText2Buffer, 16); 240cdf0e10cSrcweir // 241cdf0e10cSrcweir // CPPUNIT_ASSERT_MESSAGE("compare between plain and decoded plain failed", nCompare == 0); 242cdf0e10cSrcweir // 243cdf0e10cSrcweir // delete [] pPlainText2Buffer; 244cdf0e10cSrcweir // 245cdf0e10cSrcweir // delete [] pCipherBuffer; 246cdf0e10cSrcweir // delete [] pPlainTextBuffer; 247cdf0e10cSrcweir // 248cdf0e10cSrcweir // delete [] pArgBuffer; 249cdf0e10cSrcweir // delete [] pKeyBuffer; 250cdf0e10cSrcweir // 251cdf0e10cSrcweir // rtl_cipher_destroy(aCipher); 252cdf0e10cSrcweir } 253cdf0e10cSrcweir 254cdf0e10cSrcweir void test_encode_and_decode(sal_uInt8 _nKeyValue, sal_uInt8 _nArgValue, rtl::OString const& _sPlainTextStr) 255cdf0e10cSrcweir { 256cdf0e10cSrcweir rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeECB); 257cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL); 258cdf0e10cSrcweir 259cdf0e10cSrcweir sal_uInt32 nKeyLen = 16; 260cdf0e10cSrcweir sal_uInt8 *pKeyBuffer = new sal_uInt8[ nKeyLen ]; 261cdf0e10cSrcweir memset(pKeyBuffer, 0, nKeyLen); 262cdf0e10cSrcweir pKeyBuffer[0] = _nKeyValue; 263cdf0e10cSrcweir 264cdf0e10cSrcweir sal_uInt32 nArgLen = 16; 265cdf0e10cSrcweir sal_uInt8 *pArgBuffer = new sal_uInt8[ nArgLen ]; 266cdf0e10cSrcweir memset(pArgBuffer, 0, nArgLen); 267cdf0e10cSrcweir pArgBuffer[0] = _nArgValue; 268cdf0e10cSrcweir 269cdf0e10cSrcweir t_print(T_VERBOSE, " init Key: %s\n", createHex(pKeyBuffer, nKeyLen).getStr()); 270cdf0e10cSrcweir t_print(T_VERBOSE, " init Arg: %s\n", createHex(pArgBuffer, nArgLen).getStr()); 271cdf0e10cSrcweir 272cdf0e10cSrcweir rtlCipherError aError = rtl_cipher_init(aCipher, rtl_Cipher_DirectionBoth, pKeyBuffer, nKeyLen, pArgBuffer, nArgLen); 273cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("wrong init", aError == rtl_Cipher_E_None); 274cdf0e10cSrcweir 275cdf0e10cSrcweir sal_uInt32 nPlainTextLen = 16; 276cdf0e10cSrcweir sal_uInt8 *pPlainTextBuffer = new sal_uInt8[ nPlainTextLen ]; 277cdf0e10cSrcweir memset(pPlainTextBuffer, 0, nPlainTextLen); 278cdf0e10cSrcweir strncpy((char*)pPlainTextBuffer, _sPlainTextStr.getStr(), 16); 279cdf0e10cSrcweir 280cdf0e10cSrcweir sal_uInt32 nCipherLen = 16; 281cdf0e10cSrcweir sal_uInt8 *pCipherBuffer = new sal_uInt8[ nCipherLen ]; 282cdf0e10cSrcweir memset(pCipherBuffer, 0, nCipherLen); 283cdf0e10cSrcweir 284cdf0e10cSrcweir /* rtlCipherError */ aError = rtl_cipher_encode(aCipher, pPlainTextBuffer, nPlainTextLen, pCipherBuffer, nCipherLen); 285cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("wrong encode", aError == rtl_Cipher_E_None); 286cdf0e10cSrcweir 287cdf0e10cSrcweir t_print(T_VERBOSE, " Key: %s\n", createHex(pKeyBuffer, nKeyLen).getStr()); 288cdf0e10cSrcweir t_print(T_VERBOSE, " Arg: %s\n", createHex(pArgBuffer, nArgLen).getStr()); 289cdf0e10cSrcweir t_print(T_VERBOSE, " Plain: %s\n", createHex(pPlainTextBuffer, nPlainTextLen).getStr()); 290cdf0e10cSrcweir t_print( "Cipher Buf: %s\n", createHex(pCipherBuffer, nCipherLen).getStr()); 291cdf0e10cSrcweir 292cdf0e10cSrcweir sal_uInt32 nPlainText2Len = 16; 293cdf0e10cSrcweir sal_uInt8 *pPlainText2Buffer = new sal_uInt8[ nPlainText2Len ]; 294cdf0e10cSrcweir memset(pPlainText2Buffer, 0, nPlainText2Len); 295cdf0e10cSrcweir 296cdf0e10cSrcweir /* rtlCipherError */ aError = rtl_cipher_decode(aCipher, pCipherBuffer, nCipherLen, pPlainText2Buffer, nPlainText2Len); 297cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("wrong decode", aError == rtl_Cipher_E_None); 298cdf0e10cSrcweir 299cdf0e10cSrcweir rtl::OString sPlainText2Str((char*)pPlainText2Buffer, nPlainText2Len); 300cdf0e10cSrcweir t_print(T_VERBOSE, " Plain: %s\n", createHex(pPlainText2Buffer, nPlainText2Len).getStr()); 301cdf0e10cSrcweir t_print(T_VERBOSE, " as ascii: %s\n", sPlainText2Str.getStr()); 302cdf0e10cSrcweir 303cdf0e10cSrcweir // t_print(" Buf: %s\n", createHex(pCipherBuffer, nCipherLen).getStr()); 304cdf0e10cSrcweir 305cdf0e10cSrcweir sal_Int32 nCompare = memcmp(pPlainTextBuffer, pPlainText2Buffer, 16); 306cdf0e10cSrcweir 307cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("compare between plain and decoded plain failed", nCompare == 0); 308cdf0e10cSrcweir 309cdf0e10cSrcweir delete [] pPlainText2Buffer; 310cdf0e10cSrcweir 311cdf0e10cSrcweir delete [] pCipherBuffer; 312cdf0e10cSrcweir delete [] pPlainTextBuffer; 313cdf0e10cSrcweir 314cdf0e10cSrcweir delete [] pArgBuffer; 315cdf0e10cSrcweir delete [] pKeyBuffer; 316cdf0e10cSrcweir 317cdf0e10cSrcweir rtl_cipher_destroy(aCipher); 318cdf0e10cSrcweir } 319cdf0e10cSrcweir 320cdf0e10cSrcweir void decode_001() 321cdf0e10cSrcweir { 322cdf0e10cSrcweir test_encode_and_decode(0,0,""); 323cdf0e10cSrcweir test_encode_and_decode(0,0,"hallo"); 324cdf0e10cSrcweir test_encode_and_decode(1,0,"B2Aahg5B"); 325cdf0e10cSrcweir test_encode_and_decode(1,2,"Longer text string"); 326cdf0e10cSrcweir } 327cdf0e10cSrcweir 328cdf0e10cSrcweir void decode_002() 329cdf0e10cSrcweir { 330cdf0e10cSrcweir test_encode(0,0,""); 331cdf0e10cSrcweir test_encode(0,0,"hallo"); 332cdf0e10cSrcweir test_encode(1,0,"B2Aahg5B"); 333cdf0e10cSrcweir test_encode(1,2,"Longer text string"); 334cdf0e10cSrcweir } 335cdf0e10cSrcweir // Change the following lines only, if you add, remove or rename 336cdf0e10cSrcweir // member functions of the current class, 337cdf0e10cSrcweir // because these macros are need by auto register mechanism. 338cdf0e10cSrcweir 339cdf0e10cSrcweir CPPUNIT_TEST_SUITE(decode); 340cdf0e10cSrcweir CPPUNIT_TEST(decode_001); 341cdf0e10cSrcweir CPPUNIT_TEST(decode_002); 342cdf0e10cSrcweir CPPUNIT_TEST_SUITE_END(); 343cdf0e10cSrcweir }; // class decode 344cdf0e10cSrcweir // ----------------------------------------------------------------------------- 345cdf0e10cSrcweir class decodeBF : public CppUnit::TestFixture 346cdf0e10cSrcweir { 347cdf0e10cSrcweir public: 348cdf0e10cSrcweir // initialise your test code values here. 349cdf0e10cSrcweir void setUp() 350cdf0e10cSrcweir { 351cdf0e10cSrcweir } 352cdf0e10cSrcweir 353cdf0e10cSrcweir void tearDown() 354cdf0e10cSrcweir { 355cdf0e10cSrcweir } 356cdf0e10cSrcweir 357cdf0e10cSrcweir void decodeBF_001() 358cdf0e10cSrcweir { 359cdf0e10cSrcweir } 360cdf0e10cSrcweir // Change the following lines only, if you add, remove or rename 361cdf0e10cSrcweir // member functions of the current class, 362cdf0e10cSrcweir // because these macros are need by auto register mechanism. 363cdf0e10cSrcweir 364cdf0e10cSrcweir CPPUNIT_TEST_SUITE(decodeBF); 365cdf0e10cSrcweir CPPUNIT_TEST(decodeBF_001); 366cdf0e10cSrcweir CPPUNIT_TEST_SUITE_END(); 367cdf0e10cSrcweir }; // class decodeBF 368cdf0e10cSrcweir // ----------------------------------------------------------------------------- 369cdf0e10cSrcweir class destroy : public CppUnit::TestFixture 370cdf0e10cSrcweir { 371cdf0e10cSrcweir public: 372cdf0e10cSrcweir // initialise your test code values here. 373cdf0e10cSrcweir void setUp() 374cdf0e10cSrcweir { 375cdf0e10cSrcweir } 376cdf0e10cSrcweir 377cdf0e10cSrcweir void tearDown() 378cdf0e10cSrcweir { 379cdf0e10cSrcweir } 380cdf0e10cSrcweir 381cdf0e10cSrcweir void destroy_001() 382cdf0e10cSrcweir { 383cdf0e10cSrcweir rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeCBC); 384cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL); 385cdf0e10cSrcweir rtl_cipher_destroy(aCipher); 386cdf0e10cSrcweir } 387cdf0e10cSrcweir // Change the following lines only, if you add, remove or rename 388cdf0e10cSrcweir // member functions of the current class, 389cdf0e10cSrcweir // because these macros are need by auto register mechanism. 390cdf0e10cSrcweir 391cdf0e10cSrcweir CPPUNIT_TEST_SUITE(destroy); 392cdf0e10cSrcweir CPPUNIT_TEST(destroy_001); 393cdf0e10cSrcweir CPPUNIT_TEST_SUITE_END(); 394cdf0e10cSrcweir }; // class destroy 395cdf0e10cSrcweir // ----------------------------------------------------------------------------- 396cdf0e10cSrcweir class destroyBF : public CppUnit::TestFixture 397cdf0e10cSrcweir { 398cdf0e10cSrcweir public: 399cdf0e10cSrcweir // initialise your test code values here. 400cdf0e10cSrcweir void setUp() 401cdf0e10cSrcweir { 402cdf0e10cSrcweir } 403cdf0e10cSrcweir 404cdf0e10cSrcweir void tearDown() 405cdf0e10cSrcweir { 406cdf0e10cSrcweir } 407cdf0e10cSrcweir 408cdf0e10cSrcweir void destroyBF_001() 409cdf0e10cSrcweir { 410cdf0e10cSrcweir rtlCipher aCipher = rtl_cipher_createBF(rtl_Cipher_ModeECB); 411cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL); 412cdf0e10cSrcweir rtl_cipher_destroyBF(aCipher); 413cdf0e10cSrcweir // more proforma 414cdf0e10cSrcweir // should not GPF 415cdf0e10cSrcweir } 416cdf0e10cSrcweir // Change the following lines only, if you add, remove or rename 417cdf0e10cSrcweir // member functions of the current class, 418cdf0e10cSrcweir // because these macros are need by auto register mechanism. 419cdf0e10cSrcweir 420cdf0e10cSrcweir CPPUNIT_TEST_SUITE(destroyBF); 421cdf0e10cSrcweir CPPUNIT_TEST(destroyBF_001); 422cdf0e10cSrcweir CPPUNIT_TEST_SUITE_END(); 423cdf0e10cSrcweir }; // class destroyBF 424cdf0e10cSrcweir // ----------------------------------------------------------------------------- 425cdf0e10cSrcweir class encode : public CppUnit::TestFixture 426cdf0e10cSrcweir { 427cdf0e10cSrcweir public: 428cdf0e10cSrcweir // initialise your test code values here. 429cdf0e10cSrcweir void setUp() 430cdf0e10cSrcweir { 431cdf0e10cSrcweir } 432cdf0e10cSrcweir 433cdf0e10cSrcweir void tearDown() 434cdf0e10cSrcweir { 435cdf0e10cSrcweir } 436cdf0e10cSrcweir 437cdf0e10cSrcweir void test_encode(sal_uInt8 _nKeyValue, sal_uInt8 _nArgValue, sal_uInt8 _nDataValue) 438cdf0e10cSrcweir { 439cdf0e10cSrcweir rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeECB); 440cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL); 441cdf0e10cSrcweir 442cdf0e10cSrcweir sal_uInt32 nKeyLen = 16; 443cdf0e10cSrcweir sal_uInt8 *pKeyBuffer = new sal_uInt8[ nKeyLen ]; 444cdf0e10cSrcweir memset(pKeyBuffer, 0, nKeyLen); 445cdf0e10cSrcweir pKeyBuffer[0] = _nKeyValue; 446cdf0e10cSrcweir 447cdf0e10cSrcweir sal_uInt32 nArgLen = 16; 448cdf0e10cSrcweir sal_uInt8 *pArgBuffer = new sal_uInt8[ nArgLen ]; 449cdf0e10cSrcweir memset(pArgBuffer, 0, nArgLen); 450cdf0e10cSrcweir pArgBuffer[0] = _nArgValue; 451cdf0e10cSrcweir 452cdf0e10cSrcweir t_print(T_VERBOSE, "init Key: %s\n", createHex(pKeyBuffer, nKeyLen).getStr()); 453cdf0e10cSrcweir t_print(T_VERBOSE, "init Arg: %s\n", createHex(pArgBuffer, nArgLen).getStr()); 454cdf0e10cSrcweir 455cdf0e10cSrcweir rtlCipherError aError = rtl_cipher_init(aCipher, rtl_Cipher_DirectionEncode, pKeyBuffer, nKeyLen, pArgBuffer, nArgLen); 456cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("wrong init", aError == rtl_Cipher_E_None); 457cdf0e10cSrcweir 458cdf0e10cSrcweir sal_uInt32 nDataLen = 16; 459cdf0e10cSrcweir sal_uInt8 *pDataBuffer = new sal_uInt8[ nDataLen ]; 460cdf0e10cSrcweir memset(pDataBuffer, 0, nDataLen); 461cdf0e10cSrcweir pDataBuffer[0] = _nDataValue; 462cdf0e10cSrcweir 463cdf0e10cSrcweir sal_uInt32 nLen = 16; 464cdf0e10cSrcweir sal_uInt8 *pBuffer = new sal_uInt8[ nLen ]; 465cdf0e10cSrcweir memset(pBuffer, 0, nLen); 466cdf0e10cSrcweir 467cdf0e10cSrcweir /* rtlCipherError */ aError = rtl_cipher_encode(aCipher, pDataBuffer, nDataLen, pBuffer, nLen); 468cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("wrong encode", aError == rtl_Cipher_E_None); 469cdf0e10cSrcweir 470cdf0e10cSrcweir t_print(T_VERBOSE, " Key: %s\n", createHex(pKeyBuffer, nKeyLen).getStr()); 471cdf0e10cSrcweir t_print(T_VERBOSE, " Arg: %s\n", createHex(pArgBuffer, nArgLen).getStr()); 472cdf0e10cSrcweir t_print(T_VERBOSE, "Data: %s\n", createHex(pDataBuffer, nDataLen).getStr()); 473cdf0e10cSrcweir t_print(T_VERBOSE, " Buf: %s\n", createHex(pBuffer, nLen).getStr()); 474cdf0e10cSrcweir 475cdf0e10cSrcweir delete [] pBuffer; 476cdf0e10cSrcweir delete [] pDataBuffer; 477cdf0e10cSrcweir 478cdf0e10cSrcweir delete [] pArgBuffer; 479cdf0e10cSrcweir delete [] pKeyBuffer; 480cdf0e10cSrcweir 481cdf0e10cSrcweir rtl_cipher_destroy(aCipher); 482cdf0e10cSrcweir } 483cdf0e10cSrcweir 484cdf0e10cSrcweir void encode_001() 485cdf0e10cSrcweir { 486cdf0e10cSrcweir test_encode(0,0,0); 487cdf0e10cSrcweir test_encode(1,0,0); 488cdf0e10cSrcweir test_encode(0,1,0); 489cdf0e10cSrcweir test_encode(1,1,0); 490cdf0e10cSrcweir 491cdf0e10cSrcweir test_encode(0,0,1); 492cdf0e10cSrcweir test_encode(1,0,1); 493cdf0e10cSrcweir test_encode(0,1,1); 494cdf0e10cSrcweir test_encode(1,1,1); 495cdf0e10cSrcweir } 496cdf0e10cSrcweir 497cdf0e10cSrcweir // Change the following lines only, if you add, remove or rename 498cdf0e10cSrcweir // member functions of the current class, 499cdf0e10cSrcweir // because these macros are need by auto register mechanism. 500cdf0e10cSrcweir 501cdf0e10cSrcweir CPPUNIT_TEST_SUITE(encode); 502cdf0e10cSrcweir CPPUNIT_TEST(encode_001); 503cdf0e10cSrcweir CPPUNIT_TEST_SUITE_END(); 504cdf0e10cSrcweir }; // class encode 505cdf0e10cSrcweir // ----------------------------------------------------------------------------- 506cdf0e10cSrcweir class encodeBF : public CppUnit::TestFixture 507cdf0e10cSrcweir { 508cdf0e10cSrcweir public: 509cdf0e10cSrcweir // initialise your test code values here. 510cdf0e10cSrcweir void setUp() 511cdf0e10cSrcweir { 512cdf0e10cSrcweir } 513cdf0e10cSrcweir 514cdf0e10cSrcweir void tearDown() 515cdf0e10cSrcweir { 516cdf0e10cSrcweir } 517cdf0e10cSrcweir 518cdf0e10cSrcweir void encodeBF_001() 519cdf0e10cSrcweir { 520cdf0e10cSrcweir } 521cdf0e10cSrcweir // Change the following lines only, if you add, remove or rename 522cdf0e10cSrcweir // member functions of the current class, 523cdf0e10cSrcweir // because these macros are need by auto register mechanism. 524cdf0e10cSrcweir 525cdf0e10cSrcweir CPPUNIT_TEST_SUITE(encodeBF); 526cdf0e10cSrcweir CPPUNIT_TEST(encodeBF_001); 527cdf0e10cSrcweir CPPUNIT_TEST_SUITE_END(); 528cdf0e10cSrcweir }; // class encodeBF 529cdf0e10cSrcweir // ----------------------------------------------------------------------------- 530cdf0e10cSrcweir class init : public CppUnit::TestFixture 531cdf0e10cSrcweir { 532cdf0e10cSrcweir public: 533cdf0e10cSrcweir // initialise your test code values here. 534cdf0e10cSrcweir void setUp() 535cdf0e10cSrcweir { 536cdf0e10cSrcweir } 537cdf0e10cSrcweir 538cdf0e10cSrcweir void tearDown() 539cdf0e10cSrcweir { 540cdf0e10cSrcweir } 541cdf0e10cSrcweir 542cdf0e10cSrcweir void init_001() 543cdf0e10cSrcweir { 544cdf0e10cSrcweir rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeECB); 545cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL); 546cdf0e10cSrcweir 547cdf0e10cSrcweir sal_uInt32 nKeyLen = 16; 548cdf0e10cSrcweir sal_uInt8 *pKeyBuffer = new sal_uInt8[ nKeyLen ]; 549cdf0e10cSrcweir memset(pKeyBuffer, 0, nKeyLen); 550cdf0e10cSrcweir 551cdf0e10cSrcweir sal_uInt32 nArgLen = 16; 552cdf0e10cSrcweir sal_uInt8 *pArgBuffer = new sal_uInt8[ nArgLen ]; 553cdf0e10cSrcweir memset(pArgBuffer, 0, nArgLen); 554cdf0e10cSrcweir 555cdf0e10cSrcweir t_print(T_VERBOSE, "Key: %s\n", createHex(pKeyBuffer, nKeyLen).getStr()); 556cdf0e10cSrcweir t_print(T_VERBOSE, "Arg: %s\n", createHex(pArgBuffer, nArgLen).getStr()); 557cdf0e10cSrcweir 558cdf0e10cSrcweir rtlCipherError aError = rtl_cipher_init(aCipher, rtl_Cipher_DirectionEncode, pKeyBuffer, nKeyLen, pArgBuffer, nArgLen); 559cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("wrong init", aError == rtl_Cipher_E_None); 560cdf0e10cSrcweir 561cdf0e10cSrcweir t_print(T_VERBOSE, "Key: %s\n", createHex(pKeyBuffer, nKeyLen).getStr()); 562cdf0e10cSrcweir t_print(T_VERBOSE, "Arg: %s\n", createHex(pArgBuffer, nArgLen).getStr()); 563cdf0e10cSrcweir 564cdf0e10cSrcweir delete [] pArgBuffer; 565cdf0e10cSrcweir delete [] pKeyBuffer; 566cdf0e10cSrcweir 567cdf0e10cSrcweir rtl_cipher_destroy(aCipher); 568cdf0e10cSrcweir } 569cdf0e10cSrcweir 570cdf0e10cSrcweir void init_002() 571cdf0e10cSrcweir { 572cdf0e10cSrcweir rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeECB); 573cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL); 574cdf0e10cSrcweir 575cdf0e10cSrcweir sal_uInt32 nKeyLen = 16; 576cdf0e10cSrcweir sal_uInt8 *pKeyBuffer = new sal_uInt8[ nKeyLen ]; 577cdf0e10cSrcweir memset(pKeyBuffer, 0, nKeyLen); 578cdf0e10cSrcweir pKeyBuffer[0] = 1; 579cdf0e10cSrcweir 580cdf0e10cSrcweir sal_uInt32 nArgLen = 16; 581cdf0e10cSrcweir sal_uInt8 *pArgBuffer = new sal_uInt8[ nArgLen ]; 582cdf0e10cSrcweir memset(pArgBuffer, 0, nArgLen); 583cdf0e10cSrcweir 584cdf0e10cSrcweir t_print(T_VERBOSE, "Key: %s\n", createHex(pKeyBuffer, nKeyLen).getStr()); 585cdf0e10cSrcweir t_print(T_VERBOSE, "Arg: %s\n", createHex(pArgBuffer, nArgLen).getStr()); 586cdf0e10cSrcweir 587cdf0e10cSrcweir rtlCipherError aError = rtl_cipher_init(aCipher, rtl_Cipher_DirectionEncode, pKeyBuffer, nKeyLen, pArgBuffer, nArgLen); 588cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("wrong init", aError == rtl_Cipher_E_None); 589cdf0e10cSrcweir 590cdf0e10cSrcweir t_print(T_VERBOSE, "Key: %s\n", createHex(pKeyBuffer, nKeyLen).getStr()); 591cdf0e10cSrcweir t_print(T_VERBOSE, "Arg: %s\n", createHex(pArgBuffer, nArgLen).getStr()); 592cdf0e10cSrcweir 593cdf0e10cSrcweir delete [] pArgBuffer; 594cdf0e10cSrcweir delete [] pKeyBuffer; 595cdf0e10cSrcweir 596cdf0e10cSrcweir rtl_cipher_destroy(aCipher); 597cdf0e10cSrcweir } 598cdf0e10cSrcweir void init_003() 599cdf0e10cSrcweir { 600cdf0e10cSrcweir rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeECB); 601cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL); 602cdf0e10cSrcweir 603cdf0e10cSrcweir sal_uInt32 nKeyLen = 16; 604cdf0e10cSrcweir sal_uInt8 *pKeyBuffer = new sal_uInt8[ nKeyLen ]; 605cdf0e10cSrcweir memset(pKeyBuffer, 0, nKeyLen); 606cdf0e10cSrcweir 607cdf0e10cSrcweir sal_uInt32 nArgLen = 16; 608cdf0e10cSrcweir sal_uInt8 *pArgBuffer = new sal_uInt8[ nArgLen ]; 609cdf0e10cSrcweir memset(pArgBuffer, 0, nArgLen); 610cdf0e10cSrcweir pArgBuffer[0] = 1; 611cdf0e10cSrcweir 612cdf0e10cSrcweir t_print(T_VERBOSE, "Key: %s\n", createHex(pKeyBuffer, nKeyLen).getStr()); 613cdf0e10cSrcweir t_print(T_VERBOSE, "Arg: %s\n", createHex(pArgBuffer, nArgLen).getStr()); 614cdf0e10cSrcweir 615cdf0e10cSrcweir rtlCipherError aError = rtl_cipher_init(aCipher, rtl_Cipher_DirectionEncode, pKeyBuffer, nKeyLen, pArgBuffer, nArgLen); 616cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("wrong init", aError == rtl_Cipher_E_None); 617cdf0e10cSrcweir 618cdf0e10cSrcweir t_print(T_VERBOSE, "Key: %s\n", createHex(pKeyBuffer, nKeyLen).getStr()); 619cdf0e10cSrcweir t_print(T_VERBOSE, "Arg: %s\n", createHex(pArgBuffer, nArgLen).getStr()); 620cdf0e10cSrcweir 621cdf0e10cSrcweir delete [] pArgBuffer; 622cdf0e10cSrcweir delete [] pKeyBuffer; 623cdf0e10cSrcweir 624cdf0e10cSrcweir rtl_cipher_destroy(aCipher); 625cdf0e10cSrcweir } 626cdf0e10cSrcweir void init_004() 627cdf0e10cSrcweir { 628cdf0e10cSrcweir rtlCipher aCipher = rtl_cipher_create(rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeECB); 629cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("create failed.", aCipher != NULL); 630cdf0e10cSrcweir 631cdf0e10cSrcweir sal_uInt32 nKeyLen = 16; 632cdf0e10cSrcweir sal_uInt8 *pKeyBuffer = new sal_uInt8[ nKeyLen ]; 633cdf0e10cSrcweir memset(pKeyBuffer, 0, nKeyLen); 634cdf0e10cSrcweir pKeyBuffer[0] = 1; 635cdf0e10cSrcweir 636cdf0e10cSrcweir sal_uInt32 nArgLen = 16; 637cdf0e10cSrcweir sal_uInt8 *pArgBuffer = new sal_uInt8[ nArgLen ]; 638cdf0e10cSrcweir memset(pArgBuffer, 0, nArgLen); 639cdf0e10cSrcweir pArgBuffer[0] = 1; 640cdf0e10cSrcweir 641cdf0e10cSrcweir t_print(T_VERBOSE, "Key: %s\n", createHex(pKeyBuffer, nKeyLen).getStr()); 642cdf0e10cSrcweir t_print(T_VERBOSE, "Arg: %s\n", createHex(pArgBuffer, nArgLen).getStr()); 643cdf0e10cSrcweir 644cdf0e10cSrcweir rtlCipherError aError = rtl_cipher_init(aCipher, rtl_Cipher_DirectionEncode, pKeyBuffer, nKeyLen, pArgBuffer, nArgLen); 645cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE("wrong init", aError == rtl_Cipher_E_None); 646cdf0e10cSrcweir 647cdf0e10cSrcweir t_print(T_VERBOSE, "Key: %s\n", createHex(pKeyBuffer, nKeyLen).getStr()); 648cdf0e10cSrcweir t_print(T_VERBOSE, "Arg: %s\n", createHex(pArgBuffer, nArgLen).getStr()); 649cdf0e10cSrcweir 650cdf0e10cSrcweir delete [] pArgBuffer; 651cdf0e10cSrcweir delete [] pKeyBuffer; 652cdf0e10cSrcweir 653cdf0e10cSrcweir rtl_cipher_destroy(aCipher); 654cdf0e10cSrcweir } 655cdf0e10cSrcweir // Change the following lines only, if you add, remove or rename 656cdf0e10cSrcweir // member functions of the current class, 657cdf0e10cSrcweir // because these macros are need by auto register mechanism. 658cdf0e10cSrcweir 659cdf0e10cSrcweir CPPUNIT_TEST_SUITE(init); 660cdf0e10cSrcweir CPPUNIT_TEST(init_001); 661cdf0e10cSrcweir CPPUNIT_TEST(init_002); 662cdf0e10cSrcweir CPPUNIT_TEST(init_003); 663cdf0e10cSrcweir CPPUNIT_TEST(init_004); 664cdf0e10cSrcweir CPPUNIT_TEST_SUITE_END(); 665cdf0e10cSrcweir }; // class init 666cdf0e10cSrcweir // ----------------------------------------------------------------------------- 667cdf0e10cSrcweir class initBF : public CppUnit::TestFixture 668cdf0e10cSrcweir { 669cdf0e10cSrcweir public: 670cdf0e10cSrcweir // initialise your test code values here. 671cdf0e10cSrcweir void setUp() 672cdf0e10cSrcweir { 673cdf0e10cSrcweir } 674cdf0e10cSrcweir 675cdf0e10cSrcweir void tearDown() 676cdf0e10cSrcweir { 677cdf0e10cSrcweir } 678cdf0e10cSrcweir 679cdf0e10cSrcweir void initBF_001() 680cdf0e10cSrcweir { 681cdf0e10cSrcweir // seems to be the same as init, so empty 682cdf0e10cSrcweir } 683cdf0e10cSrcweir 684cdf0e10cSrcweir // Change the following lines only, if you add, remove or rename 685cdf0e10cSrcweir // member functions of the current class, 686cdf0e10cSrcweir // because these macros are need by auto register mechanism. 687cdf0e10cSrcweir 688cdf0e10cSrcweir CPPUNIT_TEST_SUITE(initBF); 689cdf0e10cSrcweir CPPUNIT_TEST(initBF_001); 690cdf0e10cSrcweir CPPUNIT_TEST_SUITE_END(); 691cdf0e10cSrcweir }; // class initBF 692cdf0e10cSrcweir 693cdf0e10cSrcweir // ----------------------------------------------------------------------------- 694cdf0e10cSrcweir 695cdf0e10cSrcweir CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_cipher::create, "rtl_cipher"); 696cdf0e10cSrcweir CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_cipher::createBF, "rtl_cipher"); 697cdf0e10cSrcweir CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_cipher::decode, "rtl_cipher"); 698cdf0e10cSrcweir CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_cipher::decodeBF, "rtl_cipher"); 699cdf0e10cSrcweir CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_cipher::destroy, "rtl_cipher"); 700cdf0e10cSrcweir CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_cipher::destroyBF, "rtl_cipher"); 701cdf0e10cSrcweir CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_cipher::encode, "rtl_cipher"); 702cdf0e10cSrcweir CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_cipher::encodeBF, "rtl_cipher"); 703cdf0e10cSrcweir CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_cipher::init, "rtl_cipher"); 704cdf0e10cSrcweir CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_cipher::initBF, "rtl_cipher"); 705cdf0e10cSrcweir 706cdf0e10cSrcweir } // namespace rtl_cipher 707cdf0e10cSrcweir 708cdf0e10cSrcweir 709cdf0e10cSrcweir // ----------------------------------------------------------------------------- 710cdf0e10cSrcweir 711cdf0e10cSrcweir // this macro creates an empty function, which will called by the RegisterAllFunctions() 712cdf0e10cSrcweir // to let the user the possibility to also register some functions by hand. 713cdf0e10cSrcweir NOADDITIONAL; 714