VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Volume/Cipher.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Volume/Cipher.cpp')
-rw-r--r--src/Volume/Cipher.cpp68
1 files changed, 34 insertions, 34 deletions
diff --git a/src/Volume/Cipher.cpp b/src/Volume/Cipher.cpp
index d0fb7bd5..de240544 100644
--- a/src/Volume/Cipher.cpp
+++ b/src/Volume/Cipher.cpp
@@ -49,7 +49,7 @@ namespace VeraCrypt
{
}
- void Cipher::DecryptBlock (byte *data) const
+ void Cipher::DecryptBlock (uint8 *data) const
{
if (!Initialized)
throw NotInitialized (SRC_POS);
@@ -57,7 +57,7 @@ namespace VeraCrypt
Decrypt (data);
}
- void Cipher::DecryptBlocks (byte *data, size_t blockCount) const
+ void Cipher::DecryptBlocks (uint8 *data, size_t blockCount) const
{
if (!Initialized)
throw NotInitialized (SRC_POS);
@@ -69,7 +69,7 @@ namespace VeraCrypt
}
}
- void Cipher::EncryptBlock (byte *data) const
+ void Cipher::EncryptBlock (uint8 *data) const
{
if (!Initialized)
throw NotInitialized (SRC_POS);
@@ -77,7 +77,7 @@ namespace VeraCrypt
Encrypt (data);
}
- void Cipher::EncryptBlocks (byte *data, size_t blockCount) const
+ void Cipher::EncryptBlocks (uint8 *data, size_t blockCount) const
{
if (!Initialized)
throw NotInitialized (SRC_POS);
@@ -130,7 +130,7 @@ namespace VeraCrypt
Initialized = true;
}
- void Cipher::EncryptBlockXTS (byte *data, uint64 length, uint64 startDataUnitNo) const
+ void Cipher::EncryptBlockXTS (uint8 *data, uint64 length, uint64 startDataUnitNo) const
{
if (!Initialized)
throw NotInitialized (SRC_POS);
@@ -138,7 +138,7 @@ namespace VeraCrypt
EncryptXTS (data, length, startDataUnitNo);
}
- void Cipher::DecryptBlockXTS (byte *data, uint64 length, uint64 startDataUnitNo) const
+ void Cipher::DecryptBlockXTS (uint8 *data, uint64 length, uint64 startDataUnitNo) const
{
if (!Initialized)
throw NotInitialized (SRC_POS);
@@ -155,7 +155,7 @@ namespace VeraCrypt
// AES
- void CipherAES::Decrypt (byte *data) const
+ void CipherAES::Decrypt (uint8 *data) const
{
#ifdef TC_AES_HW_CPU
if (IsHwSupportAvailable())
@@ -165,7 +165,7 @@ namespace VeraCrypt
aes_decrypt (data, data, (aes_decrypt_ctx *) (ScheduledKey.Ptr() + sizeof (aes_encrypt_ctx)));
}
- void CipherAES::DecryptBlocks (byte *data, size_t blockCount) const
+ void CipherAES::DecryptBlocks (uint8 *data, size_t blockCount) const
{
if (!Initialized)
throw NotInitialized (SRC_POS);
@@ -187,7 +187,7 @@ namespace VeraCrypt
Cipher::DecryptBlocks (data, blockCount);
}
- void CipherAES::Encrypt (byte *data) const
+ void CipherAES::Encrypt (uint8 *data) const
{
#ifdef TC_AES_HW_CPU
if (IsHwSupportAvailable())
@@ -197,7 +197,7 @@ namespace VeraCrypt
aes_encrypt (data, data, (aes_encrypt_ctx *) ScheduledKey.Ptr());
}
- void CipherAES::EncryptBlocks (byte *data, size_t blockCount) const
+ void CipherAES::EncryptBlocks (uint8 *data, size_t blockCount) const
{
if (!Initialized)
throw NotInitialized (SRC_POS);
@@ -219,17 +219,17 @@ namespace VeraCrypt
Cipher::EncryptBlocks (data, blockCount);
}
#ifdef WOLFCRYPT_BACKEND
- void CipherAES::EncryptXTS (byte *data, uint64 length, uint64 startDataUnitNo) const
+ void CipherAES::EncryptXTS (uint8 *data, uint64 length, uint64 startDataUnitNo) const
{
xts_encrypt (data, data, length, startDataUnitNo, (aes_encrypt_ctx *) ScheduledKey.Ptr());
}
- void CipherAES::DecryptXTS (byte *data, uint64 length, uint64 startDataUnitNo) const
+ void CipherAES::DecryptXTS (uint8 *data, uint64 length, uint64 startDataUnitNo) const
{
xts_decrypt (data, data, length, startDataUnitNo, (aes_decrypt_ctx *) (ScheduledKey.Ptr() + sizeof (aes_encrypt_ctx)));
}
- void CipherAES::SetCipherKeyXTS (const byte *key)
+ void CipherAES::SetCipherKeyXTS (const uint8 *key)
{
if (xts_encrypt_key256 (key, (aes_encrypt_ctx *) ScheduledKey.Ptr()) != EXIT_SUCCESS)
throw CipherInitError (SRC_POS);
@@ -261,7 +261,7 @@ namespace VeraCrypt
#endif
}
- void CipherAES::SetCipherKey (const byte *key)
+ void CipherAES::SetCipherKey (const uint8 *key)
{
if (aes_encrypt_key256 (key, (aes_encrypt_ctx *) ScheduledKey.Ptr()) != EXIT_SUCCESS)
throw CipherInitError (SRC_POS);
@@ -272,12 +272,12 @@ namespace VeraCrypt
#ifndef WOLFCRYPT_BACKEND
// Serpent
- void CipherSerpent::Decrypt (byte *data) const
+ void CipherSerpent::Decrypt (uint8 *data) const
{
serpent_decrypt (data, data, ScheduledKey);
}
- void CipherSerpent::Encrypt (byte *data) const
+ void CipherSerpent::Encrypt (uint8 *data) const
{
serpent_encrypt (data, data, ScheduledKey);
}
@@ -287,12 +287,12 @@ namespace VeraCrypt
return 140*4;
}
- void CipherSerpent::SetCipherKey (const byte *key)
+ void CipherSerpent::SetCipherKey (const uint8 *key)
{
serpent_set_key (key, ScheduledKey);
}
- void CipherSerpent::EncryptBlocks (byte *data, size_t blockCount) const
+ void CipherSerpent::EncryptBlocks (uint8 *data, size_t blockCount) const
{
if (!Initialized)
throw NotInitialized (SRC_POS);
@@ -308,7 +308,7 @@ namespace VeraCrypt
Cipher::EncryptBlocks (data, blockCount);
}
- void CipherSerpent::DecryptBlocks (byte *data, size_t blockCount) const
+ void CipherSerpent::DecryptBlocks (uint8 *data, size_t blockCount) const
{
if (!Initialized)
throw NotInitialized (SRC_POS);
@@ -343,12 +343,12 @@ namespace VeraCrypt
// Twofish
- void CipherTwofish::Decrypt (byte *data) const
+ void CipherTwofish::Decrypt (uint8 *data) const
{
twofish_decrypt ((TwofishInstance *) ScheduledKey.Ptr(), (unsigned int *)data, (unsigned int *)data);
}
- void CipherTwofish::Encrypt (byte *data) const
+ void CipherTwofish::Encrypt (uint8 *data) const
{
twofish_encrypt ((TwofishInstance *) ScheduledKey.Ptr(), (unsigned int *)data, (unsigned int *)data);
}
@@ -358,12 +358,12 @@ namespace VeraCrypt
return TWOFISH_KS;
}
- void CipherTwofish::SetCipherKey (const byte *key)
+ void CipherTwofish::SetCipherKey (const uint8 *key)
{
twofish_set_key ((TwofishInstance *) ScheduledKey.Ptr(), (unsigned int *) key);
}
- void CipherTwofish::EncryptBlocks (byte *data, size_t blockCount) const
+ void CipherTwofish::EncryptBlocks (uint8 *data, size_t blockCount) const
{
if (!Initialized)
throw NotInitialized (SRC_POS);
@@ -375,7 +375,7 @@ namespace VeraCrypt
#endif
}
- void CipherTwofish::DecryptBlocks (byte *data, size_t blockCount) const
+ void CipherTwofish::DecryptBlocks (uint8 *data, size_t blockCount) const
{
if (!Initialized)
throw NotInitialized (SRC_POS);
@@ -397,12 +397,12 @@ namespace VeraCrypt
}
// Camellia
- void CipherCamellia::Decrypt (byte *data) const
+ void CipherCamellia::Decrypt (uint8 *data) const
{
camellia_decrypt (data, data, ScheduledKey.Ptr());
}
- void CipherCamellia::Encrypt (byte *data) const
+ void CipherCamellia::Encrypt (uint8 *data) const
{
camellia_encrypt (data, data, ScheduledKey.Ptr());
}
@@ -412,12 +412,12 @@ namespace VeraCrypt
return CAMELLIA_KS;
}
- void CipherCamellia::SetCipherKey (const byte *key)
+ void CipherCamellia::SetCipherKey (const uint8 *key)
{
camellia_set_key (key, ScheduledKey.Ptr());
}
- void CipherCamellia::EncryptBlocks (byte *data, size_t blockCount) const
+ void CipherCamellia::EncryptBlocks (uint8 *data, size_t blockCount) const
{
if (!Initialized)
throw NotInitialized (SRC_POS);
@@ -429,7 +429,7 @@ namespace VeraCrypt
#endif
}
- void CipherCamellia::DecryptBlocks (byte *data, size_t blockCount) const
+ void CipherCamellia::DecryptBlocks (uint8 *data, size_t blockCount) const
{
if (!Initialized)
throw NotInitialized (SRC_POS);
@@ -451,12 +451,12 @@ namespace VeraCrypt
}
// Kuznyechik
- void CipherKuznyechik::Decrypt (byte *data) const
+ void CipherKuznyechik::Decrypt (uint8 *data) const
{
kuznyechik_decrypt_block (data, data, (kuznyechik_kds *) ScheduledKey.Ptr());
}
- void CipherKuznyechik::Encrypt (byte *data) const
+ void CipherKuznyechik::Encrypt (uint8 *data) const
{
kuznyechik_encrypt_block (data, data, (kuznyechik_kds *) ScheduledKey.Ptr());
}
@@ -466,11 +466,11 @@ namespace VeraCrypt
return KUZNYECHIK_KS;
}
- void CipherKuznyechik::SetCipherKey (const byte *key)
+ void CipherKuznyechik::SetCipherKey (const uint8 *key)
{
kuznyechik_set_key (key, (kuznyechik_kds *) ScheduledKey.Ptr());
}
- void CipherKuznyechik::EncryptBlocks (byte *data, size_t blockCount) const
+ void CipherKuznyechik::EncryptBlocks (uint8 *data, size_t blockCount) const
{
if (!Initialized)
throw NotInitialized (SRC_POS);
@@ -486,7 +486,7 @@ namespace VeraCrypt
Cipher::EncryptBlocks (data, blockCount);
}
- void CipherKuznyechik::DecryptBlocks (byte *data, size_t blockCount) const
+ void CipherKuznyechik::DecryptBlocks (uint8 *data, size_t blockCount) const
{
if (!Initialized)
throw NotInitialized (SRC_POS);