home *** CD-ROM | disk | FTP | other *** search
- #ifndef __TESTVECTOR_H__
- #define __TESTVECTOR_H__
-
- /* Xceed Encryption Library - TestVector Sample Application
- * Copyright (c) 2001 Xceed Software Inc.
- *
- * [TestVector.h]
- *
- * This console application tests the results of some Xceed Encryption Library
- * functions against some static test vectors.
- * It specifically tests:
- * - The Encrypt and Hash methods.
- *
- * This file is part of the Xceed Encryption Library sample
- * applications. The source code in this file is only intended as
- * a supplement to Xceed Encryption Library's documentation,
- * and is provided "as is", without warranty of any kind, either
- * expressed or implied.
- */
-
- //
- // The Visual C++ compiler will automatically generate wrapper classes
- // around available interfaces found in this type library.
- //
-
- #import "XceedCRY.dll" no_namespace named_guids
-
- //
- // Constants
- //
-
- #define MAX_PLAIN_TEXT_SIZE 128
- #define MAX_CIPHER_TEXT_SIZE MAX_PLAIN_TEXT_SIZE
- #define MAX_KEY_SIZE MAX_PLAIN_TEXT_SIZE
- #define BUFFER_SIZE 255
-
- #define MAX_MESSAGE_SIZE 255
-
- #define DATA_PATH "..\\"
-
- //
- // Prototypes
- //
-
- void HexToBinary( LPCSTR sHexValue, BYTE** pcBinValue, DWORD* dwBinValueSize );
-
- bool TestRijndael( IXceedEncryptionPtr piEnc );
- bool TestTwoFish( IXceedEncryptionPtr piEnc );
- bool TestSHA( IXceedHashingPtr piHash );
- bool TestHaval( IXceedHashingPtr piHash );
-
- template <typename T>
- bool TestSymmetricCipher( IXceedEncryptionPtr piEnc,
- T piMethod,
- const char* szFileName );
- template <typename T>
- bool TestHash( IXceedHashingPtr piHash,
- T piMethod,
- const char* szHashFileName );
-
- HANDLE OpenTestVectorFile( const char* szFileName );
- bool ReadEncryptionTestVector( HANDLE hFicIn,
- BYTE* pcKey, short* pnKeySize,
- BYTE* pcInitVector, short* pnInitVectorSize,
- BYTE* pcPlainText, DWORD* pdwPlainTextSize,
- BYTE* pcCipherText, DWORD* pdwCipherTextSize );
- bool ReadTestVectorHash( HANDLE hFicIn,
- BYTE* pcMessage, DWORD* pdwMessageSize,
- BYTE* pcDigest, DWORD* pdwDigestSize );
-
- #endif // __TESTVECTOR_H__
-