|
Botan
1.11.4
|
#include <dh.h>
Protected Member Functions | |
| void | gen_check (RandomNumberGenerator &rng) const |
| virtual void | load_check (RandomNumberGenerator &rng) const |
| void | load_check (RandomNumberGenerator &rng) const |
Protected Attributes | |
| DL_Group | group |
| BigInt | x |
| BigInt | y |
| Botan::DH_PrivateKey::DH_PrivateKey | ( | const AlgorithmIdentifier & | alg_id, |
| const secure_vector< byte > & | key_bits, | ||
| RandomNumberGenerator & | rng | ||
| ) |
Load a DH private key
| alg_id | the algorithm id |
| key_bits | the subject public key |
| rng | a random number generator |
Definition at line 60 of file dh.cpp.
References Botan::DL_Scheme_PublicKey::group_g(), Botan::DL_Scheme_PublicKey::group_p(), Botan::Private_Key::load_check(), Botan::power_mod(), Botan::DL_Scheme_PrivateKey::x, and Botan::DL_Scheme_PublicKey::y.
| Botan::DH_PrivateKey::DH_PrivateKey | ( | RandomNumberGenerator & | rng, |
| const DL_Group & | grp, | ||
| const BigInt & | x = 0 |
||
| ) |
Construct a private key with predetermined value.
| rng | random number generator to use |
| grp | the group to be used in the key |
| x | the key's secret value (or if zero, generate a new key) |
Definition at line 35 of file dh.cpp.
References Botan::BigInt::bits(), Botan::dl_work_factor(), Botan::Private_Key::gen_check(), Botan::DL_Scheme_PublicKey::group, Botan::DL_Scheme_PublicKey::group_g(), Botan::DL_Scheme_PublicKey::group_p(), Botan::Private_Key::load_check(), Botan::power_mod(), Botan::BigInt::randomize(), Botan::DL_Scheme_PrivateKey::x, and Botan::DL_Scheme_PublicKey::y.
|
inlinevirtualinherited |
Get the name of the underlying public key scheme.
Implements Botan::Public_Key.
|
virtualinherited |
Implements Botan::Public_Key.
Definition at line 21 of file dl_algo.cpp.
References Botan::DL_Group::DER_encode(), Botan::Public_Key::get_oid(), Botan::DL_Scheme_PublicKey::group, and Botan::DL_Scheme_PublicKey::group_format().
|
virtualinherited |
Test the key values for consistency.
| rng | rng to use |
| strong | whether to perform strong and lengthy version of the test |
Implements Botan::Public_Key.
Reimplemented in Botan::DL_Scheme_PrivateKey, Botan::DSA_PrivateKey, Botan::ElGamal_PrivateKey, and Botan::NR_PrivateKey.
Definition at line 58 of file dl_algo.cpp.
References Botan::DL_Scheme_PublicKey::group, Botan::DL_Scheme_PublicKey::group_p(), and Botan::DL_Group::verify_group().
|
virtualinherited |
Test the key values for consistency.
| rng | rng to use |
| strong | whether to perform strong and lengthy version of the test |
Reimplemented from Botan::DL_Scheme_PublicKey.
Reimplemented in Botan::DSA_PrivateKey, Botan::ElGamal_PrivateKey, and Botan::NR_PrivateKey.
Definition at line 71 of file dl_algo.cpp.
References Botan::DL_Scheme_PublicKey::group, Botan::DL_Scheme_PublicKey::group_g(), Botan::DL_Scheme_PublicKey::group_p(), Botan::power_mod(), Botan::DL_Group::verify_group(), Botan::DL_Scheme_PrivateKey::x, and Botan::DL_Scheme_PublicKey::y.
Referenced by Botan::ElGamal_PrivateKey::check_key(), Botan::NR_PrivateKey::check_key(), and Botan::DSA_PrivateKey::check_key().
|
overridevirtualinherited |
Return the estimated strength of the underlying key against the best currently known attack. Note that this ignores anything but pure attacks against the key itself and do not take into account padding schemes, usage mistakes, etc which might reduce the strength. However it does suffice to provide an upper bound.
Implements Botan::Public_Key.
Definition at line 16 of file dl_algo.cpp.
References Botan::BigInt::bits(), Botan::dl_work_factor(), Botan::DL_Group::get_p(), and Botan::DL_Scheme_PublicKey::group.
|
protectedinherited |
Self-test after generating a key
| rng | a random number generator |
Definition at line 49 of file pk_keys.cpp.
References Botan::Public_Key::algo_name(), and Botan::Public_Key::check_key().
Referenced by DH_PrivateKey(), Botan::DSA_PrivateKey::DSA_PrivateKey(), Botan::ElGamal_PrivateKey::ElGamal_PrivateKey(), Botan::NR_PrivateKey::NR_PrivateKey(), Botan::RSA_PrivateKey::RSA_PrivateKey(), and Botan::RW_PrivateKey::RW_PrivateKey().
|
inlineinherited |
|
virtualinherited |
Get the OID of the underlying public key scheme.
Definition at line 17 of file pk_keys.cpp.
References Botan::Public_Key::algo_name(), and Botan::OIDS::lookup().
Referenced by Botan::DL_Scheme_PublicKey::algorithm_identifier(), Botan::IF_Scheme_PublicKey::algorithm_identifier(), Botan::GOST_3410_PublicKey::algorithm_identifier(), and Botan::EC_PublicKey::algorithm_identifier().
|
inlineinherited |
Get the secret key x.
Definition at line 97 of file dl_algo.h.
Referenced by Botan::ElGamal_Decryption_Operation::ElGamal_Decryption_Operation().
|
inlineinherited |
Get the public value y with y = g^x mod p where x is the secret key.
Definition at line 38 of file dl_algo.h.
Referenced by Botan::ElGamal_Encryption_Operation::ElGamal_Encryption_Operation().
|
inlinevirtualinherited |
Get the underlying groups encoding format.
Implements Botan::DL_Scheme_PublicKey.
Definition at line 29 of file dh.h.
References Botan::DL_Group::ANSI_X9_42.
|
inlineinherited |
Get the generator g of the underlying DL group.
Definition at line 56 of file dl_algo.h.
Referenced by Botan::DL_Scheme_PrivateKey::check_key(), DH_PrivateKey(), Botan::DSA_PrivateKey::DSA_PrivateKey(), Botan::DSA_Verification_Operation::DSA_Verification_Operation(), Botan::ElGamal_Encryption_Operation::ElGamal_Encryption_Operation(), Botan::ElGamal_PrivateKey::ElGamal_PrivateKey(), Botan::NR_PrivateKey::NR_PrivateKey(), and Botan::NR_Verification_Operation::NR_Verification_Operation().
|
inlineinherited |
Get the prime p of the underlying DL group.
Definition at line 44 of file dl_algo.h.
Referenced by Botan::DL_Scheme_PublicKey::check_key(), Botan::DL_Scheme_PrivateKey::check_key(), DH_PrivateKey(), Botan::DSA_PrivateKey::DSA_PrivateKey(), Botan::DSA_Verification_Operation::DSA_Verification_Operation(), Botan::ElGamal_Decryption_Operation::ElGamal_Decryption_Operation(), Botan::ElGamal_Encryption_Operation::ElGamal_Encryption_Operation(), Botan::ElGamal_PrivateKey::ElGamal_PrivateKey(), Botan::NR_PrivateKey::NR_PrivateKey(), Botan::NR_Verification_Operation::NR_Verification_Operation(), and Botan::DH_PublicKey::public_value().
|
inlineinherited |
Get the prime q of the underlying DL group.
Definition at line 50 of file dl_algo.h.
Referenced by Botan::NR_PrivateKey::check_key(), Botan::DSA_PrivateKey::check_key(), Botan::DSA_PrivateKey::DSA_PrivateKey(), Botan::DSA_Verification_Operation::DSA_Verification_Operation(), Botan::NR_PrivateKey::NR_PrivateKey(), and Botan::NR_Verification_Operation::NR_Verification_Operation().
|
protectedvirtualinherited |
Self-test after loading a key
| rng | a random number generator |
Reimplemented in Botan::Private_Key.
Definition at line 31 of file pk_keys.cpp.
References Botan::Public_Key::algo_name(), and Botan::Public_Key::check_key().
|
protectedvirtualinherited |
Self-test after loading a key
| rng | a random number generator |
Reimplemented from Botan::Public_Key.
Definition at line 40 of file pk_keys.cpp.
References Botan::Public_Key::algo_name(), and Botan::Public_Key::check_key().
Referenced by DH_PrivateKey(), Botan::DSA_PrivateKey::DSA_PrivateKey(), Botan::ElGamal_PrivateKey::ElGamal_PrivateKey(), Botan::IF_Scheme_PrivateKey::IF_Scheme_PrivateKey(), and Botan::NR_PrivateKey::NR_PrivateKey().
|
inlinevirtualinherited |
Get the maximum message size in bits supported by this public key.
Implements Botan::Public_Key.
|
inlinevirtualinherited |
Find out the message part size supported by this scheme/key.
Reimplemented in Botan::GOST_3410_PublicKey, Botan::ECDSA_PublicKey, Botan::NR_PublicKey, and Botan::DSA_PublicKey.
|
inlinevirtualinherited |
Find out the number of message parts supported by this scheme.
Reimplemented in Botan::GOST_3410_PublicKey, Botan::ECDSA_PublicKey, Botan::NR_PublicKey, and Botan::DSA_PublicKey.
Definition at line 61 of file pk_keys.h.
Referenced by Botan::EAC_Signed_Object::check_signature(), Botan::X509_Object::check_signature(), and Botan::choose_sig_format().
|
inlinevirtualinherited |
Reimplemented in Botan::GOST_3410_PrivateKey.
Definition at line 109 of file pk_keys.h.
Referenced by Botan::PKCS8::BER_encode().
|
virtualinherited |
Implements Botan::Private_Key.
Definition at line 41 of file dl_algo.cpp.
References Botan::DER_Encoder::encode(), Botan::DER_Encoder::get_contents(), and Botan::DL_Scheme_PrivateKey::x.
|
pure virtualinherited |
Implemented in Botan::EC_PrivateKey, Botan::DL_Scheme_PrivateKey, and Botan::IF_Scheme_PrivateKey.
Referenced by Botan::PKCS8::BER_encode().
|
virtual |
Implements Botan::PK_Key_Agreement_Key.
Definition at line 74 of file dh.cpp.
References Botan::DH_PublicKey::public_value().
Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange().
|
virtualinherited |
Implements Botan::Public_Key.
Definition at line 27 of file dl_algo.cpp.
References Botan::DER_Encoder::encode(), Botan::DER_Encoder::get_contents_unlocked(), and Botan::DL_Scheme_PublicKey::y.
|
protectedinherited |
The DL group
Definition at line 81 of file dl_algo.h.
Referenced by Botan::DL_Scheme_PublicKey::algorithm_identifier(), Botan::DL_Scheme_PublicKey::check_key(), Botan::DL_Scheme_PrivateKey::check_key(), DH_PrivateKey(), Botan::DH_PublicKey::DH_PublicKey(), Botan::DL_Scheme_PrivateKey::DL_Scheme_PrivateKey(), Botan::DL_Scheme_PublicKey::DL_Scheme_PublicKey(), Botan::DSA_PrivateKey::DSA_PrivateKey(), Botan::DSA_PublicKey::DSA_PublicKey(), Botan::ElGamal_PrivateKey::ElGamal_PrivateKey(), Botan::ElGamal_PublicKey::ElGamal_PublicKey(), Botan::DL_Scheme_PublicKey::estimated_strength(), Botan::NR_PrivateKey::NR_PrivateKey(), and Botan::NR_PublicKey::NR_PublicKey().
|
protectedinherited |
The DL private key
Definition at line 111 of file dl_algo.h.
Referenced by Botan::NR_PrivateKey::check_key(), Botan::DSA_PrivateKey::check_key(), Botan::DL_Scheme_PrivateKey::check_key(), DH_PrivateKey(), Botan::DL_Scheme_PrivateKey::DL_Scheme_PrivateKey(), Botan::DSA_PrivateKey::DSA_PrivateKey(), Botan::ElGamal_PrivateKey::ElGamal_PrivateKey(), Botan::NR_PrivateKey::NR_PrivateKey(), and Botan::DL_Scheme_PrivateKey::pkcs8_private_key().
|
protectedinherited |
The DL public key
Definition at line 76 of file dl_algo.h.
Referenced by Botan::DL_Scheme_PrivateKey::check_key(), DH_PrivateKey(), Botan::DH_PublicKey::DH_PublicKey(), Botan::DL_Scheme_PublicKey::DL_Scheme_PublicKey(), Botan::DSA_PrivateKey::DSA_PrivateKey(), Botan::DSA_PublicKey::DSA_PublicKey(), Botan::ElGamal_PrivateKey::ElGamal_PrivateKey(), Botan::ElGamal_PublicKey::ElGamal_PublicKey(), Botan::NR_PrivateKey::NR_PrivateKey(), Botan::NR_PublicKey::NR_PublicKey(), Botan::DH_PublicKey::public_value(), and Botan::DL_Scheme_PublicKey::x509_subject_public_key().
1.8.3.1