aboutsummaryrefslogtreecommitdiffstats
path: root/src/pbe
diff options
context:
space:
mode:
Diffstat (limited to 'src/pbe')
-rw-r--r--src/pbe/pbes1/pbes1.cpp3
-rw-r--r--src/pbe/pbes2/pbes2.cpp7
2 files changed, 3 insertions, 7 deletions
diff --git a/src/pbe/pbes1/pbes1.cpp b/src/pbe/pbes1/pbes1.cpp
index 6e4c3f54d..701e61464 100644
--- a/src/pbe/pbes1/pbes1.cpp
+++ b/src/pbe/pbes1/pbes1.cpp
@@ -94,8 +94,7 @@ void PBE_PKCS5v15::set_key(const std::string& passphrase)
void PBE_PKCS5v15::new_params(RandomNumberGenerator& rng)
{
iterations = 10000;
- salt.resize(8);
- rng.randomize(salt, salt.size());
+ salt = rng.random_vec(8);
}
/*
diff --git a/src/pbe/pbes2/pbes2.cpp b/src/pbe/pbes2/pbes2.cpp
index 5b77acff5..55b3a781a 100644
--- a/src/pbe/pbes2/pbes2.cpp
+++ b/src/pbe/pbes2/pbes2.cpp
@@ -100,11 +100,8 @@ void PBE_PKCS5v20::new_params(RandomNumberGenerator& rng)
iterations = 10000;
key_length = block_cipher->MAXIMUM_KEYLENGTH;
- salt.resize(12);
- rng.randomize(salt, salt.size());
-
- iv.resize(block_cipher->BLOCK_SIZE);
- rng.randomize(iv, iv.size());
+ salt = rng.random_vec(12);
+ iv = rng.random_vec(block_cipher->BLOCK_SIZE);
}
/*