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

  1. #ifndef __HASH_H__
  2. #define __HASH_H__
  3.  
  4. /* Xceed Encryption Library - Hash Sample Application
  5.  * Copyright (c) 2001 Xceed Software Inc.
  6.  *
  7.  * [Hash.h]
  8.  *
  9.  * This console application shows how to hash a file, using different
  10.  * hashing methods. It specifically demonstrates:
  11.  *  - The ReadFile and Hash methods.
  12.  *  - The HashingMethod, HashSize and HashValue properties.
  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. //Size of the buffer used to read characters from the console.
  33. #define BUFFER_SIZE   0x4000
  34.  
  35. //
  36. // Enumerations
  37. //
  38.  
  39. //The different hashing methods supported by the Xceed Encryption
  40. //library.
  41. enum EHashingMethod
  42. {
  43.   hmSHA = 0,
  44.   hmHaval = 1
  45. };
  46.  
  47. //
  48. // Data types
  49. //
  50.  
  51. //Structure that will be used in an array providing a correspondance
  52. //table between the possible hashing methods passed on the command line
  53. //and their value in Xceed Encryption Library.
  54. struct SHashingMethod
  55. {
  56.   const char*   pszCommandLine;
  57.   EHashingMethod eMethod;
  58. };
  59.  
  60.  
  61. //
  62. // Prototypes
  63. //
  64.  
  65. void ShowHelp();
  66.  
  67. bool ExtractParameters( int argc, char* argv[],
  68.                         IXceedHashingPtr piHash,
  69.                         _bstr_t& bstrInputFileName,
  70.                         _bstr_t& bstrOutputFileName );
  71.  
  72. bool SaveHashToFile( _bstr_t bstrOutputFileName, 
  73.                      IXceedHashingPtr piHash );
  74.  
  75. #endif // __HASH_H__
  76.