aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-01-04 02:42:24 -0500
committerJack Lloyd <[email protected]>2016-01-04 02:42:24 -0500
commitb2722fd321dcefcfc7111cc8185bb9cdc3f5e112 (patch)
treed8c184508348206591f5eb8dd1680239c6fa18b0 /src/lib/pubkey
parente61e64e37393be1827a9db27c95e4cc9d4af43dd (diff)
Add ECDH via OpenSSL
Expose provider param in PK_Key_Agreement API Handle multiple providers in key agreement tests Fix some funky formatting of P-521 EC points in ecdh.vec which was being rejected by OpenSSL; for whatever reason the CAVS file had the affine coords with far more leading zeros than necessary.
Diffstat (limited to 'src/lib/pubkey')
-rw-r--r--src/lib/pubkey/pubkey.cpp6
-rw-r--r--src/lib/pubkey/pubkey.h5
2 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/pubkey/pubkey.cpp b/src/lib/pubkey/pubkey.cpp
index e870dfdec..3d09e44d5 100644
--- a/src/lib/pubkey/pubkey.cpp
+++ b/src/lib/pubkey/pubkey.cpp
@@ -99,9 +99,11 @@ secure_vector<byte> PK_KEM_Decryptor::decrypt(const byte encap_key[],
salt, salt_len);
}
-PK_Key_Agreement::PK_Key_Agreement(const Private_Key& key, const std::string& kdf)
+PK_Key_Agreement::PK_Key_Agreement(const Private_Key& key,
+ const std::string& kdf,
+ const std::string& provider)
{
- m_op.reset(get_pk_op<PK_Ops::Key_Agreement>("Key agreement", key, kdf));
+ m_op.reset(get_pk_op<PK_Ops::Key_Agreement>("Key agreement", key, kdf, provider));
}
SymmetricKey PK_Key_Agreement::derive_key(size_t key_len,
diff --git a/src/lib/pubkey/pubkey.h b/src/lib/pubkey/pubkey.h
index a8caf58ac..bfcde2190 100644
--- a/src/lib/pubkey/pubkey.h
+++ b/src/lib/pubkey/pubkey.h
@@ -325,8 +325,11 @@ class BOTAN_DLL PK_Key_Agreement
* Construct a PK Key Agreement.
* @param key the key to use
* @param kdf name of the KDF to use (or 'Raw' for no KDF)
+ * @param provider the algo provider to use (or empty for default)
*/
- PK_Key_Agreement(const Private_Key& key, const std::string& kdf);
+ PK_Key_Agreement(const Private_Key& key,
+ const std::string& kdf,
+ const std::string& provider = "");
/*
* Perform Key Agreement Operation