|
Botan
1.11.15
|
#include <oaep.h>
Public Types | |
| typedef SCAN_Name | Spec |
Public Member Functions | |
| secure_vector< byte > | decode (const byte in[], size_t in_length, size_t key_length) const |
| secure_vector< byte > | decode (const secure_vector< byte > &in, size_t key_length) const |
| secure_vector< byte > | encode (const byte in[], size_t in_length, size_t key_length, RandomNumberGenerator &rng) const |
| secure_vector< byte > | encode (const secure_vector< byte > &in, size_t key_length, RandomNumberGenerator &rng) const |
| size_t | maximum_input_size (size_t) const |
| OAEP (HashFunction *hash, const std::string &P="") | |
Static Public Member Functions | |
| static OAEP * | make (const Spec &spec) |
OAEP (called EME1 in IEEE 1363 and in earlier versions of the library)
typedef SCAN_Name Botan::EME::Spec [inherited] |
| Botan::OAEP::OAEP | ( | HashFunction * | hash, |
| const std::string & | P = "" |
||
| ) |
| secure_vector< byte > Botan::EME::decode | ( | const byte | in[], |
| size_t | in_length, | ||
| size_t | key_length | ||
| ) | const [inherited] |
| secure_vector< byte > Botan::EME::decode | ( | const secure_vector< byte > & | in, |
| size_t | key_length | ||
| ) | const [inherited] |
| secure_vector< byte > Botan::EME::encode | ( | const byte | in[], |
| size_t | in_length, | ||
| size_t | key_length, | ||
| RandomNumberGenerator & | rng | ||
| ) | const [inherited] |
| secure_vector< byte > Botan::EME::encode | ( | const secure_vector< byte > & | in, |
| size_t | key_length, | ||
| RandomNumberGenerator & | rng | ||
| ) | const [inherited] |
| OAEP * Botan::OAEP::make | ( | const Spec & | spec | ) | [static] |
Definition at line 16 of file oaep.cpp.
References Botan::SCAN_Name::algo_name(), Botan::SCAN_Name::arg(), Botan::SCAN_Name::arg_count(), Botan::SCAN_Name::arg_count_between(), and OAEP().
{
if(request.algo_name() == "OAEP" && request.arg_count_between(1, 2))
{
auto& hashes = Algo_Registry<HashFunction>::global_registry();
if(request.arg_count() == 1 ||
(request.arg_count() == 2 && request.arg(1) == "MGF1"))
{
if(HashFunction* hash = hashes.make(request.arg(0)))
return new OAEP(hash);
}
}
return nullptr;
}
| size_t Botan::OAEP::maximum_input_size | ( | size_t | keybits | ) | const [virtual] |
Return the maximum input size in bytes we can support
| keybits | the size of the key in bits |
Implements Botan::EME.
Definition at line 139 of file oaep.cpp.
{
if(keybits / 8 > 2*m_Phash.size() + 1)
return ((keybits / 8) - 2*m_Phash.size() - 1);
else
return 0;
}
1.7.6.1