home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 September / Chip_2002-09_cd1.bin / zkuste / vbasic / Data / Utils / XZipComp.exe / XceedEncryption.Cab / F113007_TestVector.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-06-05  |  2.3 KB  |  72 lines

  1. #ifndef __TESTVECTOR_H__
  2. #define __TESTVECTOR_H__
  3.  
  4. /* Xceed Encryption Library - TestVector Sample Application
  5.  * Copyright (c) 2001 Xceed Software Inc.
  6.  *
  7.  * [TestVector.h]
  8.  *
  9.  * This console application tests the results of some Xceed Encryption Library
  10.  * functions against some static test vectors.
  11.  * It specifically tests:
  12.  *  - The Encrypt and Hash methods.
  13.  *
  14.  * This file is part of the Xceed Encryption Library sample 
  15.  * applications. The source code in this file is only intended as 
  16.  * a supplement to Xceed Encryption Library's documentation, 
  17.  * and is provided "as is", without warranty of any kind, either 
  18.  * expressed or implied. 
  19.  */
  20.  
  21. //
  22. // The Visual C++ compiler will automatically generate wrapper classes 
  23. // around available interfaces found in this type library.
  24. //
  25.  
  26. #import "XceedCRY.dll" no_namespace named_guids
  27.  
  28. //
  29. // Constants
  30. //
  31.  
  32. #define MAX_PLAIN_TEXT_SIZE     128
  33. #define MAX_CIPHER_TEXT_SIZE    MAX_PLAIN_TEXT_SIZE
  34. #define MAX_KEY_SIZE            MAX_PLAIN_TEXT_SIZE
  35. #define BUFFER_SIZE             255
  36.  
  37. #define MAX_MESSAGE_SIZE        255
  38.  
  39. #define DATA_PATH "..\\"
  40.  
  41. //
  42. // Prototypes
  43. //
  44.  
  45. void HexToBinary( LPCSTR sHexValue, BYTE** pcBinValue, DWORD* dwBinValueSize );
  46.  
  47. bool TestRijndael( IXceedEncryptionPtr piEnc );
  48. bool TestTwoFish( IXceedEncryptionPtr piEnc );
  49. bool TestSHA( IXceedHashingPtr piHash );
  50. bool TestHaval( IXceedHashingPtr piHash );
  51.  
  52. template <typename T>
  53. bool TestSymmetricCipher( IXceedEncryptionPtr piEnc, 
  54.                           T piMethod, 
  55.                           const char* szFileName );
  56. template <typename T>
  57. bool TestHash( IXceedHashingPtr piHash, 
  58.                T piMethod,
  59.                const char* szHashFileName );
  60.  
  61. HANDLE OpenTestVectorFile( const char* szFileName );
  62. bool   ReadEncryptionTestVector( HANDLE hFicIn, 
  63.                                  BYTE* pcKey, short* pnKeySize, 
  64.                                  BYTE* pcInitVector, short* pnInitVectorSize,
  65.                                  BYTE* pcPlainText, DWORD* pdwPlainTextSize, 
  66.                                  BYTE* pcCipherText, DWORD* pdwCipherTextSize );
  67. bool   ReadTestVectorHash( HANDLE hFicIn, 
  68.                            BYTE* pcMessage, DWORD* pdwMessageSize, 
  69.                            BYTE* pcDigest, DWORD* pdwDigestSize );
  70.  
  71. #endif // __TESTVECTOR_H__
  72.