Botan
2.1.0
Crypto and TLS for C++11
|
#include <blowfish.h>
Public Types | |
enum | |
Public Member Functions | |
size_t | block_size () const override |
void | clear () override |
BlockCipher * | clone () const override |
void | decrypt (const uint8_t in[], uint8_t out[]) const |
void | decrypt (uint8_t block[]) const |
template<typename Alloc > | |
void | decrypt (std::vector< uint8_t, Alloc > &block) const |
template<typename Alloc , typename Alloc2 > | |
void | decrypt (const std::vector< uint8_t, Alloc > &in, std::vector< uint8_t, Alloc2 > &out) const |
void | decrypt_n (const uint8_t in[], uint8_t out[], size_t blocks) const override |
void | eks_key_schedule (const uint8_t key[], size_t key_length, const uint8_t salt[16], size_t workfactor) |
void | encrypt (const uint8_t in[], uint8_t out[]) const |
void | encrypt (uint8_t block[]) const |
template<typename Alloc > | |
void | encrypt (std::vector< uint8_t, Alloc > &block) const |
template<typename Alloc , typename Alloc2 > | |
void | encrypt (const std::vector< uint8_t, Alloc > &in, std::vector< uint8_t, Alloc2 > &out) const |
void | encrypt_n (const uint8_t in[], uint8_t out[], size_t blocks) const override |
Key_Length_Specification | key_spec () const override |
size_t | maximum_keylength () const |
size_t | minimum_keylength () const |
std::string | name () const override |
size_t | parallel_bytes () const |
virtual size_t | parallelism () const |
virtual std::string | provider () const |
void | set_key (const SymmetricKey &key) |
template<typename Alloc > | |
void | set_key (const std::vector< uint8_t, Alloc > &key) |
void | set_key (const uint8_t key[], size_t length) |
bool | valid_keylength (size_t length) const |
Static Public Member Functions | |
static std::unique_ptr< BlockCipher > | create (const std::string &algo_spec, const std::string &provider="") |
static std::unique_ptr< BlockCipher > | create_or_throw (const std::string &algo_spec, const std::string &provider="") |
static std::vector< std::string > | providers (const std::string &algo_spec) |
Definition at line 18 of file blowfish.h.
|
inherited |
Definition at line 186 of file block_cipher.h.
|
inlineoverridevirtualinherited |
Implements Botan::BlockCipher.
Definition at line 187 of file block_cipher.h.
|
overridevirtual |
Reset the state.
Implements Botan::SymmetricAlgorithm.
Definition at line 369 of file blowfish.cpp.
References Botan::zap().
|
inlineoverridevirtual |
Implements Botan::BlockCipher.
Definition at line 32 of file blowfish.h.
|
staticinherited |
Create an instance based on a name If provider is empty then best available is chosen.
algo_spec | algorithm name |
provider | provider implementation to choose |
Definition at line 88 of file block_cipher.cpp.
References Botan::SCAN_Name::algo_name(), Botan::SCAN_Name::arg(), Botan::SCAN_Name::arg_as_integer(), Botan::SCAN_Name::arg_count(), Botan::SCAN_Name::arg_count_between(), Botan::BlockCipher::block_size(), BOTAN_UNUSED, Botan::HashFunction::create(), Botan::StreamCipher::create(), hash, and Botan::make_openssl_block_cipher().
Referenced by botan_block_cipher_init(), Botan::MessageAuthenticationCode::create(), Botan::StreamCipher::create(), Botan::BlockCipher::create_or_throw(), Botan::get_aead(), Botan::get_block_cipher(), and Botan::get_cipher_mode().
|
staticinherited |
Create an instance based on a name, or throw if the algo/provider combination cannot be found. If provider is empty then best available is chosen.
Definition at line 285 of file block_cipher.cpp.
References Botan::BlockCipher::create().
Referenced by Botan::make_block_cipher(), Botan::rfc3394_keyunwrap(), Botan::rfc3394_keywrap(), and Botan::TLS::TLS_CBC_HMAC_AEAD_Mode::TLS_CBC_HMAC_AEAD_Mode().
|
inlineinherited |
Decrypt a block.
in | The ciphertext block to be decypted as a byte array. Must be of length block_size(). |
out | The byte array designated to hold the decrypted block. Must be of length block_size(). |
Definition at line 90 of file block_cipher.h.
Referenced by Botan::DESX::decrypt_n(), Botan::XTS_Decryption::finish(), and Botan::CTS_Decryption::finish().
|
inlineinherited |
Decrypt a block.
block | the ciphertext block to be decrypted Must be of length block_size(). Will hold the result when the function has finished. |
Definition at line 107 of file block_cipher.h.
|
inlineinherited |
Decrypt one or more blocks
block | the input/output buffer (multiple of block_size()) |
Definition at line 124 of file block_cipher.h.
|
inlineinherited |
Decrypt one or more blocks
in | the input buffer (multiple of block_size()) |
out | the output buffer (same size as in) |
Definition at line 147 of file block_cipher.h.
|
overridevirtual |
Decrypt one or more blocks
in | the input buffer (multiple of block_size()) |
out | the output buffer (same size as in) |
blocks | the number of blocks to process |
Implements Botan::BlockCipher.
Definition at line 230 of file blowfish.cpp.
References Botan::Block_Cipher_Fixed_Params< 8, 1, 56 >::BLOCK_SIZE, BOTAN_PARALLEL_FOR, Botan::get_byte(), Botan::load_be(), and Botan::store_be().
void Botan::Blowfish::eks_key_schedule | ( | const uint8_t | key[], |
size_t | key_length, | ||
const uint8_t | salt[16], | ||
size_t | workfactor | ||
) |
Modified EKSBlowfish key schedule, used for bcrypt password hashing
Definition at line 291 of file blowfish.cpp.
References Botan::copy_mem(), and Botan::ASN1::to_string().
|
inlineinherited |
Encrypt a block.
in | The plaintext block to be encrypted as a byte array. Must be of length block_size(). |
out | The byte array designated to hold the encrypted block. Must be of length block_size(). |
Definition at line 80 of file block_cipher.h.
Referenced by Botan::aont_package(), Botan::aont_unpackage(), Botan::DESX::encrypt_n(), Botan::XTS_Encryption::finish(), Botan::CTS_Encryption::finish(), Botan::CFB_Encryption::process(), Botan::CBC_Encryption::process(), and Botan::CFB_Decryption::process().
|
inlineinherited |
Encrypt a block.
block | the plaintext block to be encrypted Must be of length block_size(). Will hold the result when the function has finished. |
Definition at line 99 of file block_cipher.h.
|
inlineinherited |
Encrypt one or more blocks
block | the input/output buffer (multiple of block_size()) |
Definition at line 114 of file block_cipher.h.
|
inlineinherited |
Encrypt one or more blocks
in | the input buffer (multiple of block_size()) |
out | the output buffer (same size as in) |
Definition at line 135 of file block_cipher.h.
|
overridevirtual |
Encrypt one or more blocks
in | the input buffer (multiple of block_size()) |
out | the output buffer (same size as in) |
blocks | the number of blocks to process |
Implements Botan::BlockCipher.
Definition at line 198 of file blowfish.cpp.
References Botan::Block_Cipher_Fixed_Params< 8, 1, 56 >::BLOCK_SIZE, BOTAN_PARALLEL_FOR, Botan::get_byte(), Botan::load_be(), and Botan::store_be().
|
inlineoverridevirtualinherited |
Implements Botan::SymmetricAlgorithm.
Definition at line 189 of file block_cipher.h.
|
inlineinherited |
Definition at line 39 of file sym_algo.h.
|
inlineinherited |
Definition at line 47 of file sym_algo.h.
|
inlineoverridevirtual |
Implements Botan::SymmetricAlgorithm.
Definition at line 31 of file blowfish.h.
|
inlineinherited |
Definition at line 62 of file block_cipher.h.
Referenced by Botan::XTS_Mode::update_granularity(), and Botan::CBC_Mode::update_granularity().
|
inlinevirtualinherited |
Reimplemented in Botan::Serpent.
Definition at line 57 of file block_cipher.h.
|
inlinevirtualinherited |
Reimplemented in Botan::AES_256, Botan::AES_192, Botan::Threefish_512, Botan::AES_128, Botan::IDEA, Botan::Serpent, and Botan::Noekeon.
Definition at line 71 of file block_cipher.h.
|
staticinherited |
algo_spec | algorithm name |
Definition at line 295 of file block_cipher.cpp.
Referenced by Botan::get_block_cipher_providers().
|
inlineinherited |
Set the symmetric key of this object.
key | the SymmetricKey to be set. |
Definition at line 66 of file sym_algo.h.
References Botan::OctetString::begin(), and Botan::OctetString::length().
Referenced by Botan::aont_package(), Botan::aont_unpackage(), botan_block_cipher_set_key(), botan_mac_set_key(), and Botan::pbkdf2().
|
inlineinherited |
Definition at line 72 of file sym_algo.h.
|
inlineinherited |
Set the symmetric key of this object.
key | the to be set as a byte array. |
length | in bytes of key param |
Definition at line 82 of file sym_algo.h.
|
inlineinherited |
Check whether a given key length is valid for this algorithm.
length | the key length to be checked. |
Definition at line 57 of file sym_algo.h.
Referenced by Botan::aont_package(), and Botan::aont_unpackage().