VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Crypto/GostCipher.h
blob: bcb77207307f0b674ee8f9d6f5125b175c4f6b74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
 Copyright (c) 2008-2011 TrueCrypt Developers Association. All rights reserved.

 Governed by the TrueCrypt License 3.0 the full text of which is contained in
 the file License.txt included in TrueCrypt binary and source code distribution
 packages.
*/



#ifndef GOST_CIPHER_H
#define GOST_CIPHER_H

#include "Common/Tcdefs.h"
#include "config.h"
#include "misc.h"

#ifdef __cplusplus
extern "C" {
#endif

//In unsigned chars
#define GOST_KEYSIZE	32
#define GOST_BLOCKSIZE	8
#define GOST_SBOX_SIZE	16

//Production setting, but can be turned off to compare the algorithm with other implementations
#define CIPHER_GOST89
#define GOST_DYNAMIC_SBOXES

#if defined(CIPHER_GOST89)

#ifdef GST_WINDOWS_BOOT
typedef int gst_word;
typedef long gst_dword;
typedef unsigned int gst_uword;
typedef unsigned long gst_udword;
#else
typedef short gst_word;
typedef int gst_dword;
typedef unsigned short gst_uword;
typedef unsigned int gst_udword;
#endif

typedef struct gost_kds
{
	CRYPTOPP_ALIGN_DATA(16) byte key[32];
	gst_udword	sbox_cvt[256 * 4];
	byte			sbox[8][16];
} gost_kds;

#define GOST_KS				(sizeof(gost_kds))

void gost_encrypt(const byte *in, byte *out, gost_kds *ks, int count);
void gost_decrypt(const byte *in, byte *out, gost_kds *ks, int count);
void gost_set_key(const byte *key, gost_kds *ks, int useDynamicSbox);

#else 
#define GOST_KS				(0)
#endif

#ifdef __cplusplus
}
#endif


#endif
n class="na">href="Documentation.html">Documentation</a></li> <li><a href="Donation.html">Donate</a></li> <li><a href="https://sourceforge.net/p/veracrypt/discussion/" target="_blank">Forums</a></li> </ul> </div> <div> <p> <a href="Documentation.html">Documentation</a> <img src="arrow_right.gif" alt=">>" style="margin-top: 5px"> <a href="Main%20Program%20Window.html">Main Program Window</a> <img src="arrow_right.gif" alt=">>" style="margin-top: 5px"> <a href="Mounting%20VeraCrypt%20Volumes.html">Mounting Volumes</a> </p></div> <div class="wikidoc"> <h1>Mounting VeraCrypt Volumes</h1> <div style="text-align:left; margin-top:19px; margin-bottom:19px; padding-top:0px; padding-bottom:0px"> <p>If you have not done so yet, please read the sections &lsquo;<em>Mount</em>&lsquo; and &lsquo;<em>Auto-Mount Devices</em>&lsquo; in the chapter <a href="Main%20Program%20Window.html"><em>Main Program Window</em></a>.</p> <h3>Cache Password in Driver Memory</h3> <p>This option can be set in the password entry dialog so that it will apply only to that particular mount attempt. It can also be set as default in the Preferences. For more information, please see the section <a href="Program%20Menu.html"><em>Settings -&gt; Preferences</em>, subsection <em>Cache passwords in driver memory</em></a>.</p> <h3>Mount Options</h3> <p>Mount options affect the parameters of the volume being mounted. The <em>Mount Options</em> dialog can be opened by clicking on the <em>Mount Options</em> button in the password entry dialog. When a correct password is cached, volumes are automatically mounted after you click <em>Mount</em>. If you need to change mount options for a volume being mounted using a cached password, hold down the <em>Control</em> (<em>Ctrl</em>) key while clicking <em>Mount</em> or a favorite volume in the <em>Favorites</em> menu<em>,</em> or select <em>Mount with Options</em> from the <em> Volumes</em> menu.<br> <br> Default mount options can be configured in the main program preferences (<em>Settings -&gt; Preferences).</em></p> <h4>Mount volume as read-only</h4> <p>When checked, it will not be possible to write any data to the mounted volume.</p> <h4>Mount volume as removable medium</h4> <p>See section <a href="Removable%20Medium%20Volume.html"> <em>Volume Mounted as Removable Medium</em></a>.</p> <h4>Use backup header embedded in volume if available</h4> <p>All volumes created by VeraCrypt contain an embedded backup header (located at the end of the volume). If you check this option, VeraCrypt will attempt to mount the volume using the embedded backup header. Note that if the volume header is damaged, you do not have to use this option. Instead, you can repair the header by selecting <em> Tools</em> &gt; <em>Restore Volume Header</em>.</p> <h4>Mount partition using system encryption without pre-boot authentication</h4> <p>Check this option, if you need to mount a partition that is within the key scope of system encryption without pre-boot authentication. For example, if you need to mount a partition located on the encrypted system drive of another operating system that is not running. This can be useful e.g. when you need to back up or repair an operating system encrypted by VeraCrypt (from within another operating system). Note that this option can be enabled also when using the &lsquo;<em>Auto-Mount Devices</em>&rsquo; or &lsquo;<em>Auto-Mount All Device-Hosted Volumes</em>&rsquo; functions.</p> <h4>Hidden Volume Protection</h4> <p>Please see the section <a href="Protection%20of%20Hidden%20Volumes.html"> <em>Protection of Hidden Volumes Against Damage</em></a>.</p> </div> </div><div class="ClearBoth"></div></body></html>