diff options
Diffstat (limited to 'src/pbe/pbes2')
-rw-r--r-- | src/pbe/pbes2/pbes2.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/pbe/pbes2/pbes2.cpp b/src/pbe/pbes2/pbes2.cpp index 752a4fb6d..0036359cc 100644 --- a/src/pbe/pbes2/pbes2.cpp +++ b/src/pbe/pbes2/pbes2.cpp @@ -26,13 +26,8 @@ namespace Botan { */ void PBE_PKCS5v20::write(const byte input[], size_t length) { - while(length) - { - size_t put = std::min(DEFAULT_BUFFERSIZE, length); - pipe.write(input, length); - flush_pipe(true); - length -= put; - } + pipe.write(input, length); + flush_pipe(true); } /* @@ -75,7 +70,7 @@ void PBE_PKCS5v20::flush_pipe(bool safe_to_skip) secure_vector<byte> buffer(DEFAULT_BUFFERSIZE); while(pipe.remaining()) { - size_t got = pipe.read(&buffer[0], buffer.size()); + const size_t got = pipe.read(&buffer[0], buffer.size()); send(buffer, got); } } |