9 #include <botan/internal/pk_ops_impl.h>
10 #include <botan/workfactor.h>
11 #include <botan/pow_mod.h>
12 #include <botan/blinding.h>
87 PK_Ops::Key_Agreement_with_KDF(kdf),
92 [](const
BigInt& k) {
return k; },
96 secure_vector<uint8_t> raw_agree(
const uint8_t w[],
size_t w_len)
override;
104 secure_vector<uint8_t> DH_KA_Operation::raw_agree(
const uint8_t w[],
size_t w_len)
108 if(input <= 1 || input >=
m_p - 1)
109 throw Invalid_Argument(
"DH agreement - invalid key provided");
118 std::unique_ptr<PK_Ops::Key_Agreement>
120 const std::string& params,
121 const std::string& provider)
const
123 if(provider ==
"base" || provider.empty())
124 return std::unique_ptr<PK_Ops::Key_Agreement>(
new DH_KA_Operation(*
this, params, rng));
size_t dl_exponent_size(size_t bits)
void randomize(RandomNumberGenerator &rng, size_t bitsize, bool set_high_bit=true)
const BigInt & group_p() const
DH_PrivateKey(const AlgorithmIdentifier &alg_id, const secure_vector< uint8_t > &key_bits)
std::vector< T, secure_allocator< T >> secure_vector
BigInt unblind(const BigInt &x) const
std::vector< T > unlock(const secure_vector< T > &in)
std::unique_ptr< PK_Ops::Key_Agreement > create_key_agreement_op(RandomNumberGenerator &rng, const std::string ¶ms, const std::string &provider) const override
BigInt inverse_mod(const BigInt &n, const BigInt &mod)
std::vector< uint8_t > public_value() const
BigInt blind(const BigInt &x) const
BigInt power_mod(const BigInt &base, const BigInt &exp, const BigInt &mod)
Fixed_Exponent_Power_Mod m_powermod_x_p
static secure_vector< uint8_t > encode_1363(const BigInt &n, size_t bytes)
const BigInt & group_g() const
std::vector< uint8_t > public_value() const override
static BigInt decode(const uint8_t buf[], size_t length, Base base=Binary)
std::string algo_name() const override