diff options
Diffstat (limited to 'src/pk_pad/eme1/eme1.cpp')
-rw-r--r-- | src/pk_pad/eme1/eme1.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/pk_pad/eme1/eme1.cpp b/src/pk_pad/eme1/eme1.cpp index 69251605f..57275d4f9 100644 --- a/src/pk_pad/eme1/eme1.cpp +++ b/src/pk_pad/eme1/eme1.cpp @@ -15,7 +15,7 @@ namespace Botan { /* * EME1 Pad Operation */ -SecureVector<byte> EME1::pad(const byte in[], size_t in_length, +secure_vector<byte> EME1::pad(const byte in[], size_t in_length, size_t key_length, RandomNumberGenerator& rng) const { @@ -24,7 +24,7 @@ SecureVector<byte> EME1::pad(const byte in[], size_t in_length, if(in_length > key_length - 2*Phash.size() - 1) throw Invalid_Argument("EME1: Input is too large"); - SecureVector<byte> out(key_length); + secure_vector<byte> out(key_length); rng.randomize(&out[0], Phash.size()); @@ -44,7 +44,7 @@ SecureVector<byte> EME1::pad(const byte in[], size_t in_length, /* * EME1 Unpad Operation */ -SecureVector<byte> EME1::unpad(const byte in[], size_t in_length, +secure_vector<byte> EME1::unpad(const byte in[], size_t in_length, size_t key_length) const { /* @@ -65,7 +65,7 @@ SecureVector<byte> EME1::unpad(const byte in[], size_t in_length, if(in_length > key_length) in_length = 0; - SecureVector<byte> input(key_length); + secure_vector<byte> input(key_length); buffer_insert(input, key_length - in_length, in, in_length); mgf->mask(&input[Phash.size()], input.size() - Phash.size(), @@ -104,8 +104,7 @@ SecureVector<byte> EME1::unpad(const byte in[], size_t in_length, if(bad_input) throw Decoding_Error("Invalid EME1 encoding"); - return SecureVector<byte>(input + delim_idx + 1, - input.size() - delim_idx - 1); + return secure_vector<byte>(&input[delim_idx + 1], &input[input.size()]); } /* |