"Fossies" - the Fresh Open Source Software Archive

Member "src/Volume/EncryptionTest.h" (10 Oct 2018, 1407 Bytes) of package /windows/misc/VeraCrypt_1.23-Hotfix-2_Source.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "EncryptionTest.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  Derived from source code of TrueCrypt 7.1a, which is
    3  Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
    4  by the TrueCrypt License 3.0.
    5 
    6  Modifications and additions to the original source code (contained in this file)
    7  and all other portions of this file are Copyright (c) 2013-2017 IDRIX
    8  and are governed by the Apache License 2.0 the full text of which is
    9  contained in the file License.txt included in VeraCrypt binary and source
   10  code distribution packages.
   11 */
   12 
   13 #ifndef TC_HEADER_Encryption_EncryptionTest
   14 #define TC_HEADER_Encryption_EncryptionTest
   15 
   16 #include "Platform/Platform.h"
   17 #include "Common/Crypto.h"
   18 
   19 namespace VeraCrypt
   20 {
   21     class EncryptionTest
   22     {
   23     public:
   24         static void TestAll ();
   25         static void TestAll (bool enableCpuEncryptionSupport);
   26 
   27     protected:
   28         static void TestCiphers ();
   29         static void TestLegacyModes ();
   30         static void TestPkcs5 ();
   31         static void TestXts ();
   32         static void TestXtsAES ();
   33 
   34     struct XtsTestVector
   35     {
   36         byte key1[32];
   37         byte key2[32];
   38         byte dataUnitNo[8];
   39         unsigned int blockNo;
   40         byte plaintext[ENCRYPTION_DATA_UNIT_SIZE];
   41         byte ciphertext[ENCRYPTION_DATA_UNIT_SIZE];
   42     };
   43 
   44     static const XtsTestVector XtsTestVectors[];
   45 
   46     private:
   47         EncryptionTest ();
   48         virtual ~EncryptionTest ();
   49         EncryptionTest (const EncryptionTest &);
   50         EncryptionTest &operator= (const EncryptionTest &);
   51     };
   52 }
   53 
   54 #endif // TC_HEADER_Encryption_EncryptionTest