VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Volume/EncryptionModeLRW.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Volume/EncryptionModeLRW.h')
-rw-r--r--src/Volume/EncryptionModeLRW.h50
1 files changed, 0 insertions, 50 deletions
diff --git a/src/Volume/EncryptionModeLRW.h b/src/Volume/EncryptionModeLRW.h
deleted file mode 100644
index 0cfcd50c..00000000
--- a/src/Volume/EncryptionModeLRW.h
+++ /dev/null
@@ -1,50 +0,0 @@
1/*
2 Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
3
4 Governed by the TrueCrypt License 3.0 the full text of which is contained in
5 the file License.txt included in TrueCrypt binary and source code distribution
6 packages.
7*/
8
9#ifndef TC_HEADER_Encryption_EncryptionModeLRW
10#define TC_HEADER_Encryption_EncryptionModeLRW
11
12#include "Platform/Platform.h"
13#include "EncryptionMode.h"
14
15namespace VeraCrypt
16{
17 class EncryptionModeLRW : public EncryptionMode
18 {
19 public:
20 EncryptionModeLRW () { }
21 virtual ~EncryptionModeLRW () { }
22
23 virtual void Decrypt (byte *data, uint64 length) const;
24 virtual void DecryptSectorsCurrentThread (byte *data, uint64 sectorIndex, uint64 sectorCount, size_t sectorSize) const;
25 virtual void Encrypt (byte *data, uint64 length) const;
26 virtual void EncryptSectorsCurrentThread (byte *data, uint64 sectorIndex, uint64 sectorCount, size_t sectorSize) const;
27 virtual const SecureBuffer &GetKey () const { return Key; }
28 virtual size_t GetKeySize () const { return 16; };
29 virtual wstring GetName () const { return L"LRW"; };
30 virtual shared_ptr <EncryptionMode> GetNew () const { return shared_ptr <EncryptionMode> (new EncryptionModeLRW); }
31 virtual void SetKey (const ConstBufferPtr &key);
32
33 protected:
34 void DecryptBuffer (byte *plainText, uint64 length, uint64 blockIndex) const;
35 void EncryptBuffer (byte *plainText, uint64 length, uint64 blockIndex) const;
36 void IncrementBlockIndex (byte *index) const;
37 uint64 SectorToBlockIndex (uint64 sectorIndex) const;
38 void Xor64 (uint64 *a, const uint64 *b) const;
39 void Xor128 (uint64 *a, const uint64 *b) const;
40
41 SecureBuffer GfContext;
42 SecureBuffer Key;
43
44 private:
45 EncryptionModeLRW (const EncryptionModeLRW &);
46 EncryptionModeLRW &operator= (const EncryptionModeLRW &);
47 };
48}
49
50#endif // TC_HEADER_Encryption_EncryptionModeLRW