diff options
author | lloyd <[email protected]> | 2015-03-14 04:31:24 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2015-03-14 04:31:24 +0000 |
commit | ccfcb3af8b8404f998aba895ddfc7f3d4405fdd5 (patch) | |
tree | 9b4d1ba62249681622051a92758a3dc3c82bfd6d /src/lib/pubkey/curve25519 | |
parent | d8ab5899e9f8c8d9987cec78fed34365b5ad0ee9 (diff) |
In PK encrypt/decrypt move pad calls to the operation. This allows an
op to use a padding scheme outside of our knowledge or control, for
instance an OpenSSL RSA op which uses OpenSSL's padding code. Similar
change for key agreement and KDFs for the same reason.
Add an EME_Raw type; previously this operation was implicit in the
code in pubkey.cpp
Diffstat (limited to 'src/lib/pubkey/curve25519')
-rw-r--r-- | src/lib/pubkey/curve25519/curve25519.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/pubkey/curve25519/curve25519.cpp b/src/lib/pubkey/curve25519/curve25519.cpp index 8fdd5b2c6..d6934748b 100644 --- a/src/lib/pubkey/curve25519/curve25519.cpp +++ b/src/lib/pubkey/curve25519/curve25519.cpp @@ -117,15 +117,16 @@ namespace { /** * Curve25519 operation */ -class Curve25519_KA_Operation : public PK_Ops::Key_Agreement +class Curve25519_KA_Operation : public PK_Ops::Key_Agreement_with_KDF { public: typedef Curve25519_PrivateKey Key_Type; - Curve25519_KA_Operation(const Curve25519_PrivateKey& key, const std::string&) : + Curve25519_KA_Operation(const Curve25519_PrivateKey& key, const std::string& kdf) : + PK_Ops::Key_Agreement_with_KDF(kdf), m_key(key) {} - secure_vector<byte> agree(const byte w[], size_t w_len) + secure_vector<byte> raw_agree(const byte w[], size_t w_len) { return m_key.agree(w, w_len); } |