diff options
author | Jack Lloyd <[email protected]> | 2018-07-24 13:58:05 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-07-24 13:58:05 -0400 |
commit | f305cfa4855e8ccf373e545c619a4c9e9b4502ad (patch) | |
tree | c44ceff04dd2fa8547998ef20d4dcbf0b807621a /src | |
parent | 19e5fd686c6aa9961d32fb71c93e245bb69011d6 (diff) |
Use Alloc templates instead of overriding for specific vector types
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/pubkey/pubkey.h | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/lib/pubkey/pubkey.h b/src/lib/pubkey/pubkey.h index a33142079..64bb1cc9e 100644 --- a/src/lib/pubkey/pubkey.h +++ b/src/lib/pubkey/pubkey.h @@ -217,19 +217,12 @@ class BOTAN_PUBLIC_API(2,0) PK_Signer final * @param rng the rng to use * @return signature */ - std::vector<uint8_t> sign_message(const std::vector<uint8_t>& in, - RandomNumberGenerator& rng) - { return sign_message(in.data(), in.size(), rng); } - - /** - * Sign a message. - * @param in the message to sign - * @param rng the rng to use - * @return signature - */ - std::vector<uint8_t> sign_message(const secure_vector<uint8_t>& in, - RandomNumberGenerator& rng) - { return sign_message(in.data(), in.size(), rng); } + template<typename Alloc> + std::vector<uint8_t> sign_message(const std::vector<uint8_t, Alloc>& in, + RandomNumberGenerator& rng) + { + return sign_message(in.data(), in.size(), rng); + } /** * Add a message part (single byte). @@ -248,7 +241,11 @@ class BOTAN_PUBLIC_API(2,0) PK_Signer final * Add a message part. * @param in the message part to add */ - void update(const std::vector<uint8_t>& in) { update(in.data(), in.size()); } + template<typename Alloc> + void update(const std::vector<uint8_t, Alloc>& in) + { + update(in.data(), in.size()); + } /** * Add a message part. @@ -347,8 +344,11 @@ class BOTAN_PUBLIC_API(2,0) PK_Verifier final * signature to be verified. * @param in the new message part */ - void update(const std::vector<uint8_t>& in) - { update(in.data(), in.size()); } + template<typename Alloc> + void update(const std::vector<uint8_t, Alloc>& in) + { + update(in.data(), in.size()); + } /** * Add a message part of the message corresponding to the |