--- truecrypt/common/crypto.c 2018/04/24 16:37:52 1.1.1.1 +++ truecrypt/common/crypto.c 2018/04/24 16:40:48 1.1.1.4 @@ -1,5 +1,9 @@ -/* Copyright (C) 2004 TrueCrypt Team, truecrypt.org - This product uses components written by Paul Le Roux */ +/* The source code contained in this file has been derived from the source code + of Encryption for the Masses 2.02a by Paul Le Roux. Modifications and + additions to that source code contained in this file are Copyright (c) 2004 + TrueCrypt Team and Copyright (c) 2004 TrueCrypt Foundation. Unmodified + parts are Copyright (c) 1998-99 Paul Le Roux. This is a TrueCrypt Foundation + release. Please see the file license.txt for full license details. */ #include "TCdefs.h" #include "crypto.h" @@ -10,6 +14,10 @@ crypto_open () { /* Do the crt allocation */ PCRYPTO_INFO cryptoInfo = TCalloc (sizeof (CRYPTO_INFO)); +#ifndef DEVICE_DRIVER + VirtualLock (cryptoInfo, sizeof (CRYPTO_INFO)); +#endif + if (cryptoInfo == NULL) return NULL; @@ -29,14 +37,19 @@ void crypto_close (PCRYPTO_INFO cryptoInfo) { burn (cryptoInfo, sizeof (CRYPTO_INFO)); +#ifndef DEVICE_DRIVER + VirtualUnlock (cryptoInfo, sizeof (CRYPTO_INFO)); +#endif TCfree (cryptoInfo); } int get_block_size (int cipher) { - if (cipher); /* remove warning */ - return 8; + if (cipher == AES) + return 16; + else + return 8; } int @@ -44,10 +57,10 @@ get_key_size (int cipher) { if (cipher == DES56) return 7; - else if (cipher == IDEA) - return 16; else if (cipher == BLOWFISH) return 56; + else if (cipher == AES) + return 32; else if (cipher == TRIPLEDES) return 21; else if (cipher == CAST) @@ -63,8 +76,8 @@ get_cipher_name (int cipher) { if (cipher == BLOWFISH) return "Blowfish"; - else if (cipher == IDEA) - return "IDEA"; + if (cipher == AES) + return "AES"; else if (cipher == DES56) return "DES"; else if (cipher == TRIPLEDES)