aboutsummaryrefslogtreecommitdiffstats
path: root/src/modes
diff options
context:
space:
mode:
Diffstat (limited to 'src/modes')
-rw-r--r--src/modes/cbc/cbc.cpp4
-rw-r--r--src/modes/cts/cts.h4
-rw-r--r--src/modes/eax/eax.cpp4
-rw-r--r--src/modes/eax/eax_dec.cpp4
-rw-r--r--src/modes/ecb/ecb.cpp16
-rw-r--r--src/modes/modebase.cpp4
-rw-r--r--src/modes/xts/xts.cpp16
7 files changed, 26 insertions, 26 deletions
diff --git a/src/modes/cbc/cbc.cpp b/src/modes/cbc/cbc.cpp
index f26d4d6cf..fb7ae8f90 100644
--- a/src/modes/cbc/cbc.cpp
+++ b/src/modes/cbc/cbc.cpp
@@ -90,7 +90,7 @@ CBC_Decryption::CBC_Decryption(BlockCipher* ciph,
{
if(!padder->valid_blocksize(BLOCK_SIZE))
throw Invalid_Block_Size(name(), padder->name());
- temp.create(BLOCK_SIZE);
+ temp.resize(BLOCK_SIZE);
}
/*
@@ -105,7 +105,7 @@ CBC_Decryption::CBC_Decryption(BlockCipher* ciph,
{
if(!padder->valid_blocksize(BLOCK_SIZE))
throw Invalid_Block_Size(name(), padder->name());
- temp.create(BLOCK_SIZE);
+ temp.resize(BLOCK_SIZE);
set_key(key);
set_iv(iv);
}
diff --git a/src/modes/cts/cts.h b/src/modes/cts/cts.h
index 9b17203f3..1a2cae44e 100644
--- a/src/modes/cts/cts.h
+++ b/src/modes/cts/cts.h
@@ -41,13 +41,13 @@ class BOTAN_DLL CTS_Decryption : public BlockCipherMode
public:
CTS_Decryption(BlockCipher* ciph) :
BlockCipherMode(ciph, "CTS", ciph->BLOCK_SIZE, 0, 2)
- { temp.create(BLOCK_SIZE); }
+ { temp.resize(BLOCK_SIZE); }
CTS_Decryption(BlockCipher* ciph,
const SymmetricKey& key,
const InitializationVector& iv) :
BlockCipherMode(ciph, "CTS", ciph->BLOCK_SIZE, 0, 2)
- { set_key(key); set_iv(iv); temp.create(BLOCK_SIZE); }
+ { set_key(key); set_iv(iv); temp.resize(BLOCK_SIZE); }
private:
void write(const byte[], u32bit);
void end_msg();
diff --git a/src/modes/eax/eax.cpp b/src/modes/eax/eax.cpp
index 67465a776..e2ef178b6 100644
--- a/src/modes/eax/eax.cpp
+++ b/src/modes/eax/eax.cpp
@@ -45,8 +45,8 @@ EAX_Base::EAX_Base(BlockCipher* ciph,
if(tag_size % 8 != 0 || TAG_SIZE == 0 || TAG_SIZE > mac->OUTPUT_LENGTH)
throw Invalid_Argument(name() + ": Bad tag size " + to_string(tag_size));
- state.create(BLOCK_SIZE);
- buffer.create(BLOCK_SIZE);
+ state.resize(BLOCK_SIZE);
+ buffer.resize(BLOCK_SIZE);
position = 0;
}
diff --git a/src/modes/eax/eax_dec.cpp b/src/modes/eax/eax_dec.cpp
index b7e5795f7..f395ce437 100644
--- a/src/modes/eax/eax_dec.cpp
+++ b/src/modes/eax/eax_dec.cpp
@@ -19,7 +19,7 @@ EAX_Decryption::EAX_Decryption(BlockCipher* ciph,
u32bit tag_size) :
EAX_Base(ciph, tag_size)
{
- queue.create(2*TAG_SIZE + DEFAULT_BUFFERSIZE);
+ queue.resize(2*TAG_SIZE + DEFAULT_BUFFERSIZE);
queue_start = queue_end = 0;
}
@@ -34,7 +34,7 @@ EAX_Decryption::EAX_Decryption(BlockCipher* ciph,
{
set_key(key);
set_iv(iv);
- queue.create(2*TAG_SIZE + DEFAULT_BUFFERSIZE);
+ queue.resize(2*TAG_SIZE + DEFAULT_BUFFERSIZE);
queue_start = queue_end = 0;
}
diff --git a/src/modes/ecb/ecb.cpp b/src/modes/ecb/ecb.cpp
index 988a8b3f2..bff6d70f4 100644
--- a/src/modes/ecb/ecb.cpp
+++ b/src/modes/ecb/ecb.cpp
@@ -24,8 +24,8 @@ ECB_Encryption::ECB_Encryption(BlockCipher* ciph,
cipher = ciph;
padder = pad;
- plaintext.create(cipher->BLOCK_SIZE);
- ciphertext.create(cipher->BLOCK_SIZE * PARALLEL_BLOCKS);
+ plaintext.resize(cipher->BLOCK_SIZE);
+ ciphertext.resize(cipher->BLOCK_SIZE * PARALLEL_BLOCKS);
position = 0;
}
@@ -40,8 +40,8 @@ ECB_Encryption::ECB_Encryption(BlockCipher* ciph,
cipher = ciph;
padder = pad;
- plaintext.create(cipher->BLOCK_SIZE);
- ciphertext.create(cipher->BLOCK_SIZE * PARALLEL_BLOCKS);
+ plaintext.resize(cipher->BLOCK_SIZE);
+ ciphertext.resize(cipher->BLOCK_SIZE * PARALLEL_BLOCKS);
position = 0;
@@ -124,8 +124,8 @@ ECB_Decryption::ECB_Decryption(BlockCipher* ciph,
cipher = ciph;
padder = pad;
- ciphertext.create(cipher->BLOCK_SIZE);
- plaintext.create(cipher->BLOCK_SIZE * PARALLEL_BLOCKS);
+ ciphertext.resize(cipher->BLOCK_SIZE);
+ plaintext.resize(cipher->BLOCK_SIZE * PARALLEL_BLOCKS);
position = 0;
}
@@ -140,8 +140,8 @@ ECB_Decryption::ECB_Decryption(BlockCipher* ciph,
cipher = ciph;
padder = pad;
- ciphertext.create(cipher->BLOCK_SIZE);
- plaintext.create(cipher->BLOCK_SIZE * PARALLEL_BLOCKS);
+ ciphertext.resize(cipher->BLOCK_SIZE);
+ plaintext.resize(cipher->BLOCK_SIZE * PARALLEL_BLOCKS);
position = 0;
diff --git a/src/modes/modebase.cpp b/src/modes/modebase.cpp
index b048862a4..59ee55a8a 100644
--- a/src/modes/modebase.cpp
+++ b/src/modes/modebase.cpp
@@ -20,8 +20,8 @@ BlockCipherMode::BlockCipherMode(BlockCipher* cipher_ptr,
IV_METHOD(iv_meth), mode_name(cipher_mode_name)
{
cipher = cipher_ptr;
- buffer.create(BUFFER_SIZE);
- state.create(iv_size);
+ buffer.resize(BUFFER_SIZE);
+ state.resize(iv_size);
position = 0;
}
diff --git a/src/modes/xts/xts.cpp b/src/modes/xts/xts.cpp
index 8780ae166..586cc92af 100644
--- a/src/modes/xts/xts.cpp
+++ b/src/modes/xts/xts.cpp
@@ -41,8 +41,8 @@ XTS_Encryption::XTS_Encryption(BlockCipher* ciph) : cipher(ciph)
throw std::invalid_argument("Bad cipher for XTS: " + cipher->name());
cipher2 = cipher->clone();
- tweak.create(cipher->BLOCK_SIZE);
- buffer.create(2 * cipher->BLOCK_SIZE);
+ tweak.resize(cipher->BLOCK_SIZE);
+ buffer.resize(2 * cipher->BLOCK_SIZE);
position = 0;
}
@@ -57,8 +57,8 @@ XTS_Encryption::XTS_Encryption(BlockCipher* ciph,
throw std::invalid_argument("Bad cipher for XTS: " + cipher->name());
cipher2 = cipher->clone();
- tweak.create(cipher->BLOCK_SIZE);
- buffer.create(2 * cipher->BLOCK_SIZE);
+ tweak.resize(cipher->BLOCK_SIZE);
+ buffer.resize(2 * cipher->BLOCK_SIZE);
position = 0;
set_key(key);
@@ -197,8 +197,8 @@ XTS_Decryption::XTS_Decryption(BlockCipher* ciph)
{
cipher = ciph;
cipher2 = ciph->clone();
- tweak.create(cipher->BLOCK_SIZE);
- buffer.create(2 * cipher->BLOCK_SIZE);
+ tweak.resize(cipher->BLOCK_SIZE);
+ buffer.resize(2 * cipher->BLOCK_SIZE);
position = 0;
}
@@ -211,8 +211,8 @@ XTS_Decryption::XTS_Decryption(BlockCipher* ciph,
{
cipher = ciph;
cipher2 = ciph->clone();
- tweak.create(cipher->BLOCK_SIZE);
- buffer.create(2 * cipher->BLOCK_SIZE);
+ tweak.resize(cipher->BLOCK_SIZE);
+ buffer.resize(2 * cipher->BLOCK_SIZE);
position = 0;
set_key(key);