Botan
2.1.0
Crypto and TLS for C++11
|
Namespaces | |
ASN1 | |
Camellia_F | |
Cert_Extension | |
Charset | |
CryptoBox | |
CT | |
FPE | |
HTTP | |
KeyPair | |
OCSP | |
OIDS | |
OS | |
PEM_Code | |
PK_Ops | |
PKCS11 | |
PKCS8 | |
PKIX | |
SHA1_F | |
SHA1_SSE2_F | |
SHA2_32 | |
SHA2_64 | |
stlCompatibilityDetails | |
TLS | |
X509 | |
Functions | |
BigInt | abs (const BigInt &n) |
size_t | almost_montgomery_inverse (BigInt &result, const BigInt &a, const BigInt &p) |
void | aont_package (RandomNumberGenerator &rng, BlockCipher *cipher, const uint8_t input[], size_t input_len, uint8_t output[]) |
void | aont_unpackage (BlockCipher *cipher, const uint8_t input[], size_t input_len, uint8_t output[]) |
void | assertion_failure (const char *expr_str, const char *assertion_made, const char *func, const char *file, int line) |
size_t | base64_decode (uint8_t output[], const char input[], size_t input_length, size_t &input_consumed, bool final_inputs, bool ignore_ws) |
size_t | base64_decode (uint8_t output[], const char input[], size_t input_length, bool ignore_ws) |
size_t | base64_decode (uint8_t output[], const std::string &input, bool ignore_ws) |
secure_vector< uint8_t > | base64_decode (const char input[], size_t input_length, bool ignore_ws) |
secure_vector< uint8_t > | base64_decode (const std::string &input, bool ignore_ws) |
size_t | base64_decode_max_output (size_t input_length) |
size_t | base64_encode (char out[], const uint8_t in[], size_t input_length, size_t &input_consumed, bool final_inputs) |
template<typename Alloc > | |
std::string | base64_encode (const std::vector< uint8_t, Alloc > &input) |
std::string | base64_encode (const uint8_t input[], size_t input_length) |
size_t | base64_encode_max_output (size_t input_length) |
void | bigint_add2 (word x[], size_t x_size, const word y[], size_t y_size) |
word | bigint_add2_nc (word x[], size_t x_size, const word y[], size_t y_size) |
void | bigint_add3 (word z[], const word x[], size_t x_size, const word y[], size_t y_size) |
word | bigint_add3_nc (word z[], const word x[], size_t x_size, const word y[], size_t y_size) |
int32_t | bigint_cmp (const word x[], size_t x_size, const word y[], size_t y_size) |
void | bigint_cnd_abs (word cnd, word x[], size_t size) |
word | bigint_cnd_add (word cnd, word x[], const word y[], size_t size) |
word | bigint_cnd_sub (word cnd, word x[], const word y[], size_t size) |
void | bigint_cnd_swap (word cnd, word x[], word y[], size_t size) |
void | bigint_comba_mul16 (word z[32], const word x[16], const word y[16]) |
void | bigint_comba_mul4 (word z[8], const word x[4], const word y[4]) |
void | bigint_comba_mul6 (word z[12], const word x[6], const word y[6]) |
void | bigint_comba_mul8 (word z[16], const word x[8], const word y[8]) |
void | bigint_comba_mul9 (word z[18], const word x[9], const word y[9]) |
void | bigint_comba_sqr16 (word z[32], const word x[16]) |
void | bigint_comba_sqr4 (word z[8], const word x[4]) |
void | bigint_comba_sqr6 (word z[12], const word x[6]) |
void | bigint_comba_sqr8 (word z[16], const word x[8]) |
void | bigint_comba_sqr9 (word z[18], const word x[9]) |
word | bigint_divop (word n1, word n0, word d) |
void | bigint_linmul2 (word x[], size_t x_size, word y) |
void | bigint_linmul3 (word z[], const word x[], size_t x_size, word y) |
word | bigint_modop (word n1, word n0, word d) |
void | bigint_monty_mul (BigInt &z, const BigInt &x, const BigInt &y, const word p[], size_t p_size, word p_dash, word workspace[]) |
void | bigint_monty_redc (word z[], const word p[], size_t p_size, word p_dash, word workspace[]) |
void | bigint_monty_sqr (BigInt &z, const BigInt &x, const word p[], size_t p_size, word p_dash, word workspace[]) |
void | bigint_mul (BigInt &z, const BigInt &x, const BigInt &y, word workspace[]) |
void | bigint_shl1 (word x[], size_t x_size, size_t word_shift, size_t bit_shift) |
void | bigint_shl2 (word y[], const word x[], size_t x_size, size_t word_shift, size_t bit_shift) |
void | bigint_shr1 (word x[], size_t x_size, size_t word_shift, size_t bit_shift) |
void | bigint_shr2 (word y[], const word x[], size_t x_size, size_t word_shift, size_t bit_shift) |
void | bigint_sqr (word z[], size_t z_size, word workspace[], const word x[], size_t x_size, size_t x_sw) |
word | bigint_sub2 (word x[], size_t x_size, const word y[], size_t y_size) |
void | bigint_sub2_rev (word x[], const word y[], size_t y_size) |
word | bigint_sub3 (word z[], const word x[], size_t x_size, const word y[], size_t y_size) |
uint32_t | bit_size_to_32bit_size (uint32_t bit_size) |
uint32_t | bit_size_to_byte_size (uint32_t bit_size) |
class BOTAN_DLL | BOTAN_DEPRECATED ("LibraryInitializer is no longer required") LibraryInitializer |
template<typename T > | |
void | bswap_4 (T x[4]) |
template<typename T , typename Alloc > | |
size_t | buffer_insert (std::vector< T, Alloc > &buf, size_t buf_offset, const T input[], size_t input_length) |
template<typename T , typename Alloc , typename Alloc2 > | |
size_t | buffer_insert (std::vector< T, Alloc > &buf, size_t buf_offset, const std::vector< T, Alloc2 > &input) |
calendar_point | calendar_value (const std::chrono::system_clock::time_point &time_point) |
uint64_t | carry_shift (const donna128 &a, size_t shift) |
void | CECPQ1_accept (uint8_t shared_key[CECPQ1_SHARED_KEY_BYTES], uint8_t send[CECPQ1_ACCEPT_BYTES], const uint8_t received[CECPQ1_OFFER_BYTES], RandomNumberGenerator &rng) |
void BOTAN_DLL | CECPQ1_accept (uint8_t *shared_key, uint8_t *accept_message, const uint8_t *offer_message, RandomNumberGenerator &rng) |
void BOTAN_DLL | CECPQ1_finish (uint8_t *shared_key, const CECPQ1_key &offer_key, const uint8_t *accept_message) |
void | CECPQ1_finish (uint8_t shared_key[CECPQ1_SHARED_KEY_BYTES], const CECPQ1_key &offer_key, const uint8_t received[CECPQ1_ACCEPT_BYTES]) |
void | CECPQ1_offer (uint8_t send[CECPQ1_OFFER_BYTES], CECPQ1_key *offer_key_output, RandomNumberGenerator &rng) |
void BOTAN_DLL | CECPQ1_offer (uint8_t *offer_message, CECPQ1_key *offer_key_output, RandomNumberGenerator &rng) |
template<typename T > | |
size_t | ceil_log2 (T x) |
bool | check_bcrypt (const std::string &pass, const std::string &hash) |
bool | check_passhash9 (const std::string &pass, const std::string &hash) |
bool | check_prime (const BigInt &n, RandomNumberGenerator &rng) |
size_t | checked_add (size_t x, size_t y, const char *file, int line) |
PK_Signer * | choose_sig_format (const Private_Key &key, RandomNumberGenerator &rng, const std::string &hash_fn, AlgorithmIdentifier &sig_algo) |
size_t | clamp (size_t n, size_t lower_bound, size_t upper_bound) |
std::string BOTAN_DLL | clean_ws (const std::string &s) |
void | clear_bytes (void *ptr, size_t bytes) |
template<typename T > | |
void | clear_mem (T *ptr, size_t n) |
uint64_t | combine_lower (const donna128 &a, size_t s1, const donna128 &b, size_t s2) |
template<typename T > | |
void | copy_mem (T *out, const T *in, size_t n) |
template<typename T > | |
void | copy_out_be (uint8_t out[], size_t out_bytes, const T in[]) |
template<typename T > | |
void | copy_out_le (uint8_t out[], size_t out_bytes, const T in[]) |
template<typename T , typename Alloc > | |
void | copy_out_vec_be (uint8_t out[], size_t out_bytes, const std::vector< T, Alloc > &in) |
template<typename T , typename Alloc > | |
void | copy_out_vec_le (uint8_t out[], size_t out_bytes, const std::vector< T, Alloc > &in) |
AlternativeName | create_alt_name (const Data_Store &info) |
X509_DN | create_dn (const Data_Store &info) |
std::unique_ptr< Private_Key > | create_private_key (const std::string &alg_name, RandomNumberGenerator &rng, const std::string ¶ms) |
BigInt | ct_inverse_mod_odd_modulus (const BigInt &n, const BigInt &mod) |
template<typename T > | |
size_t | ctz (T n) |
void | curve25519_basepoint (uint8_t mypublic[32], const uint8_t secret[32]) |
void BOTAN_DLL | curve25519_donna (uint8_t mypublic[32], const uint8_t secret[32], const uint8_t basepoint[32]) |
void | curve25519_donna (u8 *mypublic, const u8 *secret, const u8 *basepoint) |
gf2m | decode_gf2m (const uint8_t *mem) |
void | divide (const BigInt &x, const BigInt &y_arg, BigInt &q, BigInt &r) |
size_t | dl_exponent_size (size_t bits) |
size_t | dl_work_factor (size_t bits) |
secure_vector< uint8_t > | EC2OSP (const PointGFp &point, uint8_t format) |
size_t | ecp_work_factor (size_t bits) |
uint32_t | encode_gf2m (gf2m to_enc, uint8_t *mem) |
std::string | erase_chars (const std::string &str, const std::set< char > &chars) |
template<typename T > | |
uint16_t | expand_mask_16bit (T tst) |
secure_vector< gf2m > | find_roots_gf2m_decomp (const polyn_gf2m &polyn, uint32_t code_length) |
BigInt | gcd (const BigInt &a, const BigInt &b) |
void | gcm_multiply_clmul (uint8_t x[16], const uint8_t H[16]) |
std::string | generate_bcrypt (const std::string &pass, RandomNumberGenerator &rng, uint16_t work_factor) |
bool | generate_dsa_primes (RandomNumberGenerator &rng, BigInt &p, BigInt &q, size_t pbits, size_t qbits, const std::vector< uint8_t > &seed_c, size_t offset) |
std::vector< uint8_t > | generate_dsa_primes (RandomNumberGenerator &rng, BigInt &p, BigInt &q, size_t pbits, size_t qbits) |
McEliece_PrivateKey | generate_mceliece_key (RandomNumberGenerator &rng, uint32_t ext_deg, uint32_t code_length, uint32_t t) |
std::string | generate_passhash9 (const std::string &pass, RandomNumberGenerator &rng, uint16_t work_factor, uint8_t alg_id) |
BigInt | generate_rfc6979_nonce (const BigInt &x, const BigInt &q, const BigInt &h, const std::string &hash) |
BigInt | generate_srp6_verifier (const std::string &identifier, const std::string &password, const std::vector< uint8_t > &salt, const std::string &group_id, const std::string &hash_id) |
AEAD_Mode * | get_aead (const std::string &algo, Cipher_Dir dir) |
BlockCipherModePaddingMethod * | get_bc_pad (const std::string &algo_spec) |
BlockCipher * | get_block_cipher (const std::string &algo_spec, const std::string &provider="") |
std::vector< std::string > | get_block_cipher_providers (const std::string &algo_spec) |
template<typename T > | |
uint8_t | get_byte (size_t byte_num, T input) |
Keyed_Filter * | get_cipher (const std::string &algo_spec, Cipher_Dir direction) |
Keyed_Filter * | get_cipher (const std::string &algo_spec, const SymmetricKey &key, const InitializationVector &iv, Cipher_Dir direction) |
Keyed_Filter * | get_cipher (const std::string &algo_spec, const SymmetricKey &key, Cipher_Dir direction) |
Cipher_Mode * | get_cipher_mode (const std::string &algo, Cipher_Dir direction) |
EME * | get_eme (const std::string &algo_spec) |
EMSA * | get_emsa (const std::string &algo_spec) |
std::vector< std::string > | get_files_recursive (const std::string &dir) |
HashFunction * | get_hash (const std::string &algo_spec, const std::string &provider="") |
HashFunction * | get_hash_function (const std::string &algo_spec, const std::string &provider="") |
std::vector< std::string > | get_hash_function_providers (const std::string &algo_spec) |
KDF * | get_kdf (const std::string &algo_spec) |
MessageAuthenticationCode * | get_mac (const std::string &algo_spec, const std::string &provider="") |
std::vector< std::string > | get_mac_providers (const std::string &algo_spec) |
PBKDF * | get_pbkdf (const std::string &algo_spec, const std::string &provider="") |
StreamCipher * | get_stream_cipher (const std::string &algo_spec, const std::string &provider="") |
std::vector< std::string > | get_stream_cipher_providers (const std::string &algo_spec) |
gf2m | gray_to_lex (gf2m gray) |
template<typename T > | |
size_t | hamming_weight (T n) |
std::string | hash_for_emsa (const std::string &algo_spec) |
size_t | hex_decode (uint8_t output[], const char input[], size_t input_length, size_t &input_consumed, bool ignore_ws) |
size_t | hex_decode (uint8_t output[], const char input[], size_t input_length, bool ignore_ws) |
size_t | hex_decode (uint8_t output[], const std::string &input, bool ignore_ws) |
std::vector< uint8_t > | hex_decode (const char input[], size_t input_length, bool ignore_ws) |
std::vector< uint8_t > | hex_decode (const std::string &input, bool ignore_ws) |
secure_vector< uint8_t > | hex_decode_locked (const char input[], size_t input_length, bool ignore_ws) |
secure_vector< uint8_t > | hex_decode_locked (const std::string &input, bool ignore_ws) |
void | hex_encode (char output[], const uint8_t input[], size_t input_length, bool uppercase) |
std::string | hex_encode (const uint8_t input[], size_t input_length, bool uppercase) |
template<typename Alloc > | |
std::string | hex_encode (const std::vector< uint8_t, Alloc > &input, bool uppercase=true) |
template<typename T > | |
size_t | high_bit (T n) |
bool | host_wildcard_match (const std::string &issued, const std::string &host) |
uint8_t | ieee1363_hash_id (const std::string &name) |
size_t | if_work_factor (size_t bits) |
BigInt | inverse_mod (const BigInt &n, const BigInt &mod) |
std::string | ipv4_to_string (uint32_t ip) |
template<typename T > | |
bool | is_power_of_2 (T arg) |
bool | is_prime (const BigInt &n, RandomNumberGenerator &rng, size_t prob, bool is_random) |
int32_t | jacobi (const BigInt &a, const BigInt &n) |
std::string | key_constraints_to_string (Key_Constraints constraints) |
BigInt | lcm (const BigInt &a, const BigInt &b) |
gf2m | lex_to_gray (gf2m lex) |
template<typename T > | |
T | load_be (const uint8_t in[], size_t off) |
template<typename T > | |
void | load_be (const uint8_t in[], T &x0, T &x1) |
template<typename T > | |
void | load_be (const uint8_t in[], T &x0, T &x1, T &x2, T &x3) |
template<typename T > | |
void | load_be (const uint8_t in[], T &x0, T &x1, T &x2, T &x3, T &x4, T &x5, T &x6, T &x7) |
template<typename T > | |
void | load_be (T out[], const uint8_t in[], size_t count) |
template<> | |
uint16_t | load_be< uint16_t > (const uint8_t in[], size_t off) |
template<> | |
uint32_t | load_be< uint32_t > (const uint8_t in[], size_t off) |
template<> | |
uint64_t | load_be< uint64_t > (const uint8_t in[], size_t off) |
template<typename T > | |
T | load_le (const uint8_t in[], size_t off) |
template<typename T > | |
void | load_le (const uint8_t in[], T &x0, T &x1) |
template<typename T > | |
void | load_le (const uint8_t in[], T &x0, T &x1, T &x2, T &x3) |
template<typename T > | |
void | load_le (const uint8_t in[], T &x0, T &x1, T &x2, T &x3, T &x4, T &x5, T &x6, T &x7) |
template<typename T > | |
void | load_le (T out[], const uint8_t in[], size_t count) |
template<> | |
uint16_t | load_le< uint16_t > (const uint8_t in[], size_t off) |
template<> | |
uint32_t | load_le< uint32_t > (const uint8_t in[], size_t off) |
template<> | |
uint64_t | load_le< uint64_t > (const uint8_t in[], size_t off) |
std::unique_ptr< Private_Key > | load_private_key (const AlgorithmIdentifier &alg_id, const secure_vector< uint8_t > &key_bits) |
std::unique_ptr< Public_Key > | load_public_key (const AlgorithmIdentifier &alg_id, const std::vector< uint8_t > &key_bits) |
template<typename T > | |
size_t | low_bit (T n) |
size_t | low_zero_bits (const BigInt &n) |
std::unique_ptr< BlockCipher > | make_block_cipher (const std::string &algo_spec, const std::string &provider="") |
Compression_Algorithm * | make_compressor (const std::string &name) |
Decompression_Algorithm * | make_decompressor (const std::string &name) |
std::unique_ptr< HashFunction > | make_hash_function (const std::string &algo_spec, const std::string &provider="") |
std::unique_ptr< MessageAuthenticationCode > | make_message_auth (const std::string &algo_spec, const std::string &provider="") |
std::unique_ptr< BlockCipher > | make_openssl_block_cipher (const std::string &name) |
std::unique_ptr< HashFunction > | make_openssl_hash (const std::string &name) |
std::unique_ptr< StreamCipher > | make_stream_cipher (const std::string &algo_spec, const std::string &provider="") |
uint16_t | make_uint16 (uint8_t i0, uint8_t i1) |
uint32_t | make_uint32 (uint8_t i0, uint8_t i1, uint8_t i2, uint8_t i3) |
uint64_t | make_uint64 (uint8_t i0, uint8_t i1, uint8_t i2, uint8_t i3, uint8_t i4, uint8_t i5, uint8_t i6, uint8_t i7) |
template<class T , class... Args> | |
stlCompatibilityDetails::_Unique_if< T >::_Single_object | make_unique (Args &&...args) |
template<class T > | |
stlCompatibilityDetails::_Unique_if< T >::_Unknown_bound | make_unique (size_t n) |
template<class T , class... Args> | |
stlCompatibilityDetails::_Unique_if< T >::_Known_bound | make_unique (Args &&...)=delete |
template<typename K , typename V > | |
std::set< K > | map_keys_as_set (const std::map< K, V > &kv) |
template<typename T , typename Pred > | |
void | map_remove_if (Pred pred, T &assoc) |
secure_vector< uint8_t > | mceies_decrypt (const McEliece_PrivateKey &privkey, const uint8_t ct[], size_t ct_len, const uint8_t ad[], size_t ad_len, const std::string &algo) |
secure_vector< uint8_t > | mceies_encrypt (const McEliece_PublicKey &pubkey, const uint8_t pt[], size_t pt_len, const uint8_t ad[], size_t ad_len, RandomNumberGenerator &rng, const std::string &algo) |
void | mceliece_decrypt (secure_vector< uint8_t > &plaintext_out, secure_vector< uint8_t > &error_mask_out, const secure_vector< uint8_t > &ciphertext, const McEliece_PrivateKey &key) |
void | mceliece_decrypt (secure_vector< uint8_t > &plaintext, secure_vector< uint8_t > &error_mask, const uint8_t ciphertext[], size_t ciphertext_len, const McEliece_PrivateKey &key) |
secure_vector< uint8_t > | mceliece_decrypt (secure_vector< gf2m > &error_pos, const uint8_t *ciphertext, uint32_t ciphertext_len, const McEliece_PrivateKey &key) |
void | mceliece_encrypt (secure_vector< uint8_t > &ciphertext_out, secure_vector< uint8_t > &error_mask_out, const secure_vector< uint8_t > &plaintext, const McEliece_PublicKey &key, RandomNumberGenerator &rng) |
size_t | mceliece_work_factor (size_t n, size_t t) |
void | mgf1_mask (HashFunction &hash, const uint8_t in[], size_t in_len, uint8_t out[], size_t out_len) |
word | monty_inverse (word input) |
void | mul64x64_128 (uint64_t a, uint64_t b, uint64_t *lo, uint64_t *hi) |
BigInt | mul_add (const BigInt &a, const BigInt &b, const BigInt &c) |
BigInt | mul_sub (const BigInt &a, const BigInt &b, const BigInt &c) |
PointGFp | multi_exponentiate (const PointGFp &p1, const BigInt &z1, const PointGFp &p2, const BigInt &z2) |
template<typename K , typename V > | |
void | multimap_insert (std::multimap< K, V > &multimap, const K &key, const V &value) |
void | newhope_keygen (uint8_t *send, poly *sk, RandomNumberGenerator &rng, Newhope_Mode mode) |
void | newhope_shareda (uint8_t *sharedkey, const poly *sk, const uint8_t *received, Newhope_Mode mode) |
void | newhope_sharedb (uint8_t *sharedkey, uint8_t *send, const uint8_t *received, RandomNumberGenerator &rng, Newhope_Mode mode) |
BigInt | normalized_montgomery_inverse (const BigInt &a, const BigInt &p) |
bool | operator!= (const CRL_Entry &a1, const CRL_Entry &a2) |
bool | operator!= (const AlgorithmIdentifier &a1, const AlgorithmIdentifier &a2) |
bool | operator!= (const OID &a, const OID &b) |
bool | operator!= (const OctetString &s1, const OctetString &s2) |
template<typename T , typename U > | |
bool | operator!= (const secure_allocator< T > &, const secure_allocator< U > &) |
bool | operator!= (const EC_Group &lhs, const EC_Group &rhs) |
bool | operator!= (const X509_DN &dn1, const X509_DN &dn2) |
bool | operator!= (const CurveGFp &lhs, const CurveGFp &rhs) |
bool | operator!= (const PointGFp &lhs, const PointGFp &rhs) |
bool | operator!= (const X509_Time &t1, const X509_Time &t2) |
bool | operator!= (const X509_Certificate &cert1, const X509_Certificate &cert2) |
bool | operator!= (const BigInt &a, const BigInt &b) |
BigInt | operator% (const BigInt &n, const BigInt &mod) |
word | operator% (const BigInt &n, word mod) |
ECIES_Flags | operator& (ECIES_Flags a, ECIES_Flags b) |
donna128 | operator* (const donna128 &x, uint64_t y) |
BigInt | operator* (const BigInt &x, const BigInt &y) |
PointGFp | operator* (const PointGFp &point, const BigInt &scalar) |
PointGFp | operator* (const BigInt &scalar, const PointGFp &point) |
BigInt | operator+ (const BigInt &x, const BigInt &y) |
OID | operator+ (const OID &oid, uint32_t component) |
donna128 | operator+ (const donna128 &x, const donna128 &y) |
donna128 | operator+ (const donna128 &x, uint64_t y) |
OctetString | operator+ (const OctetString &k1, const OctetString &k2) |
PointGFp | operator+ (const PointGFp &lhs, const PointGFp &rhs) |
template<typename T , typename Alloc , typename Alloc2 > | |
std::vector< T, Alloc > & | operator+= (std::vector< T, Alloc > &out, const std::vector< T, Alloc2 > &in) |
template<typename T , typename Alloc > | |
std::vector< T, Alloc > & | operator+= (std::vector< T, Alloc > &out, T in) |
template<typename T , typename Alloc , typename L > | |
std::vector< T, Alloc > & | operator+= (std::vector< T, Alloc > &out, const std::pair< const T *, L > &in) |
template<typename T , typename Alloc , typename L > | |
std::vector< T, Alloc > & | operator+= (std::vector< T, Alloc > &out, const std::pair< T *, L > &in) |
BigInt | operator- (const BigInt &x, const BigInt &y) |
PointGFp | operator- (const PointGFp &lhs) |
PointGFp | operator- (const PointGFp &lhs, const PointGFp &rhs) |
BigInt | operator/ (const BigInt &x, const BigInt &y) |
bool | operator< (const OID &a, const OID &b) |
bool | operator< (const X509_DN &dn1, const X509_DN &dn2) |
bool | operator< (const X509_Time &t1, const X509_Time &t2) |
bool | operator< (const BigInt &a, const BigInt &b) |
std::ostream & | operator<< (std::ostream &stream, const BigInt &n) |
int | operator<< (int fd, Pipe &pipe) |
BigInt | operator<< (const BigInt &x, size_t shift) |
std::ostream & | operator<< (std::ostream &os, const GeneralName &gn) |
std::ostream & | operator<< (std::ostream &os, const GeneralSubtree &gs) |
std::ostream & | operator<< (std::ostream &out, const X509_DN &dn) |
BOTAN_DLL std::ostream & | operator<< (std::ostream &out, Pipe &pipe) |
bool | operator<= (const X509_Time &t1, const X509_Time &t2) |
bool | operator<= (const BigInt &a, const BigInt &b) |
bool | operator== (const CRL_Entry &a1, const CRL_Entry &a2) |
bool | operator== (const AlgorithmIdentifier &a1, const AlgorithmIdentifier &a2) |
bool | operator== (const OctetString &s1, const OctetString &s2) |
template<typename T , typename U > | |
bool | operator== (const secure_allocator< T > &, const secure_allocator< U > &) |
bool | operator== (const X509_DN &dn1, const X509_DN &dn2) |
bool | operator== (const CurveGFp &lhs, const CurveGFp &rhs) |
bool | operator== (const X509_Time &t1, const X509_Time &t2) |
bool | operator== (const BigInt &a, const BigInt &b) |
bool | operator> (const X509_Time &t1, const X509_Time &t2) |
bool | operator> (const BigInt &a, const BigInt &b) |
bool | operator>= (const X509_Time &t1, const X509_Time &t2) |
bool | operator>= (const BigInt &a, const BigInt &b) |
int | operator>> (int fd, Pipe &pipe) |
std::istream & | operator>> (std::istream &stream, BigInt &n) |
BigInt | operator>> (const BigInt &x, size_t shift) |
std::istream & | operator>> (std::istream &in, X509_DN &dn) |
BOTAN_DLL std::istream & | operator>> (std::istream &in, Pipe &pipe) |
OctetString | operator^ (const OctetString &k1, const OctetString &k2) |
template<typename T , typename Alloc , typename Alloc2 > | |
std::vector< T, Alloc > & | operator^= (std::vector< T, Alloc > &out, const std::vector< T, Alloc2 > &in) |
ECIES_Flags | operator| (ECIES_Flags a, ECIES_Flags b) |
donna128 | operator| (const donna128 &x, const donna128 &y) |
template<typename Alloc > | |
PointGFp | OS2ECP (const std::vector< uint8_t, Alloc > &data, const CurveGFp &curve) |
PointGFp | OS2ECP (const uint8_t data[], size_t data_len, const CurveGFp &curve) |
std::vector< std::string > | parse_algorithm_name (const std::string &namex) |
std::vector< uint32_t > | parse_asn1_oid (const std::string &oid) |
secure_vector< uint8_t > | pbes2_decrypt (const secure_vector< uint8_t > &key_bits, const std::string &passphrase, const std::vector< uint8_t > ¶ms) |
std::pair< AlgorithmIdentifier, std::vector< uint8_t > > | pbes2_encrypt (const secure_vector< uint8_t > &key_bits, const std::string &passphrase, std::chrono::milliseconds msec, const std::string &cipher, const std::string &digest, RandomNumberGenerator &rng) |
std::pair< AlgorithmIdentifier, std::vector< uint8_t > > | pbes2_encrypt_iter (const secure_vector< uint8_t > &key_bits, const std::string &passphrase, size_t pbkdf_iter, const std::string &cipher, const std::string &digest, RandomNumberGenerator &rng) |
std::pair< AlgorithmIdentifier, std::vector< uint8_t > > | pbes2_encrypt_msec (const secure_vector< uint8_t > &key_bits, const std::string &passphrase, std::chrono::milliseconds msec, size_t *out_iterations_if_nonnull, const std::string &cipher, const std::string &digest, RandomNumberGenerator &rng) |
size_t | pbkdf2 (MessageAuthenticationCode &prf, uint8_t out[], size_t out_len, const std::string &passphrase, const uint8_t salt[], size_t salt_len, size_t iterations, std::chrono::milliseconds msec) |
std::vector< uint8_t > | pkcs_hash_id (const std::string &name) |
BigInt | power_mod (const BigInt &base, const BigInt &exp, const BigInt &mod) |
template<typename T > | |
void | prefetch_readonly (const T *addr, size_t length) |
template<typename T > | |
void | prefetch_readwrite (const T *addr, size_t length) |
const BigInt & | prime_p521 () |
template<typename T > | |
std::vector< std::string > | probe_providers_of (const std::string &algo_spec, const std::vector< std::string > &possible) |
bool | quick_check_prime (const BigInt &n, RandomNumberGenerator &rng) |
gf2m | random_code_element (unsigned code_length, RandomNumberGenerator &rng) |
gf2m | random_gf2m (RandomNumberGenerator &rng) |
BigInt | random_prime (RandomNumberGenerator &rng, size_t bits, const BigInt &coprime, size_t equiv, size_t modulo) |
BigInt | random_safe_prime (RandomNumberGenerator &rng, size_t bits) |
std::map< std::string, std::string > BOTAN_DLL | read_cfg (std::istream &is) |
void | redc_p521 (BigInt &x, secure_vector< word > &ws) |
std::string | replace_char (const std::string &str, char from_char, char to_char) |
std::string | replace_chars (const std::string &str, const std::set< char > &chars, char to_char) |
BigInt BOTAN_DLL | ressol (const BigInt &x, const BigInt &p) |
uint16_t | reverse_bytes (uint16_t val) |
uint32_t | reverse_bytes (uint32_t val) |
uint64_t | reverse_bytes (uint64_t val) |
secure_vector< uint8_t > | rfc3394_keyunwrap (const secure_vector< uint8_t > &key, const SymmetricKey &kek) |
secure_vector< uint8_t > | rfc3394_keywrap (const secure_vector< uint8_t > &key, const SymmetricKey &kek) |
template<typename T > | |
T | rotate_left (T input, size_t rot) |
template<typename T > | |
T | rotate_right (T input, size_t rot) |
template<typename T > | |
T | round_down (T n, T align_to) |
size_t | round_up (size_t n, size_t align_to) |
std::string | runtime_version_check (uint32_t major, uint32_t minor, uint32_t patch) |
template<typename T > | |
bool | same_mem (const T *p1, const T *p2, size_t n) |
template<typename K , typename V > | |
V | search_map (const std::map< K, V > &mapping, const K &key, const V &null_result=V()) |
template<typename K , typename V , typename R > | |
R | search_map (const std::map< K, V > &mapping, const K &key, const R &null_result, const R &found_result) |
void | secure_scrub_memory (void *ptr, size_t n) |
template<typename T > | |
void | set_mem (T *ptr, size_t n, uint8_t val) |
template<typename T > | |
size_t | significant_bytes (T n) |
std::vector< std::string > | split_on (const std::string &str, char delim) |
std::vector< std::string > | split_on_pred (const std::string &str, std::function< bool(char)> pred) |
BigInt | square (const BigInt &x) |
std::pair< BigInt, SymmetricKey > | srp6_client_agree (const std::string &identifier, const std::string &password, const std::string &group_id, const std::string &hash_id, const std::vector< uint8_t > &salt, const BigInt &B, RandomNumberGenerator &rng) |
std::string | srp6_group_identifier (const BigInt &N, const BigInt &g) |
void | store_be (uint16_t in, uint8_t out[2]) |
void | store_be (uint32_t in, uint8_t out[4]) |
void | store_be (uint64_t in, uint8_t out[8]) |
template<typename T > | |
void | store_be (uint8_t out[], T x0, T x1) |
template<typename T > | |
void | store_be (uint8_t out[], T x0, T x1, T x2, T x3) |
template<typename T > | |
void | store_be (uint8_t out[], T x0, T x1, T x2, T x3, T x4, T x5, T x6, T x7) |
void | store_le (uint16_t in, uint8_t out[2]) |
void | store_le (uint32_t in, uint8_t out[4]) |
void | store_le (uint64_t in, uint8_t out[8]) |
template<typename T > | |
void | store_le (uint8_t out[], T x0, T x1) |
template<typename T > | |
void | store_le (uint8_t out[], T x0, T x1, T x2, T x3) |
template<typename T > | |
void | store_le (uint8_t out[], T x0, T x1, T x2, T x3, T x4, T x5, T x6, T x7) |
std::string | string_join (const std::vector< std::string > &strs, char delim) |
uint32_t | string_to_ipv4 (const std::string &str) |
BigInt | sub_mul (const BigInt &a, const BigInt &b, const BigInt &c) |
std::vector< polyn_gf2m > | syndrome_init (polyn_gf2m const &generator, std::vector< gf2m > const &support, int n) |
RandomNumberGenerator & | system_rng () |
uint32_t | timespec_to_u32bit (const std::string ×pec) |
std::vector< uint8_t > | to_byte_vector (const std::string &s) |
const char * | to_string (Certificate_Status_Code code) |
std::string | to_string (const secure_vector< uint8_t > &bytes) |
uint32_t | to_u32bit (const std::string &str) |
template<typename T > | |
std::vector< T > | unlock (const secure_vector< T > &in) |
template<typename T > | |
bool | value_exists (const std::vector< T > &vec, const T &val) |
void | verify_cert_constraints_valid_for_key_type (const Public_Key &pub_key, Key_Constraints constraints) |
bool | verify_prime (const BigInt &n, RandomNumberGenerator &rng) |
const char * | version_cstr () |
uint32_t | version_datestamp () |
uint32_t | version_major () |
uint32_t | version_minor () |
uint32_t | version_patch () |
std::string | version_string () |
void | word3_muladd (word *w2, word *w1, word *w0, word x, word y) |
void | word3_muladd_2 (word *w2, word *w1, word *w0, word x, word y) |
word | word8_add2 (word x[8], const word y[8], word carry) |
word | word8_add3 (word z[8], const word x[8], const word y[8], word carry) |
word | word8_linmul2 (word x[8], word y, word carry) |
word | word8_linmul3 (word z[8], const word x[8], word y, word carry) |
word | word8_madd3 (word z[8], const word x[8], word y, word carry) |
word | word8_sub2 (word x[8], const word y[8], word carry) |
word | word8_sub2_rev (word x[8], const word y[8], word carry) |
word | word8_sub3 (word z[8], const word x[8], const word y[8], word carry) |
word | word_add (word x, word y, word *carry) |
word | word_madd2 (word a, word b, word *c) |
word | word_madd3 (word a, word b, word c, word *d) |
word | word_sub (word x, word y, word *carry) |
bool | x500_name_cmp (const std::string &name1, const std::string &name2) |
Path_Validation_Result | x509_path_validate (const std::vector< X509_Certificate > &end_certs, const Path_Validation_Restrictions &restrictions, const std::vector< Certificate_Store * > &trusted_roots, const std::string &hostname, Usage_Type usage, std::chrono::system_clock::time_point ref_time, std::chrono::milliseconds ocsp_timeout, const std::vector< std::shared_ptr< const OCSP::Response >> &ocsp_resp) |
Path_Validation_Result | x509_path_validate (const X509_Certificate &end_cert, const Path_Validation_Restrictions &restrictions, const std::vector< Certificate_Store * > &trusted_roots, const std::string &hostname, Usage_Type usage, std::chrono::system_clock::time_point when, std::chrono::milliseconds ocsp_timeout, const std::vector< std::shared_ptr< const OCSP::Response >> &ocsp_resp) |
Path_Validation_Result | x509_path_validate (const std::vector< X509_Certificate > &end_certs, const Path_Validation_Restrictions &restrictions, const Certificate_Store &store, const std::string &hostname, Usage_Type usage, std::chrono::system_clock::time_point when, std::chrono::milliseconds ocsp_timeout, const std::vector< std::shared_ptr< const OCSP::Response >> &ocsp_resp) |
Path_Validation_Result | x509_path_validate (const X509_Certificate &end_cert, const Path_Validation_Restrictions &restrictions, const Certificate_Store &store, const std::string &hostname, Usage_Type usage, std::chrono::system_clock::time_point when, std::chrono::milliseconds ocsp_timeout, const std::vector< std::shared_ptr< const OCSP::Response >> &ocsp_resp) |
template<typename T > | |
void | xor_buf (T out[], const T in[], size_t length) |
template<typename T > | |
void | xor_buf (T out[], const T in[], const T in2[], size_t length) |
template<typename Alloc , typename Alloc2 > | |
void | xor_buf (std::vector< uint8_t, Alloc > &out, const std::vector< uint8_t, Alloc2 > &in, size_t n) |
template<typename Alloc > | |
void | xor_buf (std::vector< uint8_t, Alloc > &out, const uint8_t *in, size_t n) |
template<typename Alloc , typename Alloc2 > | |
void | xor_buf (std::vector< uint8_t, Alloc > &out, const uint8_t *in, const std::vector< uint8_t, Alloc2 > &in2, size_t n) |
template<typename T , typename Alloc > | |
void | zap (std::vector< T, Alloc > &vec) |
template<typename T , typename Alloc > | |
void | zeroise (std::vector< T, Alloc > &vec) |
Variables | |
const uint32_t | CAST_SBOX1 [256] |
const uint32_t | CAST_SBOX2 [256] |
const uint32_t | CAST_SBOX3 [256] |
const uint32_t | CAST_SBOX4 [256] |
const uint64_t | DES_FPTAB1 [256] |
const uint64_t | DES_FPTAB2 [256] |
const uint64_t | DES_IPTAB1 [256] |
const uint64_t | DES_IPTAB2 [256] |
const uint32_t | DES_SPBOX1 [256] |
const uint32_t | DES_SPBOX2 [256] |
const uint32_t | DES_SPBOX3 [256] |
const uint32_t | DES_SPBOX4 [256] |
const uint32_t | DES_SPBOX5 [256] |
const uint32_t | DES_SPBOX6 [256] |
const uint32_t | DES_SPBOX7 [256] |
const uint32_t | DES_SPBOX8 [256] |
const size_t | HEX_CODEC_BUFFER_SIZE = 256 |
const size_t | MP_WORD_BITS = BOTAN_MP_WORD_BITS |
const word | MP_WORD_MASK = ~static_cast<word>(0) |
const word | MP_WORD_MAX = MP_WORD_MASK |
const word | MP_WORD_TOP_BIT = static_cast<word>(1) << (8*sizeof(word) - 1) |
const size_t | PRIME_TABLE_SIZE = 6541 |
const uint16_t BOTAN_DLL | PRIMES [] |
Ordinary applications should never need to include or use this header. It is exposed only for specialized applications which want to implement new versions of public key crypto without merging them as changes to the library. One actual example of such usage is an application which creates RSA signatures using a custom TPM library. Unless you're doing something like that, you don't need anything here. Instead use pubkey.h which wraps these types safely and provides a stable application-oriented API.
XMSS WOTS Addressed Private Key (C) 2016 Matthias Gierlings
Botan is released under the Simplified BSD License (see license.txt)
XMSS WOTS Addressed Public Key (C) 2016 Matthias Gierlings
Botan is released under the Simplified BSD License (see license.txt)
XMSS WOTS Common Ops Operations shared by XMSS WOTS signature generation and verification operations.
(C) 2016 Matthias Gierlings
Botan is released under the Simplified BSD License (see license.txt)
XMSS WOTS Common Operations (C) 2016 Matthias Gierlings
Botan is released under the Simplified BSD License (see license.txt)
XMSS WOTS Signature Operation Signature generation operation for Winternitz One Time Signatures for use in Extended Hash-Based Signatures (XMSS).
This operation is not intended for stand-alone use and thus not registered in the Botan algorithm registry.
(C) 2016 Matthias Gierlings
Botan is released under the Simplified BSD License (see license.txt)
XMSS WOTS Signature Operation (C) 2016 Matthias Gierlings
Botan is released under the Simplified BSD License (see license.txt)
XMSS WOTS Verification Operation Provides signature verification capabilities for Winternitz One Time Signatures used in Extended Hash-Based Signatures (XMSS).
This operation is not intended for stand-alone use and thus not registered in the Botan algorithm registry.
(C) 2016 Matthias Gierlings
Botan is released under the Simplified BSD License (see license.txt)
XMSS_WOTS_Verification_Operation.h (C) 2016 Matthias Gierlings
Botan is released under the Simplified BSD License (see license.txt)
The primary namespace for the botan library
using Botan::byte = typedef std::uint8_t |
typedef std::vector<std::set<Certificate_Status_Code> > Botan::CertificatePathStatusCodes |
This type represents the validation status of an entire certificate path. There is one set of status codes for each certificate in the path.
Definition at line 29 of file x509path.h.
typedef EC_Group Botan::EC_Domain_Params |
Definition at line 151 of file ec_group.h.
typedef uint16_t Botan::gf2m |
Definition at line 20 of file gf2m_small_m.h.
using Botan::InitializationVector = typedef OctetString |
typedef uint64_t Botan::limb |
typedef MessageAuthenticationCode Botan::MAC |
typedef PK_Key_Agreement_Key Botan::PK_KA_Key |
typedef Private_Key Botan::PKCS8_PrivateKey |
typedef newhope_poly Botan::poly |
Definition at line 19 of file newhope.cpp.
typedef RandomNumberGenerator Botan::RNG |
using Botan::s32bit = typedef std::int32_t |
using Botan::secure_deque = typedef std::deque<T, secure_allocator<T>> |
using Botan::secure_vector = typedef std::vector<T, secure_allocator<T>> |
typedef SHA_160 Botan::SHA_1 |
typedef SIMD_4x32 Botan::SIMD_32 |
using Botan::SymmetricKey = typedef OctetString |
Definition at line 67 of file cipher_filter.h.
Definition at line 68 of file cipher_filter.h.
using Botan::u16bit = typedef std::uint16_t |
using Botan::u32bit = typedef std::uint32_t |
using Botan::u64bit = typedef std::uint64_t |
typedef donna128 Botan::uint128_t |
typedef std::vector< secure_vector< uint8_t > > Botan::wots_keysig_t |
Definition at line 20 of file xmss_common_ops.h.
typedef Public_Key Botan::X509_PublicKey |
enum Botan::ASN1_Tag |
ASN.1 Type and Class Tags
Definition at line 22 of file asn1_obj.h.
Enumerator | |
---|---|
BLAKE2B_BLOCKBYTES | |
BLAKE2B_OUTBYTES | |
BLAKE2B_IVU64COUNT |
|
strong |
Certificate validation status code
Definition at line 18 of file cert_status.h.
enum Botan::Character_Set |
The different charsets (nominally) supported by Botan.
Enumerator | |
---|---|
LOCAL_CHARSET | |
UCS2_CHARSET | |
UTF8_CHARSET | |
LATIN1_CHARSET |
enum Botan::Cipher_Dir |
The two possible directions for cipher filters, determining whether they actually perform encryption or decryption.
Enumerator | |
---|---|
ENCRYPTION | |
DECRYPTION |
Definition at line 212 of file cipher_mode.h.
enum Botan::CRL_Code |
X.509v2 CRL Reason Code.
Definition at line 20 of file crl_ent.h.
The type of checking to be performed by decoders: NONE - no checks, IGNORE_WS - perform checks, but ignore whitespaces, FULL_CHECK - perform checks, also complain about white spaces.
Enumerator | |
---|---|
NONE | |
IGNORE_WS | |
FULL_CHECK |
This class represents elliptic curce domain parameters
Enumerator | |
---|---|
EC_DOMPAR_ENC_EXPLICIT | |
EC_DOMPAR_ENC_IMPLICITCA | |
EC_DOMPAR_ENC_OID |
Definition at line 22 of file ec_group.h.
|
strong |
Definition at line 28 of file ecies.h.
X.509v3 Key Constraints. If updating update copy in ffi.h
Enumerator | |
---|---|
NO_CONSTRAINTS | |
DIGITAL_SIGNATURE | |
NON_REPUDIATION | |
KEY_ENCIPHERMENT | |
DATA_ENCIPHERMENT | |
KEY_AGREEMENT | |
KEY_CERT_SIGN | |
CRL_SIGN | |
ENCIPHER_ONLY | |
DECIPHER_ONLY |
Definition at line 21 of file key_constraint.h.
|
strong |
Enumerator | |
---|---|
NEWHOPE_SENDABYTES | |
NEWHOPE_SENDBBYTES | |
NEWHOPE_OFFER_BYTES | |
NEWHOPE_ACCEPT_BYTES | |
NEWHOPE_SHARED_KEY_BYTES | |
CECPQ1_OFFER_BYTES | |
CECPQ1_ACCEPT_BYTES | |
CECPQ1_SHARED_KEY_BYTES |
Definition at line 33 of file newhope.h.
The two types of signature format supported by Botan.
Enumerator | |
---|---|
IEEE_1363 | |
DER_SEQUENCE |
Definition at line 29 of file pubkey.h.
|
strong |
|
strong |
Enumerator | |
---|---|
UNSPECIFIED | |
TLS_SERVER_AUTH | |
TLS_CLIENT_AUTH | |
CERTIFICATE_AUTHORITY | |
OCSP_RESPONDER |
Definition at line 24 of file x509cert.h.
enum Botan::X509_Encoding |
The two types of X509 encoding supported by Botan.
Enumerator | |
---|---|
RAW_BER | |
PEM |
Definition at line 21 of file x509_key.h.
Return the absolute value
n | an integer |
Definition at line 55 of file numthry.h.
References Botan::BigInt::abs().
size_t BOTAN_DLL Botan::almost_montgomery_inverse | ( | BigInt & | result, |
const BigInt & | a, | ||
const BigInt & | b | ||
) |
Return a^-1 * 2^k mod b Returns k, between n and 2n Not const time
Definition at line 90 of file numthry.cpp.
References Botan::BigInt::is_even().
Referenced by normalized_montgomery_inverse().
void BOTAN_DLL Botan::aont_package | ( | RandomNumberGenerator & | rng, |
BlockCipher * | cipher, | ||
const uint8_t | input[], | ||
size_t | input_len, | ||
uint8_t | output[] | ||
) |
Rivest's Package Tranform
rng | the random number generator to use |
cipher | the block cipher to use (aont_package takes ownership) |
input | the input data buffer |
input_len | the length of the input data in bytes |
output | the output data buffer (must be at least input_len + cipher->BLOCK_SIZE bytes long) |
Definition at line 16 of file package.cpp.
References Botan::OctetString::begin(), Botan::BlockCipher::block_size(), BOTAN_ASSERT_EQUAL, clear_mem(), copy_mem(), Botan::BlockCipher::encrypt(), get_byte(), Botan::Pipe::process_msg(), Botan::Pipe::read(), Botan::Pipe::remaining(), Botan::SymmetricAlgorithm::set_key(), Botan::SymmetricAlgorithm::valid_keylength(), xor_buf(), and zeroise().
void BOTAN_DLL Botan::aont_unpackage | ( | BlockCipher * | cipher, |
const uint8_t | input[], | ||
size_t | input_len, | ||
uint8_t | output[] | ||
) |
Rivest's Package Tranform (Inversion)
cipher | the block cipher to use (aont_package takes ownership) |
input | the input data buffer |
input_len | the length of the input data in bytes |
output | the output data buffer (must be at least input_len - cipher->BLOCK_SIZE bytes long) |
Definition at line 69 of file package.cpp.
References Botan::BlockCipher::block_size(), BOTAN_ASSERT_EQUAL, copy_mem(), Botan::BlockCipher::encrypt(), get_byte(), Botan::Pipe::process_msg(), Botan::Pipe::read(), Botan::Pipe::remaining(), Botan::SymmetricAlgorithm::set_key(), Botan::SymmetricAlgorithm::valid_keylength(), xor_buf(), and zeroise().
BOTAN_NORETURN void BOTAN_DLL Botan::assertion_failure | ( | const char * | expr_str, |
const char * | assertion_made, | ||
const char * | func, | ||
const char * | file, | ||
int | line | ||
) |
size_t BOTAN_DLL Botan::base64_decode | ( | uint8_t | output[], |
const char | input[], | ||
size_t | input_length, | ||
size_t & | input_consumed, | ||
bool | final_inputs, | ||
bool | ignore_ws = true |
||
) |
Perform base64 decoding
output | an array of at least base64_decode_max_output bytes |
input | some base64 input |
input_length | length of input in bytes |
input_consumed | is an output parameter which says how many bytes of input were actually consumed. If less than input_length, then the range input[consumed:length] should be passed in later along with more input. |
final_inputs | true iff this is the last input, in which case padding is allowed |
ignore_ws | ignore whitespace on input; if false, throw an exception if whitespace is encountered |
Definition at line 100 of file base64.cpp.
References clear_mem().
Referenced by base64_decode(), check_passhash9(), Botan::PEM_Code::decode(), Botan::Base64_Decoder::end_msg(), and Botan::Base64_Decoder::write().
size_t BOTAN_DLL Botan::base64_decode | ( | uint8_t | output[], |
const char | input[], | ||
size_t | input_length, | ||
bool | ignore_ws = true |
||
) |
Perform base64 decoding
output | an array of at least base64_decode_max_output bytes |
input | some base64 input |
input_length | length of input in bytes |
ignore_ws | ignore whitespace on input; if false, throw an exception if whitespace is encountered |
Definition at line 207 of file base64.cpp.
References base64_decode().
size_t BOTAN_DLL Botan::base64_decode | ( | uint8_t | output[], |
const std::string & | input, | ||
bool | ignore_ws = true |
||
) |
Perform base64 decoding
output | an array of at least base64_decode_max_output bytes |
input | some base64 input |
ignore_ws | ignore whitespace on input; if false, throw an exception if whitespace is encountered |
Definition at line 222 of file base64.cpp.
References base64_decode().
secure_vector< uint8_t > BOTAN_DLL Botan::base64_decode | ( | const char | input[], |
size_t | input_length, | ||
bool | ignore_ws = true |
||
) |
Perform base64 decoding
input | some base64 input |
input_length | the length of input in bytes |
ignore_ws | ignore whitespace on input; if false, throw an exception if whitespace is encountered |
Definition at line 229 of file base64.cpp.
References base64_decode(), and base64_decode_max_output().
secure_vector< uint8_t > BOTAN_DLL Botan::base64_decode | ( | const std::string & | input, |
bool | ignore_ws = true |
||
) |
Perform base64 decoding
input | some base64 input |
ignore_ws | ignore whitespace on input; if false, throw an exception if whitespace is encountered |
Definition at line 245 of file base64.cpp.
References base64_decode().
size_t BOTAN_DLL Botan::base64_decode_max_output | ( | size_t | input_length | ) |
Calculate the size of output buffer for base64_decode
input_length | the length of input in bytes |
Definition at line 256 of file base64.cpp.
References round_up().
Referenced by base64_decode().
size_t BOTAN_DLL Botan::base64_encode | ( | char | output[], |
const uint8_t | input[], | ||
size_t | input_length, | ||
size_t & | input_consumed, | ||
bool | final_inputs | ||
) |
Perform base64 encoding
output | an array of at least base64_encode_max_output bytes |
input | is some binary data |
input_length | length of input in bytes |
input_consumed | is an output parameter which says how many bytes of input were actually consumed. If less than input_length, then the range input[consumed:length] should be passed in later along with more input. |
final_inputs | true iff this is the last input, in which case padding chars will be applied if needed |
Definition at line 35 of file base64.cpp.
Referenced by Botan::OCSP::Request::base64_encode(), base64_encode(), Botan::PEM_Code::encode(), and generate_passhash9().
std::string Botan::base64_encode | ( | const std::vector< uint8_t, Alloc > & | input | ) |
Perform base64 encoding
input | some input |
Definition at line 50 of file base64.h.
References base64_encode().
std::string BOTAN_DLL Botan::base64_encode | ( | const uint8_t | input[], |
size_t | input_length | ||
) |
Perform base64 encoding
input | some input |
input_length | length of input in bytes |
Definition at line 78 of file base64.cpp.
References base64_encode(), base64_encode_max_output(), and BOTAN_ASSERT_EQUAL.
size_t BOTAN_DLL Botan::base64_encode_max_output | ( | size_t | input_length | ) |
Calculate the size of output buffer for base64_encode
input_length | the length of input in bytes |
Definition at line 251 of file base64.cpp.
References round_up().
Referenced by base64_encode().
void Botan::bigint_add2 | ( | word | x[], |
size_t | x_size, | ||
const word | y[], | ||
size_t | y_size | ||
) |
Two operand addition
x | the first operand (and output) |
x_size | size of x |
y | the second operand |
y_size | size of y (must be >= x_size) |
Definition at line 138 of file mp_core.cpp.
References bigint_add2_nc().
Referenced by mul_add(), Botan::BigInt::operator+=(), and Botan::BigInt::operator-=().
word Botan::bigint_add2_nc | ( | word | x[], |
size_t | x_size, | ||
const word | y[], | ||
size_t | y_size | ||
) |
Two operand addition with carry out
Definition at line 90 of file mp_core.cpp.
References BOTAN_ASSERT, word8_add2(), and word_add().
Referenced by bigint_add2().
void Botan::bigint_add3 | ( | word | z[], |
const word | x[], | ||
size_t | x_size, | ||
const word | y[], | ||
size_t | y_size | ||
) |
Three operand addition
Definition at line 147 of file mp_core.cpp.
References bigint_add3_nc().
Referenced by operator+(), and operator-().
word Botan::bigint_add3_nc | ( | word | z[], |
const word | x[], | ||
size_t | x_size, | ||
const word | y[], | ||
size_t | y_size | ||
) |
Three operand addition with carry out
Definition at line 113 of file mp_core.cpp.
References word8_add3(), and word_add().
Referenced by bigint_add3(), and redc_p521().
int32_t Botan::bigint_cmp | ( | const word | x[], |
size_t | x_size, | ||
const word | y[], | ||
size_t | y_size | ||
) |
Compare x and y
Definition at line 378 of file mp_core.cpp.
Referenced by Botan::BigInt::cmp(), operator+(), Botan::BigInt::operator+=(), operator-(), and Botan::BigInt::operator-=().
BOTAN_DLL void Botan::bigint_cnd_abs | ( | word | cnd, |
word | x[], | ||
size_t | size | ||
) |
Definition at line 75 of file mp_core.cpp.
References Botan::CT::expand_mask(), Botan::CT::select(), and word_add().
Referenced by ct_inverse_mod_odd_modulus().
BOTAN_DLL word Botan::bigint_cnd_add | ( | word | cnd, |
word | x[], | ||
const word | y[], | ||
size_t | size | ||
) |
Definition at line 39 of file mp_core.cpp.
References Botan::CT::expand_mask(), Botan::CT::select(), and word_add().
Referenced by ct_inverse_mod_odd_modulus().
BOTAN_DLL word Botan::bigint_cnd_sub | ( | word | cnd, |
word | x[], | ||
const word | y[], | ||
size_t | size | ||
) |
Definition at line 61 of file mp_core.cpp.
References Botan::CT::expand_mask(), Botan::CT::select(), and word_sub().
Referenced by ct_inverse_mod_odd_modulus().
BOTAN_DLL void Botan::bigint_cnd_swap | ( | word | cnd, |
word | x[], | ||
word | y[], | ||
size_t | size | ||
) |
Definition at line 22 of file mp_core.cpp.
References Botan::CT::expand_mask(), and Botan::CT::select().
Referenced by ct_inverse_mod_odd_modulus().
void Botan::bigint_comba_mul16 | ( | word | z[32], |
const word | x[16], | ||
const word | y[16] | ||
) |
Definition at line 805 of file mp_comba.cpp.
References word3_muladd().
Referenced by bigint_mul().
void Botan::bigint_comba_mul4 | ( | word | z[8], |
const word | x[4], | ||
const word | y[4] | ||
) |
Definition at line 50 of file mp_comba.cpp.
References word3_muladd().
Referenced by bigint_mul().
void Botan::bigint_comba_mul6 | ( | word | z[12], |
const word | x[6], | ||
const word | y[6] | ||
) |
Definition at line 141 of file mp_comba.cpp.
References word3_muladd().
Referenced by bigint_mul().
void Botan::bigint_comba_mul8 | ( | word | z[16], |
const word | x[8], | ||
const word | y[8] | ||
) |
Definition at line 283 of file mp_comba.cpp.
References word3_muladd().
Referenced by bigint_mul().
void Botan::bigint_comba_mul9 | ( | word | z[18], |
const word | x[9], | ||
const word | y[9] | ||
) |
Definition at line 474 of file mp_comba.cpp.
References word3_muladd().
Referenced by bigint_mul().
void Botan::bigint_comba_sqr16 | ( | word | z[32], |
const word | x[16] | ||
) |
Definition at line 598 of file mp_comba.cpp.
References word3_muladd(), and word3_muladd_2().
Referenced by bigint_sqr().
void Botan::bigint_comba_sqr4 | ( | word | z[8], |
const word | x[4] | ||
) |
Definition at line 17 of file mp_comba.cpp.
References word3_muladd(), and word3_muladd_2().
Referenced by bigint_sqr().
void Botan::bigint_comba_sqr6 | ( | word | z[12], |
const word | x[6] | ||
) |
Definition at line 89 of file mp_comba.cpp.
References word3_muladd(), and word3_muladd_2().
Referenced by bigint_sqr().
void Botan::bigint_comba_sqr8 | ( | word | z[16], |
const word | x[8] | ||
) |
Definition at line 208 of file mp_comba.cpp.
References word3_muladd(), and word3_muladd_2().
Referenced by bigint_sqr().
void Botan::bigint_comba_sqr9 | ( | word | z[18], |
const word | x[9] | ||
) |
Definition at line 386 of file mp_comba.cpp.
References word3_muladd(), and word3_muladd_2().
Referenced by bigint_sqr().
word Botan::bigint_divop | ( | word | n1, |
word | n0, | ||
word | d | ||
) |
Compute ((n1<<bits) + n0) / d
Definition at line 404 of file mp_core.cpp.
References MP_WORD_BITS, and MP_WORD_TOP_BIT.
Referenced by bigint_modop(), divide(), and monty_inverse().
void Botan::bigint_linmul2 | ( | word | x[], |
size_t | x_size, | ||
word | y | ||
) |
Definition at line 222 of file mp_core.cpp.
References word8_linmul2(), and word_madd2().
Referenced by Botan::BigInt::operator*=().
void Botan::bigint_linmul3 | ( | word | z[], |
const word | x[], | ||
size_t | x_size, | ||
word | y | ||
) |
Definition at line 240 of file mp_core.cpp.
References word8_linmul3(), and word_madd2().
Referenced by bigint_mul(), bigint_sqr(), operator*(), and Botan::BigInt::operator*=().
word Botan::bigint_modop | ( | word | n1, |
word | n0, | ||
word | d | ||
) |
Compute ((n1<<bits) + n0) % d
Definition at line 432 of file mp_core.cpp.
References bigint_divop(), and word_madd2().
Referenced by operator%(), and Botan::BigInt::operator%=().
void Botan::bigint_monty_mul | ( | BigInt & | z, |
const BigInt & | x, | ||
const BigInt & | y, | ||
const word | p[], | ||
size_t | p_size, | ||
word | p_dash, | ||
word | workspace[] | ||
) |
Definition at line 97 of file mp_monty.cpp.
References bigint_monty_redc(), bigint_mul(), and Botan::BigInt::mutable_data().
Referenced by Botan::Montgomery_Exponentiator::execute(), and Botan::Montgomery_Exponentiator::set_base().
void Botan::bigint_monty_redc | ( | word | z[], |
const word | p[], | ||
size_t | p_size, | ||
word | p_dash, | ||
word | workspace[] | ||
) |
Montgomery Reduction
z | integer to reduce, of size exactly 2*(p_size+1). Output is in the first p_size+1 words, higher words are set to zero. |
p | modulus |
p_size | size of p |
p_dash | Montgomery value |
workspace | array of at least 2*(p_size+1) words |
Definition at line 22 of file mp_monty.cpp.
References BOTAN_ASSERT, clear_mem(), Botan::CT::conditional_copy_mem(), copy_mem(), Botan::CT::poison(), Botan::CT::unpoison(), word8_madd3(), word_madd3(), and word_sub().
Referenced by bigint_monty_mul(), bigint_monty_sqr(), and Botan::Montgomery_Exponentiator::execute().
void Botan::bigint_monty_sqr | ( | BigInt & | z, |
const BigInt & | x, | ||
const word | p[], | ||
size_t | p_size, | ||
word | p_dash, | ||
word | workspace[] | ||
) |
Definition at line 109 of file mp_monty.cpp.
References bigint_monty_redc(), bigint_sqr(), Botan::BigInt::data(), Botan::BigInt::mutable_data(), Botan::BigInt::sig_words(), and Botan::BigInt::size().
Referenced by Botan::Montgomery_Exponentiator::execute().
Definition at line 252 of file mp_karat.cpp.
References bigint_comba_mul16(), bigint_comba_mul4(), bigint_comba_mul6(), bigint_comba_mul8(), bigint_comba_mul9(), bigint_linmul3(), clear_mem(), Botan::BigInt::data(), Botan::BigInt::mutable_data(), Botan::BigInt::sig_words(), and Botan::BigInt::size().
Referenced by bigint_monty_mul(), mul_add(), operator*(), and Botan::BigInt::operator*=().
void Botan::bigint_shl1 | ( | word | x[], |
size_t | x_size, | ||
size_t | word_shift, | ||
size_t | bit_shift | ||
) |
Definition at line 258 of file mp_core.cpp.
References clear_mem(), copy_mem(), and MP_WORD_BITS.
Referenced by Botan::BigInt::operator-=(), and Botan::BigInt::operator<<=().
void Botan::bigint_shl2 | ( | word | y[], |
const word | x[], | ||
size_t | x_size, | ||
size_t | word_shift, | ||
size_t | bit_shift | ||
) |
Definition at line 336 of file mp_core.cpp.
References MP_WORD_BITS.
Referenced by operator-(), and operator<<().
void Botan::bigint_shr1 | ( | word | x[], |
size_t | x_size, | ||
size_t | word_shift, | ||
size_t | bit_shift | ||
) |
Definition at line 281 of file mp_core.cpp.
References clear_mem(), copy_mem(), and MP_WORD_BITS.
Referenced by ct_inverse_mod_odd_modulus(), and Botan::BigInt::operator>>=().
void Botan::bigint_shr2 | ( | word | y[], |
const word | x[], | ||
size_t | x_size, | ||
size_t | word_shift, | ||
size_t | bit_shift | ||
) |
Definition at line 356 of file mp_core.cpp.
References MP_WORD_BITS.
Referenced by operator>>(), and redc_p521().
void Botan::bigint_sqr | ( | word | z[], |
size_t | z_size, | ||
word | workspace[], | ||
const word | x[], | ||
size_t | x_size, | ||
size_t | x_sw | ||
) |
Definition at line 312 of file mp_karat.cpp.
References bigint_comba_sqr16(), bigint_comba_sqr4(), bigint_comba_sqr6(), bigint_comba_sqr8(), bigint_comba_sqr9(), bigint_linmul3(), and BOTAN_ASSERT.
Referenced by bigint_monty_sqr(), and square().
word Botan::bigint_sub2 | ( | word | x[], |
size_t | x_size, | ||
const word | y[], | ||
size_t | y_size | ||
) |
Two operand subtraction
Definition at line 157 of file mp_core.cpp.
References BOTAN_ASSERT, word8_sub2(), and word_sub().
Referenced by Botan::BigInt::operator+=(), and Botan::BigInt::operator-=().
void Botan::bigint_sub2_rev | ( | word | x[], |
const word | y[], | ||
size_t | y_size | ||
) |
Two operand subtraction, x = y - x; assumes y >= x
Definition at line 180 of file mp_core.cpp.
References BOTAN_ASSERT, word8_sub2_rev(), and word_sub().
Referenced by Botan::BigInt::operator-=().
word Botan::bigint_sub3 | ( | word | z[], |
const word | x[], | ||
size_t | x_size, | ||
const word | y[], | ||
size_t | y_size | ||
) |
Three operand subtraction
Definition at line 198 of file mp_core.cpp.
References BOTAN_ASSERT, word8_sub3(), and word_sub().
Referenced by operator+(), Botan::BigInt::operator+=(), and operator-().
|
inline |
Definition at line 50 of file code_based_util.h.
Referenced by generate_mceliece_key(), mceliece_decrypt(), and Botan::McEliece_PrivateKey::McEliece_PrivateKey().
|
inline |
Definition at line 45 of file code_based_util.h.
Referenced by mceliece_decrypt().
class BOTAN_DLL Botan::BOTAN_DEPRECATED | ( | "LibraryInitializer is no longer required" | ) |
|
inline |
Swap 4 Ts in an array
Definition at line 112 of file bswap.h.
References reverse_bytes().
Referenced by Botan::SIMD_4x32::load_be(), load_be(), Botan::SIMD_4x32::load_le(), and load_le().
size_t Botan::buffer_insert | ( | std::vector< T, Alloc > & | buf, |
size_t | buf_offset, | ||
const T | input[], | ||
size_t | input_length | ||
) |
Definition at line 133 of file secmem.h.
References copy_mem(), and Botan::CT::min().
Referenced by Botan::MDx_HashFunction::add_data(), Botan::OFB::set_iv(), Botan::CTR_BE::set_iv(), Botan::Base64_Encoder::write(), and Botan::Hex_Encoder::write().
size_t Botan::buffer_insert | ( | std::vector< T, Alloc > & | buf, |
size_t | buf_offset, | ||
const std::vector< T, Alloc2 > & | input | ||
) |
BOTAN_DLL calendar_point Botan::calendar_value | ( | const std::chrono::system_clock::time_point & | time_point | ) |
Convert a time_point to a calendar_point
time_point | a time point from the system clock |
Definition at line 177 of file calendar.cpp.
References Botan::calendar_point::calendar_point().
Referenced by Botan::X509_Time::X509_Time().
|
inline |
Definition at line 108 of file donna128.h.
void Botan::CECPQ1_accept | ( | uint8_t | shared_key[CECPQ1_SHARED_KEY_BYTES], |
uint8_t | send[CECPQ1_ACCEPT_BYTES], | ||
const uint8_t | received[CECPQ1_OFFER_BYTES], | ||
RandomNumberGenerator & | rng | ||
) |
Definition at line 25 of file cecpq1.cpp.
References BoringSSL, curve25519_basepoint(), curve25519_donna(), newhope_sharedb(), and Botan::RandomNumberGenerator::random_vec().
Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange().
void BOTAN_DLL Botan::CECPQ1_accept | ( | uint8_t * | shared_key, |
uint8_t * | accept_message, | ||
const uint8_t * | offer_message, | ||
RandomNumberGenerator & | rng | ||
) |
void BOTAN_DLL Botan::CECPQ1_finish | ( | uint8_t * | shared_key, |
const CECPQ1_key & | offer_key, | ||
const uint8_t * | accept_message | ||
) |
void Botan::CECPQ1_finish | ( | uint8_t | shared_key[CECPQ1_SHARED_KEY_BYTES], |
const CECPQ1_key & | offer_key, | ||
const uint8_t | received[CECPQ1_ACCEPT_BYTES] | ||
) |
Definition at line 40 of file cecpq1.cpp.
References BoringSSL, curve25519_donna(), Botan::CECPQ1_key::m_newhope, Botan::CECPQ1_key::m_x25519, and newhope_shareda().
Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange().
void Botan::CECPQ1_offer | ( | uint8_t | send[CECPQ1_OFFER_BYTES], |
CECPQ1_key * | offer_key_output, | ||
RandomNumberGenerator & | rng | ||
) |
Definition at line 14 of file cecpq1.cpp.
References BoringSSL, curve25519_basepoint(), Botan::CECPQ1_key::m_newhope, Botan::CECPQ1_key::m_x25519, newhope_keygen(), and Botan::RandomNumberGenerator::random_vec().
Referenced by Botan::TLS::Server_Key_Exchange::Server_Key_Exchange().
void BOTAN_DLL Botan::CECPQ1_offer | ( | uint8_t * | offer_message, |
CECPQ1_key * | offer_key_output, | ||
RandomNumberGenerator & | rng | ||
) |
size_t Botan::ceil_log2 | ( | T | x | ) |
Definition at line 106 of file bit_ops.h.
Referenced by Botan::McEliece_PublicKey::get_message_word_bit_length(), Botan::McEliece_PrivateKey::McEliece_PrivateKey(), and mceliece_work_factor().
bool BOTAN_DLL Botan::check_bcrypt | ( | const std::string & | password, |
const std::string & | hash | ||
) |
Check a previously created password hash
password | the password to check against |
hash | the stored hash to check against |
Definition at line 132 of file bcrypt.cpp.
References same_mem(), and to_u32bit().
Referenced by botan_bcrypt_is_valid().
bool BOTAN_DLL Botan::check_passhash9 | ( | const std::string & | password, |
const std::string & | hash | ||
) |
Check a previously created password hash
password | the password to check against |
hash | the stored hash to check against |
Definition at line 75 of file passhash9.cpp.
References base64_decode(), Botan::OctetString::bits_of(), Botan::PBKDF::derive_key(), load_be< uint16_t >(), same_mem(), and Botan::ASN1::to_string().
|
inline |
Definition at line 174 of file numthry.h.
References is_prime().
|
inline |
BOTAN_DLL PK_Signer * Botan::choose_sig_format | ( | const Private_Key & | key, |
RandomNumberGenerator & | rng, | ||
const std::string & | hash_fn, | ||
AlgorithmIdentifier & | alg_id | ||
) |
Choose the default signature format for a certain public key signature scheme.
key | will be the key to choose a padding scheme for |
rng | the random generator to use |
hash_fn | is the desired hash function |
alg_id | will be set to the chosen scheme |
Definition at line 228 of file x509_ca.cpp.
References Botan::Public_Key::algo_name(), Botan::Public_Key::algorithm_identifier(), Botan::HashFunction::create_or_throw(), DER_SEQUENCE, hash, IEEE_1363, Botan::OIDS::lookup(), Botan::Public_Key::message_parts(), Botan::AlgorithmIdentifier::oid, and Botan::AlgorithmIdentifier::parameters.
Referenced by Botan::X509::create_cert_req(), Botan::X509::create_self_signed_cert(), and Botan::X509_CA::X509_CA().
|
inline |
Clamp
Definition at line 49 of file rounding.h.
std::string Botan::clean_ws | ( | const std::string & | s | ) |
Definition at line 13 of file read_cfg.cpp.
Referenced by read_cfg().
|
inline |
Zero out some bytes
ptr | a pointer to memory to zero |
bytes | the number of bytes to zero in ptr |
Definition at line 39 of file mem_ops.h.
Referenced by clear_mem().
|
inline |
Zero memory before use. This simply calls memset and should not be used in cases where the compiler cannot see the call as a side-effecting operation (for example, if calling clear_mem before deallocating memory, the compiler would be allowed to omit the call to memset entirely under the as-if rule.)
ptr | a pointer to an array of Ts to zero |
n | the number of Ts pointed to by ptr |
Definition at line 57 of file mem_ops.h.
References clear_bytes().
Referenced by Botan::mlock_allocator::allocate(), Botan::secure_allocator< T >::allocate(), aont_package(), base64_decode(), bigint_monty_redc(), bigint_mul(), bigint_shl1(), bigint_shr1(), hex_decode(), Botan::BigInt::mask_bits(), pbkdf2(), redc_p521(), Botan::polyn_gf2m::set_to_zero(), Botan::polyn_gf2m::sqmod_init(), zeroise(), Botan::Zlib_Style_Stream< Stream, ByteType >::Zlib_Style_Stream(), and Botan::Zlib_Style_Stream< Stream, ByteType >::~Zlib_Style_Stream().
|
inline |
Definition at line 113 of file donna128.h.
References Botan::donna128::lo().
|
inline |
Copy memory
out | the destination array |
in | the source array |
n | the number of elements of in/out |
Definition at line 68 of file mem_ops.h.
Referenced by Botan::TLS::Connection_Cipher_State::aead_nonce(), aont_package(), aont_unpackage(), bigint_monty_redc(), bigint_shl1(), bigint_shr1(), botan_cipher_update(), buffer_insert(), Botan::BER_Decoder::decode(), Botan::Blowfish::eks_key_schedule(), Botan::CryptoBox::encrypt(), Botan::TLS::Stream_Handshake_IO::format(), Botan::CCM_Mode::format_b0(), Botan::CCM_Mode::format_c0(), Botan::BER_Decoder::get_next_value(), Botan::X942_PRF::kdf(), Botan::KDF1::kdf(), Botan::KDF1_18033::kdf(), Botan::KDF2::kdf(), Botan::HKDF_Extract::kdf(), Botan::HKDF_Expand::kdf(), mceies_encrypt(), mceliece_decrypt(), operator+=(), operator^(), Botan::PKCS5_PBKDF1::pbkdf(), Botan::DataSource_Memory::peek(), Botan::CFB_Encryption::process(), Botan::CFB_Decryption::process(), Botan::CBC_Decryption::process(), Botan::HMAC_DRBG::randomize_with_input(), Botan::DataSource_Memory::read(), rfc3394_keyunwrap(), rfc3394_keywrap(), Botan::polyn_gf2m::sqmod_init(), unlock(), Botan::Base64_Encoder::write(), Botan::Buffered_Filter::write(), Botan::Hex_Encoder::write(), Botan::Hex_Decoder::write(), and Botan::Base64_Decoder::write().
void Botan::copy_out_be | ( | uint8_t | out[], |
size_t | out_bytes, | ||
const T | in[] | ||
) |
Definition at line 661 of file loadstor.h.
References get_byte(), and store_be().
Referenced by copy_out_vec_be(), and Botan::SIMD_4x32::store_be().
void Botan::copy_out_le | ( | uint8_t | out[], |
size_t | out_bytes, | ||
const T | in[] | ||
) |
Definition at line 682 of file loadstor.h.
References get_byte(), and store_le().
Referenced by Botan::SHAKE_128_Cipher::cipher(), copy_out_vec_le(), and Botan::SIMD_4x32::store_le().
void Botan::copy_out_vec_be | ( | uint8_t | out[], |
size_t | out_bytes, | ||
const std::vector< T, Alloc > & | in | ||
) |
Definition at line 676 of file loadstor.h.
References copy_out_be().
void Botan::copy_out_vec_le | ( | uint8_t | out[], |
size_t | out_bytes, | ||
const std::vector< T, Alloc > & | in | ||
) |
Definition at line 697 of file loadstor.h.
References copy_out_le().
Referenced by Botan::MD4::copy_out(), and Botan::MD5::copy_out().
BOTAN_DLL AlternativeName Botan::create_alt_name | ( | const Data_Store & | info | ) |
Definition at line 692 of file x509cert.cpp.
References Botan::AlternativeName::add_attribute(), and Botan::Data_Store::search_for().
Referenced by Botan::PKCS10_Request::subject_alt_name().
BOTAN_DLL X509_DN Botan::create_dn | ( | const Data_Store & | info | ) |
Definition at line 673 of file x509cert.cpp.
References Botan::X509_DN::add_attribute(), and Botan::Data_Store::search_for().
Referenced by Botan::X509_CRL::issuer_dn(), Botan::X509_Certificate::issuer_dn(), Botan::PKCS10_Request::subject_dn(), and Botan::X509_Certificate::subject_dn().
BOTAN_DLL std::unique_ptr< Private_Key > Botan::create_private_key | ( | const std::string & | algo_name, |
RandomNumberGenerator & | rng, | ||
const std::string & | algo_params = "" |
||
) |
Create a new key For ECC keys, algo_params specifies EC group (eg, "secp256r1") For DH/DSA/ElGamal keys, algo_params is DL group (eg, "modp/ietf/2048") For RSA, algo_params is integer keylength For McEliece, algo_params is n,t If algo_params is left empty, suitable default parameters are chosen.
Definition at line 204 of file pk_algs.cpp.
References split_on(), and to_u32bit().
Referenced by botan_privkey_create().
Const time modular inversion Requires the modulus be odd
Definition at line 153 of file numthry.cpp.
References bigint_cnd_abs(), bigint_cnd_add(), bigint_cnd_sub(), bigint_cnd_swap(), bigint_shr1(), Botan::BigInt::bits(), BOTAN_ASSERT, Botan::BigInt::data(), Botan::BigInt::get_word_vector(), Botan::BigInt::grow_to(), Botan::BigInt::is_even(), Botan::BigInt::is_negative(), Botan::BigInt::is_zero(), Botan::CT::poison(), Botan::BigInt::sig_words(), and Botan::CT::unpoison().
Referenced by inverse_mod().
|
inline |
Count the trailing zero bits in n
n | an integer value |
Definition at line 97 of file bit_ops.h.
Referenced by low_zero_bits().
void BOTAN_DLL Botan::curve25519_basepoint | ( | uint8_t | mypublic[32], |
const uint8_t | secret[32] | ||
) |
Exponentiate by the x25519 base point
mypublic | output value |
secret | random scalar |
Definition at line 15 of file curve25519.cpp.
References curve25519_donna().
Referenced by CECPQ1_accept(), CECPQ1_offer(), Botan::Curve25519_PrivateKey::check_key(), and Botan::Curve25519_PrivateKey::Curve25519_PrivateKey().
void BOTAN_DLL Botan::curve25519_donna | ( | uint8_t | mypublic[32], |
const uint8_t | secret[32], | ||
const uint8_t | basepoint[32] | ||
) |
Referenced by CECPQ1_accept(), CECPQ1_finish(), and curve25519_basepoint().
Definition at line 437 of file donna.cpp.
References Botan::CT::poison(), and Botan::CT::unpoison().
gf2m Botan::decode_gf2m | ( | const uint8_t * | mem | ) |
BigInt Division
x | an integer |
y | a non-zero integer |
q | will be set to x / y |
r | will be set to x % y |
Definition at line 58 of file divide.cpp.
References bigint_divop(), Botan::BigInt::cmp(), Botan::BigInt::grow_to(), Botan::BigInt::is_negative(), Botan::BigInt::is_zero(), MP_WORD_BITS, MP_WORD_MAX, MP_WORD_TOP_BIT, Botan::BigInt::mutable_data(), Botan::BigInt::Positive, Botan::BigInt::set_sign(), Botan::BigInt::sig_words(), and Botan::BigInt::word_at().
Referenced by botan_mp_div(), Botan::BigInt::encode(), operator%(), and operator/().
BOTAN_DLL size_t Botan::dl_exponent_size | ( | size_t | prime_group_size | ) |
Return the appropriate exponent size to use for a particular prime group. This is twice the size of the estimated cost of breaking the key using an index calculus attack; the assumption is that if an arbitrary discrete log on a group of size bits would take about 2^n effort, and thus using an exponent of size 2^(2*n) implies that all available attacks are about as easy (as e.g Pollard's kangaroo algorithm can compute the DL in sqrt(x) operations) while minimizing the exponent size for performance reasons.
Definition at line 40 of file workfactor.cpp.
Referenced by Botan::DH_PrivateKey::DH_PrivateKey(), Botan::DL_Group::DL_Group(), and Botan::ElGamal_PrivateKey::ElGamal_PrivateKey().
BOTAN_DLL size_t Botan::dl_work_factor | ( | size_t | prime_group_size | ) |
Estimate work factor for discrete logarithm
prime_group_size | size of the group in bits |
Definition at line 34 of file workfactor.cpp.
References if_work_factor().
Referenced by Botan::DL_Scheme_PublicKey::estimated_strength().
secure_vector< uint8_t > BOTAN_DLL Botan::EC2OSP | ( | const PointGFp & | point, |
uint8_t | format | ||
) |
Definition at line 470 of file point_gfp.cpp.
References Botan::BigInt::bytes(), Botan::PointGFp::COMPRESSED, Botan::BigInt::encode_1363(), Botan::PointGFp::get_affine_x(), Botan::PointGFp::get_affine_y(), Botan::BigInt::get_bit(), Botan::PointGFp::get_curve(), Botan::CurveGFp::get_p(), Botan::PointGFp::HYBRID, Botan::PointGFp::is_zero(), and Botan::PointGFp::UNCOMPRESSED.
Referenced by Botan::EC_Group::DER_encode(), Botan::ECIES_KA_Operation::derive_secret(), Botan::ECIES_Encryptor::ECIES_Encryptor(), Botan::EC_PublicKey::public_key_bits(), and Botan::ECDH_PublicKey::public_value().
BOTAN_DLL size_t Botan::ecp_work_factor | ( | size_t | prime_group_size | ) |
Estimate work factor for EC discrete logarithm
prime_group_size | size of the group in bits |
Definition at line 14 of file workfactor.cpp.
Referenced by Botan::EC_PublicKey::estimated_strength().
uint32_t Botan::encode_gf2m | ( | gf2m | to_enc, |
uint8_t * | mem | ||
) |
Definition at line 97 of file gf2m_small_m.cpp.
BOTAN_DLL std::string Botan::erase_chars | ( | const std::string & | str, |
const std::set< char > & | chars | ||
) |
Erase characters from a string
Definition at line 302 of file parsing.cpp.
uint16_t Botan::expand_mask_16bit | ( | T | tst | ) |
Expand an input to a bit mask depending on it being being zero or non-zero
tst | the input |
Definition at line 25 of file code_based_util.h.
Referenced by Botan::polyn_gf2m::calc_degree_secure(), Botan::polyn_gf2m::eea_with_coefficients(), and Botan::polyn_gf2m::patchup_deg_secure().
secure_vector< gf2m > Botan::find_roots_gf2m_decomp | ( | const polyn_gf2m & | polyn, |
uint32_t | code_length | ||
) |
Find the roots of a polynomial over GF(2^m) using the method by Federenko et al.
Definition at line 311 of file gf2m_rootfind_dcmp.cpp.
Compute the greatest common divisor
x | a positive integer |
y | a positive integer |
Definition at line 46 of file numthry.cpp.
References Botan::BigInt::is_nonzero(), Botan::BigInt::is_zero(), low_zero_bits(), Botan::CT::min(), Botan::BigInt::Positive, and Botan::BigInt::set_sign().
Referenced by botan_mp_gcd(), Botan::ECIES_Decryptor::ECIES_Decryptor(), lcm(), and random_prime().
void Botan::gcm_multiply_clmul | ( | uint8_t | x[16], |
const uint8_t | H[16] | ||
) |
std::string BOTAN_DLL Botan::generate_bcrypt | ( | const std::string & | password, |
RandomNumberGenerator & | rng, | ||
uint16_t | work_factor = 10 |
||
) |
Create a password hash using Bcrypt
password | the password |
rng | a random number generator |
work_factor | how much work to do to slow down guessing attacks |
Definition at line 125 of file bcrypt.cpp.
References Botan::RandomNumberGenerator::random_vec(), and unlock().
Referenced by botan_bcrypt_generate().
bool BOTAN_DLL Botan::generate_dsa_primes | ( | RandomNumberGenerator & | rng, |
BigInt & | p_out, | ||
BigInt & | q_out, | ||
size_t | pbits, | ||
size_t | qbits, | ||
const std::vector< uint8_t > & | seed, | ||
size_t | offset = 0 |
||
) |
Generate DSA parameters using the FIPS 186 kosherizer
rng | a random number generator |
p_out | where the prime p will be stored |
q_out | where the prime q will be stored |
pbits | how long p will be in bits |
qbits | how long q will be in bits |
seed | the seed used to generate the parameters |
offset | optional offset from seed to start searching at |
Definition at line 39 of file dsa_gen.cpp.
References Botan::BigInt::binary_decode(), Botan::BigInt::bits(), Botan::HashFunction::create_or_throw(), hash, is_prime(), Botan::BigInt::set_bit(), and Botan::ASN1::to_string().
Referenced by Botan::DL_Group::DL_Group(), and generate_dsa_primes().
std::vector< uint8_t > BOTAN_DLL Botan::generate_dsa_primes | ( | RandomNumberGenerator & | rng, |
BigInt & | p_out, | ||
BigInt & | q_out, | ||
size_t | pbits, | ||
size_t | qbits | ||
) |
Generate DSA parameters using the FIPS 186 kosherizer
rng | a random number generator |
p_out | where the prime p will be stored |
q_out | where the prime q will be stored |
pbits | how long p will be in bits |
qbits | how long q will be in bits |
Definition at line 120 of file dsa_gen.cpp.
References generate_dsa_primes(), and Botan::RandomNumberGenerator::randomize().
McEliece_PrivateKey Botan::generate_mceliece_key | ( | RandomNumberGenerator & | rng, |
uint32_t | ext_deg, | ||
uint32_t | code_length, | ||
uint32_t | t | ||
) |
Definition at line 208 of file code_based_key_gen.cpp.
References bit_size_to_32bit_size(), code_length, Botan::polyn_gf2m::sqrt_mod_init(), store_le(), and syndrome_init().
Referenced by Botan::McEliece_PrivateKey::McEliece_PrivateKey().
std::string BOTAN_DLL Botan::generate_passhash9 | ( | const std::string & | password, |
RandomNumberGenerator & | rng, | ||
uint16_t | work_factor = 10 , |
||
uint8_t | alg_id = 1 |
||
) |
Create a password hash using PBKDF2
password | the password |
rng | a random number generator |
work_factor | how much work to do to slow down guessing attacks |
alg_id | specifies which PRF to use with PBKDF2 0 is HMAC(SHA-1) 1 is HMAC(SHA-256) 2 is CMAC(Blowfish) 3 is HMAC(SHA-384) 4 is HMAC(SHA-512) all other values are currently undefined |
Definition at line 43 of file passhash9.cpp.
References base64_encode(), get_byte(), Botan::RandomNumberGenerator::randomize(), and Botan::ASN1::to_string().
BigInt BOTAN_DLL Botan::generate_rfc6979_nonce | ( | const BigInt & | x, |
const BigInt & | q, | ||
const BigInt & | h, | ||
const std::string & | hash | ||
) |
x | the secret (EC)DSA key |
q | the group order |
h | the message hash already reduced mod q |
hash | the hash function used to generate h |
Definition at line 49 of file rfc6979.cpp.
References Botan::RFC6979_Nonce_Generator::nonce_for().
BigInt BOTAN_DLL Botan::generate_srp6_verifier | ( | const std::string & | identifier, |
const std::string & | password, | ||
const std::vector< uint8_t > & | salt, | ||
const std::string & | group_id, | ||
const std::string & | hash_id | ||
) |
Generate a new SRP-6 verifier
identifier | a username or other client identifier |
password | the secret used to authenticate user |
salt | a randomly chosen value, at least 128 bits long |
group_id | specifies the shared SRP group |
hash_id | specifies a secure hash function |
Definition at line 110 of file srp6.cpp.
References Botan::DL_Group::get_g(), Botan::DL_Group::get_p(), and power_mod().
BOTAN_DLL AEAD_Mode * Botan::get_aead | ( | const std::string & | name, |
Cipher_Dir | direction | ||
) |
Get an AEAD mode by name (eg "AES-128/GCM" or "Serpent/EAX")
name | AEAD name |
direction | ENCRYPTION or DECRYPTION |
Definition at line 41 of file aead.cpp.
References Botan::SCAN_Name::algo_name(), Botan::SCAN_Name::arg(), Botan::SCAN_Name::arg_as_integer(), Botan::SCAN_Name::arg_count(), Botan::BlockCipher::create(), ENCRYPTION, parse_algorithm_name(), and split_on().
Referenced by Botan::TLS::Connection_Cipher_State::Connection_Cipher_State(), Botan::TLS::Session::decrypt(), Botan::TLS::Session::encrypt(), get_cipher_mode(), mceies_decrypt(), and mceies_encrypt().
BOTAN_DLL BlockCipherModePaddingMethod * Botan::get_bc_pad | ( | const std::string & | algo_spec | ) |
Get a block cipher padding method by name
Get a block cipher padding mode by name (eg "NoPadding" or "PKCS7")
algo_spec | block cipher padding mode name |
Definition at line 18 of file mode_pad.cpp.
Referenced by get_cipher_mode().
|
inline |
Block cipher factory method.
algo_spec | the name of the desired block cipher |
provider | the provider to use |
Definition at line 41 of file lookup.h.
References Botan::BlockCipher::create().
|
inline |
Definition at line 55 of file lookup.h.
References Botan::BlockCipher::providers().
|
inline |
Byte extraction
byte_num | which byte to extract, 0 == highest byte |
input | the value to extract from |
Definition at line 47 of file loadstor.h.
Referenced by aont_package(), aont_unpackage(), Botan::TLS::append_tls_length_value(), Botan::TLS::TLS_CBC_HMAC_AEAD_Mode::assoc_data_with_len(), Botan::BigInt::byte_at(), copy_out_be(), copy_out_le(), Botan::CryptoBox::decrypt(), Botan::Twofish::decrypt_n(), Botan::Blowfish::decrypt_n(), Botan::DES::decrypt_n(), Botan::TripleDES::decrypt_n(), Botan::CCM_Mode::encode_length(), Botan::CryptoBox::encrypt(), Botan::Twofish::encrypt_n(), Botan::DES::encrypt_n(), Botan::Blowfish::encrypt_n(), Botan::TripleDES::encrypt_n(), Botan::SHA_3::expand(), Botan::TLS::Connection_Cipher_State::format_ad(), generate_passhash9(), ipv4_to_string(), Botan::TLS::Channel::key_material_export(), Botan::TLS::Protocol_Version::major_version(), Botan::TLS::Protocol_Version::minor_version(), Botan::RDRAND_RNG::randomize(), Botan::TLS::Server_Name_Indicator::serialize(), Botan::TLS::Application_Layer_Protocol_Notification::serialize(), Botan::TLS::Supported_Elliptic_Curves::serialize(), Botan::TLS::Signature_Algorithms::serialize(), Botan::TLS::SRTP_Protection_Profiles::serialize(), Botan::TLS::Extensions::serialize(), Botan::TLS::Server_Key_Exchange::Server_Key_Exchange(), Botan::CCM_Mode::set_associated_data(), significant_bytes(), Botan::RTSS_Share::split(), store_be(), store_le(), Botan::Buffered_Computation::update_be(), and Botan::TLS::write_record().
BOTAN_DLL Keyed_Filter * Botan::get_cipher | ( | const std::string & | algo_spec, |
Cipher_Dir | direction | ||
) |
Factory method for general symmetric cipher filters. No key will be set in the filter.
algo_spec | the name of the desired cipher |
direction | determines whether the filter will be an encrypting or decrypting filter |
Definition at line 12 of file key_filt.cpp.
References get_cipher_mode().
Referenced by Botan::CryptoBox::decrypt(), Botan::CryptoBox::encrypt(), and get_cipher().
BOTAN_DLL Keyed_Filter * Botan::get_cipher | ( | const std::string & | algo_spec, |
const SymmetricKey & | key, | ||
const InitializationVector & | iv, | ||
Cipher_Dir | direction | ||
) |
Factory method for general symmetric cipher filters.
algo_spec | the name of the desired cipher |
key | the key to be used for encryption/decryption performed by the filter |
iv | the initialization vector to be used |
direction | determines whether the filter will be an encrypting or decrypting filter |
Definition at line 21 of file key_filt.cpp.
References get_cipher(), Botan::OctetString::length(), and Botan::Keyed_Filter::set_iv().
BOTAN_DLL Keyed_Filter * Botan::get_cipher | ( | const std::string & | algo_spec, |
const SymmetricKey & | key, | ||
Cipher_Dir | direction | ||
) |
Factory method for general symmetric cipher filters.
algo_spec | the name of the desired cipher |
key | the key to be used for encryption/decryption performed by the filter |
direction | determines whether the filter will be an encrypting or decrypting filter |
Definition at line 32 of file key_filt.cpp.
References get_cipher(), and Botan::Keyed_Filter::set_key().
BOTAN_DLL Cipher_Mode * Botan::get_cipher_mode | ( | const std::string & | algo_spec, |
Cipher_Dir | direction | ||
) |
Get a cipher mode by name (eg "AES-128/CBC" or "Serpent/XTS")
algo_spec | cipher name |
direction | ENCRYPTION or DECRYPTION |
Definition at line 39 of file cipher_mode.cpp.
References Botan::SCAN_Name::algo_name(), Botan::SCAN_Name::arg(), Botan::SCAN_Name::arg_as_integer(), Botan::SCAN_Name::arg_count(), Botan::BlockCipher::create(), Botan::StreamCipher::create(), ENCRYPTION, get_aead(), get_bc_pad(), parse_algorithm_name(), and split_on().
Referenced by botan_cipher_init(), Botan::ECIES_System_Params::create_cipher(), get_cipher(), and pbes2_decrypt().
BOTAN_DLL EME * Botan::get_eme | ( | const std::string & | algo_spec | ) |
Factory method for EME (message-encoding methods for encryption) objects
algo_spec | the name of the EME to create |
Definition at line 25 of file eme.cpp.
References Botan::SCAN_Name::algo_name(), Botan::SCAN_Name::arg(), Botan::SCAN_Name::arg_count(), Botan::HashFunction::create(), and hash.
Referenced by Botan::PK_Ops::Decryption_with_EME::Decryption_with_EME(), and Botan::PK_Ops::Encryption_with_EME::Encryption_with_EME().
BOTAN_DLL EMSA * Botan::get_emsa | ( | const std::string & | algo_spec | ) |
Factory method for EMSA (message-encoding methods for signatures with appendix) objects
algo_spec | the name of the EMSA to create |
Definition at line 36 of file emsa.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::HashFunction::create(), hash, and salt_size.
BOTAN_DLL std::vector< std::string > Botan::get_files_recursive | ( | const std::string & | dir | ) |
|
inline |
Definition at line 109 of file lookup.h.
References Botan::HashFunction::create().
|
inline |
Hash function factory method.
algo_spec | the name of the desired hash function |
provider | the provider to use |
Definition at line 95 of file lookup.h.
References Botan::HashFunction::create().
|
inline |
Definition at line 116 of file lookup.h.
References Botan::HashFunction::providers().
BOTAN_DLL KDF * Botan::get_kdf | ( | const std::string & | algo_spec | ) |
Factory method for KDF (key derivation function)
algo_spec | the name of the KDF to create |
Definition at line 226 of file kdf.cpp.
References Botan::SCAN_Name::algo_name(), and Botan::KDF::create().
Referenced by botan_kdf(), Botan::PK_Ops::KEM_Decryption_with_KDF::KEM_Decryption_with_KDF(), Botan::PK_Ops::KEM_Encryption_with_KDF::KEM_Encryption_with_KDF(), Botan::PK_Ops::Key_Agreement_with_KDF::Key_Agreement_with_KDF(), and Botan::TLS::Handshake_State::protocol_specific_prf().
|
inline |
MAC factory method.
algo_spec | the name of the desired MAC |
provider | the provider to use |
Definition at line 129 of file lookup.h.
References Botan::MessageAuthenticationCode::create().
|
inline |
Definition at line 143 of file lookup.h.
References Botan::MessageAuthenticationCode::providers().
|
inline |
Password based key derivation function factory method
algo_spec | the name of the desired PBKDF algorithm |
provider | the provider to use |
Definition at line 216 of file pbkdf.h.
References Botan::PBKDF::create().
Referenced by botan_pbkdf(), botan_pbkdf_timed(), pbes2_decrypt(), and Botan::TLS::Session_Manager_SQL::Session_Manager_SQL().
|
inline |
Stream cipher factory method.
algo_spec | the name of the desired stream cipher |
provider | the provider to use |
Definition at line 68 of file lookup.h.
References Botan::StreamCipher::create().
|
inline |
Definition at line 82 of file lookup.h.
References Botan::StreamCipher::providers().
Definition at line 31 of file code_based_util.h.
|
inline |
Compute Hamming weights
n | an integer value |
BOTAN_DLL std::string Botan::hash_for_emsa | ( | const std::string & | algo_spec | ) |
Returns the hash function used in the given EMSA scheme If the hash function is not specified or not understood, returns "SHA-512"
algo_spec | the name of the EMSA |
Definition at line 142 of file emsa.cpp.
References Botan::SCAN_Name::arg(), and Botan::SCAN_Name::arg_count().
Referenced by Botan::PKCS11::MechanismWrapper::create_ecdsa_mechanism().
size_t BOTAN_DLL Botan::hex_decode | ( | uint8_t | output[], |
const char | input[], | ||
size_t | input_length, | ||
size_t & | input_consumed, | ||
bool | ignore_ws = true |
||
) |
Perform hex decoding
output | an array of at least input_length/2 bytes |
input | some hex input |
input_length | length of input in bytes |
input_consumed | is an output parameter which says how many bytes of input were actually consumed. If less than input_length, then the range input[consumed:length] should be passed in later along with more input. |
ignore_ws | ignore whitespace on input; if false, throw an exception if whitespace is encountered |
Definition at line 49 of file hex.cpp.
References clear_mem().
Referenced by Botan::Hex_Decoder::end_msg(), Botan::Data_Store::get1_memvec(), hex_decode(), hex_decode_locked(), Botan::OctetString::OctetString(), Botan::X509_Certificate::subject_public_key_bits(), Botan::UUID::UUID(), and Botan::Hex_Decoder::write().
size_t BOTAN_DLL Botan::hex_decode | ( | uint8_t | output[], |
const char | input[], | ||
size_t | input_length, | ||
bool | ignore_ws = true |
||
) |
Perform hex decoding
output | an array of at least input_length/2 bytes |
input | some hex input |
input_length | length of input in bytes |
ignore_ws | ignore whitespace on input; if false, throw an exception if whitespace is encountered |
Definition at line 140 of file hex.cpp.
References hex_decode().
size_t BOTAN_DLL Botan::hex_decode | ( | uint8_t | output[], |
const std::string & | input, | ||
bool | ignore_ws = true |
||
) |
Perform hex decoding
output | an array of at least input_length/2 bytes |
input | some hex input |
ignore_ws | ignore whitespace on input; if false, throw an exception if whitespace is encountered |
Definition at line 155 of file hex.cpp.
References hex_decode().
std::vector< uint8_t > BOTAN_DLL Botan::hex_decode | ( | const char | input[], |
size_t | input_length, | ||
bool | ignore_ws = true |
||
) |
Perform hex decoding
input | some hex input |
input_length | the length of input in bytes |
ignore_ws | ignore whitespace on input; if false, throw an exception if whitespace is encountered |
Definition at line 183 of file hex.cpp.
References hex_decode().
std::vector< uint8_t > BOTAN_DLL Botan::hex_decode | ( | const std::string & | input, |
bool | ignore_ws = true |
||
) |
Perform hex decoding
input | some hex input |
ignore_ws | ignore whitespace on input; if false, throw an exception if whitespace is encountered |
Definition at line 198 of file hex.cpp.
References hex_decode().
secure_vector< uint8_t > BOTAN_DLL Botan::hex_decode_locked | ( | const char | input[], |
size_t | input_length, | ||
bool | ignore_ws = true |
||
) |
Perform hex decoding
input | some hex input |
input_length | the length of input in bytes |
ignore_ws | ignore whitespace on input; if false, throw an exception if whitespace is encountered |
Definition at line 162 of file hex.cpp.
References hex_decode().
Referenced by Botan::BigInt::decode(), hex_decode_locked(), and Botan::RTSS_Share::RTSS_Share().
secure_vector< uint8_t > BOTAN_DLL Botan::hex_decode_locked | ( | const std::string & | input, |
bool | ignore_ws = true |
||
) |
Perform hex decoding
input | some hex input |
ignore_ws | ignore whitespace on input; if false, throw an exception if whitespace is encountered |
Definition at line 177 of file hex.cpp.
References hex_decode_locked().
void BOTAN_DLL Botan::hex_encode | ( | char | output[], |
const uint8_t | input[], | ||
size_t | input_length, | ||
bool | uppercase = true |
||
) |
Perform hex encoding
output | an array of at least input_length*2 bytes |
input | is some binary data |
input_length | length of input in bytes |
uppercase | should output be upper or lower case? |
Definition at line 14 of file hex.cpp.
Referenced by Botan::Data_Store::add(), Botan::OctetString::as_string(), botan_hex_encode(), Botan::BigInt::encode(), Botan::Private_Key::fingerprint(), Botan::X509_Certificate::fingerprint(), hex_encode(), Botan::TLS::Session_Manager_SQL::load_from_session_id(), Botan::TLS::Session_Manager_In_Memory::load_from_session_id(), Botan::TLS::Session_Manager_SQL::remove_entry(), Botan::TLS::Session_Manager_In_Memory::remove_entry(), Botan::TLS::Session_Manager_SQL::save(), Botan::TLS::Session_Manager_In_Memory::save(), Botan::RTSS_Share::to_string(), Botan::UUID::to_string(), Botan::X509_Certificate::to_string(), and Botan::UUID::UUID().
std::string BOTAN_DLL Botan::hex_encode | ( | const uint8_t | input[], |
size_t | input_length, | ||
bool | uppercase = true |
||
) |
Perform hex encoding
input | some input |
input_length | length of input in bytes |
uppercase | should output be upper or lower case? |
Definition at line 37 of file hex.cpp.
References hex_encode().
std::string Botan::hex_encode | ( | const std::vector< uint8_t, Alloc > & | input, |
bool | uppercase = true |
||
) |
Perform hex encoding
input | some input |
uppercase | should output be upper or lower case? |
Definition at line 46 of file hex.h.
References hex_encode().
|
inline |
Return the index of the highest set bit T is an unsigned integer type
n | an integer value |
Definition at line 37 of file bit_ops.h.
Referenced by Botan::BigInt::bits(), and Botan::OID::encode_into().
bool BOTAN_DLL Botan::host_wildcard_match | ( | const std::string & | issued, |
const std::string & | host | ||
) |
Definition at line 337 of file parsing.cpp.
Referenced by Botan::X509_Certificate::matches_dns_name().
BOTAN_DLL uint8_t Botan::ieee1363_hash_id | ( | const std::string & | hash_name | ) |
Return the IEEE 1363 hash identifier
hash_name | the name of the hash function |
Definition at line 104 of file hash_id.cpp.
Referenced by Botan::EMSA_X931::EMSA_X931().
BOTAN_DLL size_t Botan::if_work_factor | ( | size_t | n_bits | ) |
Estimate work factor for integer factorization
n_bits | size of modulus in bits |
Definition at line 19 of file workfactor.cpp.
Referenced by dl_work_factor(), Botan::RSA_PublicKey::estimated_strength(), and Botan::TPM_PrivateKey::estimated_strength().
Modular inversion
x | a positive integer |
modulus | a positive integer |
Definition at line 276 of file numthry.cpp.
References ct_inverse_mod_odd_modulus(), Botan::BigInt::is_even(), Botan::BigInt::is_negative(), Botan::BigInt::is_nonzero(), Botan::BigInt::is_odd(), Botan::BigInt::is_zero(), and low_zero_bits().
Referenced by botan_mp_mod_inverse(), Botan::RSA_PrivateKey::check_key(), Botan::EC_PrivateKey::EC_PrivateKey(), Botan::PointGFp::get_affine_x(), Botan::PointGFp::get_affine_y(), and Botan::RSA_PrivateKey::RSA_PrivateKey().
BOTAN_DLL std::string Botan::ipv4_to_string | ( | uint32_t | ip_addr | ) |
Convert an IPv4 address to a string
ip_addr | the IPv4 address to convert |
Definition at line 288 of file parsing.cpp.
References get_byte(), and Botan::ASN1::to_string().
Referenced by Botan::AlternativeName::decode_from(), and Botan::GeneralName::decode_from().
|
inline |
Power of 2 test. T should be an unsigned integer type
arg | an integer value |
Definition at line 25 of file bit_ops.h.
Referenced by operator%(), Botan::BigInt::operator%=(), and Botan::BigInt::operator/=().
bool BOTAN_DLL Botan::is_prime | ( | const BigInt & | n, |
RandomNumberGenerator & | rng, | ||
size_t | prob = 56 , |
||
bool | is_random = false |
||
) |
Check for primality
n | a positive integer to test for primality |
rng | a random number generator |
prob | chance of false positive is bounded by 1/2**prob |
is_random | true if n was randomly chosen by us |
Definition at line 441 of file numthry.cpp.
References Botan::BigInt::bits(), Botan::BigInt::is_even(), low_zero_bits(), PRIME_TABLE_SIZE, PRIMES, Botan::BigInt::random_integer(), and Botan::BigInt::word_at().
Referenced by botan_mp_is_prime(), Botan::RSA_PrivateKey::check_key(), check_prime(), Botan::DL_Group::DL_Group(), generate_dsa_primes(), quick_check_prime(), random_prime(), random_safe_prime(), Botan::DL_Group::verify_group(), Botan::EC_Group::verify_group(), and verify_prime().
Compute the Jacobi symbol. If n is prime, this is equivalent to the Legendre symbol.
a | is a non-negative integer |
n | is an odd integer > 1 |
Definition at line 15 of file jacobi.cpp.
References Botan::BigInt::is_even(), Botan::BigInt::is_negative(), Botan::BigInt::is_zero(), and low_zero_bits().
Referenced by Botan::DL_Group::DL_Group(), and ressol().
std::string BOTAN_DLL Botan::key_constraints_to_string | ( | Key_Constraints | constraints | ) |
Definition at line 14 of file key_constraint.cpp.
References CRL_SIGN, DATA_ENCIPHERMENT, DECIPHER_ONLY, DIGITAL_SIGNATURE, ENCIPHER_ONLY, KEY_AGREEMENT, KEY_CERT_SIGN, KEY_ENCIPHERMENT, NO_CONSTRAINTS, and NON_REPUDIATION.
Referenced by verify_cert_constraints_valid_for_key_type().
Least common multiple
x | a positive integer |
y | a positive integer |
Definition at line 73 of file numthry.cpp.
References gcd().
Referenced by Botan::RSA_PrivateKey::check_key(), and Botan::RSA_PrivateKey::RSA_PrivateKey().
Definition at line 40 of file code_based_util.h.
Referenced by syndrome_init().
|
inline |
Load a big-endian word
in | a pointer to some bytes |
off | an offset into the array |
Definition at line 113 of file loadstor.h.
Referenced by Botan::Blowfish::decrypt_n(), Botan::CAST_128::decrypt_n(), Botan::XTEA::decrypt_n(), Botan::XTEA::encrypt_n(), Botan::Blowfish::encrypt_n(), Botan::CAST_128::encrypt_n(), and Botan::SIMD_4x32::load_be().
|
inline |
Load two big-endian words
in | a pointer to some bytes |
x0 | where the first word will be written |
x1 | where the second word will be written |
Definition at line 353 of file loadstor.h.
|
inline |
Load four big-endian words
in | a pointer to some bytes |
x0 | where the first word will be written |
x1 | where the second word will be written |
x2 | where the third word will be written |
x3 | where the fourth word will be written |
Definition at line 368 of file loadstor.h.
|
inline |
Load eight big-endian words
in | a pointer to some bytes |
x0 | where the first word will be written |
x1 | where the second word will be written |
x2 | where the third word will be written |
x3 | where the fourth word will be written |
x4 | where the fifth word will be written |
x5 | where the sixth word will be written |
x6 | where the seventh word will be written |
x7 | where the eighth word will be written |
Definition at line 390 of file loadstor.h.
|
inline |
Load a variable number of big-endian words
out | the output array of words |
in | the input array of bytes |
count | how many words are in in |
Definition at line 411 of file loadstor.h.
References bswap_4(), and reverse_bytes().
|
inline |
Load a big-endian uint16_t
in | a pointer to some bytes |
off | an offset into the array |
Definition at line 145 of file loadstor.h.
References make_uint16().
Referenced by Botan::TLS::Datagram_Handshake_IO::add_record(), check_passhash9(), Botan::MISTY1::decrypt_n(), Botan::KASUMI::decrypt_n(), Botan::MISTY1::encrypt_n(), and Botan::KASUMI::encrypt_n().
|
inline |
Load a big-endian uint32_t
in | a pointer to some bytes |
off | an offset into the array |
Definition at line 185 of file loadstor.h.
References make_uint32().
Referenced by Botan::AlternativeName::decode_from(), Botan::GeneralName::decode_from(), Botan::SEED::decrypt_n(), Botan::Noekeon::decrypt_n(), Botan::CAST_256::decrypt_n(), Botan::Noekeon::encrypt_n(), Botan::CAST_256::encrypt_n(), and Botan::SEED::encrypt_n().
|
inline |
Load a big-endian uint64_t
in | a pointer to some bytes |
off | an offset into the array |
Definition at line 223 of file loadstor.h.
References make_uint64().
Referenced by rfc3394_keyunwrap().
|
inline |
Load a little-endian word
in | a pointer to some bytes |
off | an offset into the array |
Definition at line 129 of file loadstor.h.
Referenced by Botan::MD4::compress_n(), Botan::MD5::compress_n(), Botan::Threefish_512::decrypt_n(), Botan::Twofish::decrypt_n(), Botan::Serpent::decrypt_n(), Botan::Twofish::encrypt_n(), Botan::Threefish_512::encrypt_n(), Botan::Serpent::encrypt_n(), and Botan::SIMD_4x32::load_le().
|
inline |
Load two little-endian words
in | a pointer to some bytes |
x0 | where the first word will be written |
x1 | where the second word will be written |
Definition at line 263 of file loadstor.h.
|
inline |
Load four little-endian words
in | a pointer to some bytes |
x0 | where the first word will be written |
x1 | where the second word will be written |
x2 | where the third word will be written |
x3 | where the fourth word will be written |
Definition at line 278 of file loadstor.h.
|
inline |
Load eight little-endian words
in | a pointer to some bytes |
x0 | where the first word will be written |
x1 | where the second word will be written |
x2 | where the third word will be written |
x3 | where the fourth word will be written |
x4 | where the fifth word will be written |
x5 | where the sixth word will be written |
x6 | where the seventh word will be written |
x7 | where the eighth word will be written |
Definition at line 300 of file loadstor.h.
|
inline |
Load a variable number of little-endian words
out | the output array of words |
in | the input array of bytes |
count | how many words are in in |
Definition at line 321 of file loadstor.h.
References bswap_4(), and reverse_bytes().
|
inline |
Load a little-endian uint16_t
in | a pointer to some bytes |
off | an offset into the array |
Definition at line 165 of file loadstor.h.
References make_uint16().
|
inline |
Load a little-endian uint32_t
in | a pointer to some bytes |
off | an offset into the array |
Definition at line 204 of file loadstor.h.
References make_uint32().
Referenced by Botan::GOST_28147_89::decrypt_n(), Botan::GOST_28147_89::encrypt_n(), Botan::ChaCha::seek(), Botan::Salsa20::set_iv(), and Botan::ChaCha::set_iv().
|
inline |
Load a little-endian uint64_t
in | a pointer to some bytes |
off | an offset into the array |
Definition at line 243 of file loadstor.h.
References make_uint64().
Referenced by Botan::SHA_3::absorb(), and Botan::Threefish_512::set_tweak().
BOTAN_DLL std::unique_ptr< Private_Key > Botan::load_private_key | ( | const AlgorithmIdentifier & | alg_id, |
const secure_vector< uint8_t > & | key_bits | ||
) |
Definition at line 133 of file pk_algs.cpp.
References Botan::OID::as_string(), Botan::OIDS::lookup(), and Botan::AlgorithmIdentifier::oid.
BOTAN_DLL std::unique_ptr< Public_Key > Botan::load_public_key | ( | const AlgorithmIdentifier & | alg_id, |
const std::vector< uint8_t > & | key_bits | ||
) |
Definition at line 62 of file pk_algs.cpp.
References Botan::OID::as_string(), Botan::OIDS::lookup(), and Botan::AlgorithmIdentifier::oid.
Referenced by Botan::X509::load_key().
|
inline |
size_t BOTAN_DLL Botan::low_zero_bits | ( | const BigInt & | x | ) |
x | a positive integer |
Definition at line 20 of file numthry.cpp.
References ctz(), Botan::BigInt::is_nonzero(), Botan::BigInt::is_positive(), Botan::BigInt::size(), and Botan::BigInt::word_at().
Referenced by gcd(), inverse_mod(), is_prime(), jacobi(), and ressol().
|
inline |
Definition at line 48 of file lookup.h.
References Botan::BlockCipher::create_or_throw().
BOTAN_DLL Compression_Algorithm * Botan::make_compressor | ( | const std::string & | name | ) |
BOTAN_DLL Decompression_Algorithm * Botan::make_decompressor | ( | const std::string & | name | ) |
|
inline |
Definition at line 102 of file lookup.h.
References Botan::HashFunction::create_or_throw().
|
inline |
Definition at line 136 of file lookup.h.
References Botan::MessageAuthenticationCode::create().
std::unique_ptr< BlockCipher > Botan::make_openssl_block_cipher | ( | const std::string & | name | ) |
Definition at line 157 of file openssl_block.cpp.
References MAKE_OPENSSL_BLOCK, and MAKE_OPENSSL_BLOCK_KEYLEN.
Referenced by Botan::BlockCipher::create().
std::unique_ptr< HashFunction > Botan::make_openssl_hash | ( | const std::string & | name | ) |
Definition at line 76 of file openssl_hash.cpp.
References MAKE_OPENSSL_HASH.
Referenced by Botan::HashFunction::create().
|
inline |
Definition at line 75 of file lookup.h.
References Botan::StreamCipher::create_or_throw().
|
inline |
Make a uint16_t from two bytes
i0 | the first byte |
i1 | the second byte |
Definition at line 60 of file loadstor.h.
Referenced by Botan::TLS::TLS_Data_Reader::get_uint16_t(), load_be< uint16_t >(), load_le< uint16_t >(), random_gf2m(), Botan::RTSS_Share::reconstruct(), Botan::TLS::Session_Manager_SQL::Session_Manager_SQL(), and Botan::TLS::TLS_CBC_HMAC_AEAD_Encryption::set_associated_data().
|
inline |
Make a uint32_t from four bytes
i0 | the first byte |
i1 | the second byte |
i2 | the third byte |
i3 | the fourth byte |
Definition at line 73 of file loadstor.h.
Referenced by Botan::TLS::Certificate::Certificate(), Botan::TLS::Certificate_Status::Certificate_Status(), Botan::TLS::Stream_Handshake_IO::get_next_record(), Botan::TLS::TLS_Data_Reader::get_uint32_t(), load_be< uint32_t >(), and load_le< uint32_t >().
|
inline |
Make a uint32_t from eight bytes
i0 | the first byte |
i1 | the second byte |
i2 | the third byte |
i3 | the fourth byte |
i4 | the fifth byte |
i5 | the sixth byte |
i6 | the seventh byte |
i7 | the eighth byte |
Definition at line 93 of file loadstor.h.
Referenced by load_be< uint64_t >(), and load_le< uint64_t >().
stlCompatibilityDetails::_Unique_if<T>::_Single_object Botan::make_unique | ( | Args &&... | args | ) |
Definition at line 59 of file stl_compatibility.h.
stlCompatibilityDetails::_Unique_if<T>::_Unknown_bound Botan::make_unique | ( | size_t | n | ) |
|
delete |
std::set<K> Botan::map_keys_as_set | ( | const std::map< K, V > & | kv | ) |
Return the keys of a map as a std::set
Definition at line 34 of file stl_util.h.
void Botan::map_remove_if | ( | Pred | pred, |
T & | assoc | ||
) |
Definition at line 96 of file stl_util.h.
Referenced by Botan::TLS::Channel::activate_session().
secure_vector< uint8_t > BOTAN_DLL Botan::mceies_decrypt | ( | const McEliece_PrivateKey & | privkey, |
const uint8_t | ct[], | ||
size_t | ct_len, | ||
const uint8_t | ad[], | ||
size_t | ad_len, | ||
const std::string & | aead = "AES-256/OCB" |
||
) |
McEliece Integrated Encryption System Derive a shared key using MCE KEM and decrypt/authenticate the ciphertext and AD using AES-256 in OCB mode.
Definition at line 70 of file mceies.cpp.
References Botan::PK_KEM_Decryptor::decrypt(), DECRYPTION, get_aead(), and Botan::McEliece_PublicKey::get_code_length().
Referenced by botan_mceies_decrypt().
secure_vector< uint8_t > BOTAN_DLL Botan::mceies_encrypt | ( | const McEliece_PublicKey & | pubkey, |
const uint8_t | pt[], | ||
size_t | pt_len, | ||
const uint8_t | ad[], | ||
size_t | ad_len, | ||
RandomNumberGenerator & | rng, | ||
const std::string & | aead = "AES-256/OCB" |
||
) |
McEliece Integrated Encryption System Derive a shared key using MCE KEM and encrypt/authenticate the plaintext and AD using AES-256 in OCB mode.
Definition at line 33 of file mceies.cpp.
References BOTAN_ASSERT, copy_mem(), Botan::PK_KEM_Encryptor::encrypt(), ENCRYPTION, get_aead(), Botan::McEliece_PublicKey::get_code_length(), and Botan::RandomNumberGenerator::random_vec().
Referenced by botan_mceies_encrypt().
void Botan::mceliece_decrypt | ( | secure_vector< uint8_t > & | plaintext_out, |
secure_vector< uint8_t > & | error_mask_out, | ||
const secure_vector< uint8_t > & | ciphertext, | ||
const McEliece_PrivateKey & | key | ||
) |
Definition at line 127 of file goppa_code.cpp.
Referenced by Botan::McEliece_PrivateKey::check_key(), and mceliece_decrypt().
void Botan::mceliece_decrypt | ( | secure_vector< uint8_t > & | plaintext, |
secure_vector< uint8_t > & | error_mask, | ||
const uint8_t | ciphertext[], | ||
size_t | ciphertext_len, | ||
const McEliece_PrivateKey & | key | ||
) |
Definition at line 135 of file goppa_code.cpp.
References Botan::McEliece_PublicKey::get_code_length(), and mceliece_decrypt().
secure_vector< uint8_t > Botan::mceliece_decrypt | ( | secure_vector< gf2m > & | error_pos, |
const uint8_t * | ciphertext, | ||
uint32_t | ciphertext_len, | ||
const McEliece_PrivateKey & | key | ||
) |
p_err_pos_len
must point to the available length of error_pos
on input, the function will set it to the actual number of errors returned in the error_pos
array
Definition at line 163 of file goppa_code.cpp.
References bit_size_to_32bit_size(), bit_size_to_byte_size(), copy_mem(), Botan::McEliece_PublicKey::get_code_length(), Botan::McEliece_PrivateKey::get_codimension(), Botan::polyn_gf2m::get_degree(), Botan::McEliece_PrivateKey::get_dimension(), Botan::McEliece_PrivateKey::get_goppa_polyn(), Botan::McEliece_PrivateKey::get_H_coeffs(), Botan::McEliece_PrivateKey::get_Linv(), Botan::McEliece_PublicKey::get_message_word_bit_length(), Botan::polyn_gf2m::get_sp_field(), and Botan::McEliece_PrivateKey::get_sqrtmod().
void Botan::mceliece_encrypt | ( | secure_vector< uint8_t > & | ciphertext_out, |
secure_vector< uint8_t > & | error_mask_out, | ||
const secure_vector< uint8_t > & | plaintext, | ||
const McEliece_PublicKey & | key, | ||
RandomNumberGenerator & | rng | ||
) |
Definition at line 118 of file mceliece.cpp.
References Botan::McEliece_PublicKey::get_code_length(), Botan::McEliece_PublicKey::get_public_matrix(), and Botan::McEliece_PublicKey::get_t().
Referenced by Botan::McEliece_PrivateKey::check_key().
BOTAN_DLL size_t Botan::mceliece_work_factor | ( | size_t | code_size, |
size_t | t | ||
) |
Estimate work factor for McEliece
Definition at line 95 of file mce_workfactor.cpp.
References ceil_log2(), and Botan::CT::min().
Referenced by Botan::McEliece_PublicKey::estimated_strength().
void BOTAN_DLL Botan::mgf1_mask | ( | HashFunction & | hash, |
const uint8_t | in[], | ||
size_t | in_len, | ||
uint8_t | out[], | ||
size_t | out_len | ||
) |
MGF1 from PKCS #1 v2.0
hash | hash function to use |
in | input buffer |
in_len | size of the input buffer in bytes |
out | output buffer |
out_len | size of the output buffer in bytes |
Definition at line 14 of file mgf1.cpp.
References Botan::Buffered_Computation::final(), Botan::Buffered_Computation::update(), Botan::Buffered_Computation::update_be(), and xor_buf().
word BOTAN_DLL Botan::monty_inverse | ( | word | input | ) |
Definition at line 325 of file numthry.cpp.
References bigint_divop(), BOTAN_ASSERT_EQUAL, and MP_WORD_MAX.
Referenced by Botan::Montgomery_Exponentiator::Montgomery_Exponentiator().
|
inline |
Perform a 64x64->128 bit multiplication
Definition at line 83 of file mul128.h.
Referenced by operator*(), word_madd2(), and word_madd3().
Fused multiply-add
a | an integer |
b | an integer |
c | an integer |
Definition at line 35 of file mp_numth.cpp.
References bigint_add2(), bigint_mul(), Botan::BigInt::data(), Botan::BigInt::is_negative(), Botan::BigInt::is_zero(), Botan::CT::max(), Botan::BigInt::mutable_data(), Botan::BigInt::Negative, Botan::BigInt::Positive, Botan::BigInt::sig_words(), Botan::BigInt::sign(), and Botan::BigInt::size().
Fused multiply-subtract
a | an integer |
b | an integer |
c | an integer |
Definition at line 71 of file mp_numth.cpp.
References Botan::BigInt::is_negative(), and Botan::BigInt::is_zero().
PointGFp Botan::multi_exponentiate | ( | const PointGFp & | p1, |
const BigInt & | z1, | ||
const PointGFp & | p2, | ||
const BigInt & | z2 | ||
) |
Multiexponentiation
p1 | a point |
z1 | a scalar |
p2 | a point |
z2 | a scalar |
Definition at line 248 of file point_gfp.cpp.
References Botan::BigInt::bits(), Botan::BigInt::get_bit(), Botan::PointGFp::get_curve(), Botan::BigInt::is_negative(), and Botan::CT::max().
void Botan::multimap_insert | ( | std::multimap< K, V > & | multimap, |
const K & | key, | ||
const V & | value | ||
) |
Definition at line 76 of file stl_util.h.
Referenced by Botan::Data_Store::add(), Botan::AlternativeName::add_attribute(), Botan::X509_DN::add_attribute(), Botan::AlternativeName::add_othername(), Botan::AlternativeName::contents(), Botan::X509_DN::contents(), and Botan::X509_DN::get_attributes().
void BOTAN_DLL Botan::newhope_keygen | ( | uint8_t * | send, |
poly * | sk, | ||
RandomNumberGenerator & | rng, | ||
Newhope_Mode | mode | ||
) |
Definition at line 703 of file newhope.cpp.
References NEWHOPE_SEED_BYTES, and Botan::RandomNumberGenerator::randomize().
Referenced by CECPQ1_offer().
void BOTAN_DLL Botan::newhope_shareda | ( | uint8_t * | sharedkey, |
const poly * | sk, | ||
const uint8_t * | received, | ||
Newhope_Mode | mode | ||
) |
Definition at line 766 of file newhope.cpp.
References Botan::HashFunction::create(), hash, and SHA3.
Referenced by CECPQ1_finish().
void BOTAN_DLL Botan::newhope_sharedb | ( | uint8_t * | sharedkey, |
uint8_t * | send, | ||
const uint8_t * | received, | ||
RandomNumberGenerator & | rng, | ||
Newhope_Mode | mode | ||
) |
Definition at line 725 of file newhope.cpp.
References Botan::HashFunction::create(), hash, NEWHOPE_SEED_BYTES, and SHA3.
Referenced by CECPQ1_accept().
Call almost_montgomery_inverse and correct the result to a^-1 mod b
Definition at line 138 of file numthry.cpp.
References almost_montgomery_inverse(), and Botan::BigInt::is_odd().
Test two CRL entries for inequality in at least one field.
Definition at line 55 of file crl_ent.cpp.
bool BOTAN_DLL Botan::operator!= | ( | const AlgorithmIdentifier & | a1, |
const AlgorithmIdentifier & | a2 | ||
) |
Definition at line 82 of file alg_id.cpp.
BOTAN_DLL bool Botan::operator!= | ( | const OctetString & | x, |
const OctetString & | y | ||
) |
Compare two strings
x | an octet string |
y | an octet string |
Definition at line 103 of file symkey.cpp.
|
inline |
Definition at line 144 of file ec_group.h.
Definition at line 164 of file x509_dn.cpp.
Definition at line 165 of file curve_gfp.h.
Definition at line 248 of file point_gfp.h.
Definition at line 263 of file asn1_time.cpp.
References Botan::X509_Time::cmp().
BOTAN_DLL bool Botan::operator!= | ( | const X509_Certificate & | cert1, |
const X509_Certificate & | cert2 | ||
) |
Check two certificates for inequality
cert1 | The first certificate |
cert2 | The second certificate |
Definition at line 535 of file x509cert.cpp.
Definition at line 600 of file bigint.h.
References Botan::BigInt::cmp().
Definition at line 118 of file big_ops3.cpp.
References divide(), Botan::BigInt::is_negative(), Botan::BigInt::is_positive(), and Botan::BigInt::is_zero().
word BOTAN_DLL Botan::operator% | ( | const BigInt & | n, |
word | mod | ||
) |
Definition at line 135 of file big_ops3.cpp.
References bigint_modop(), is_power_of_2(), Botan::BigInt::Negative, Botan::BigInt::sig_words(), Botan::BigInt::sign(), and Botan::BigInt::word_at().
|
inline |
Definition at line 80 of file donna128.h.
References BOTAN_ASSERT, Botan::donna128::hi(), Botan::donna128::lo(), and mul64x64_128().
Definition at line 84 of file big_ops3.cpp.
References bigint_linmul3(), bigint_mul(), Botan::BigInt::data(), Botan::BigInt::Positive, Botan::BigInt::sig_words(), Botan::BigInt::sign(), Botan::BigInt::size(), and Botan::BigInt::word_at().
Definition at line 271 of file point_gfp.h.
Multiplication Operator
scalar | the scalar value |
point | the point value |
Definition at line 281 of file point_gfp.cpp.
References Botan::BigInt::bits(), Botan::BigInt::get_bit(), Botan::PointGFp::get_curve(), and Botan::BigInt::is_negative().
Definition at line 20 of file big_ops3.cpp.
References bigint_add3(), bigint_cmp(), bigint_sub3(), Botan::BigInt::data(), Botan::CT::max(), Botan::BigInt::Positive, Botan::BigInt::sig_words(), and Botan::BigInt::sign().
Append another component onto the OID.
oid | the OID to add the new component to |
new_comp | the new component to add |
Definition at line 87 of file asn1_oid.cpp.
Definition at line 89 of file donna128.h.
Definition at line 96 of file donna128.h.
BOTAN_DLL OctetString Botan::operator+ | ( | const OctetString & | x, |
const OctetString & | y | ||
) |
Concatenate two strings
x | an octet string |
y | an octet string |
Definition at line 111 of file symkey.cpp.
References Botan::OctetString::bits_of().
Definition at line 259 of file point_gfp.h.
std::vector<T, Alloc>& Botan::operator+= | ( | std::vector< T, Alloc > & | out, |
const std::vector< T, Alloc2 > & | in | ||
) |
std::vector<T, Alloc>& Botan::operator+= | ( | std::vector< T, Alloc > & | out, |
T | in | ||
) |
std::vector<T, Alloc>& Botan::operator+= | ( | std::vector< T, Alloc > & | out, |
const std::pair< const T *, L > & | in | ||
) |
std::vector<T, Alloc>& Botan::operator+= | ( | std::vector< T, Alloc > & | out, |
const std::pair< T *, L > & | in | ||
) |
Definition at line 49 of file big_ops3.cpp.
References bigint_add3(), bigint_cmp(), bigint_shl2(), bigint_sub3(), Botan::BigInt::data(), Botan::CT::max(), Botan::BigInt::Positive, Botan::BigInt::reverse_sign(), Botan::BigInt::sig_words(), and Botan::BigInt::sign().
Definition at line 254 of file point_gfp.h.
References Botan::PointGFp::negate().
Definition at line 265 of file point_gfp.h.
Definition at line 108 of file big_ops3.cpp.
References divide().
Compare two OIDs.
Definition at line 105 of file asn1_oid.cpp.
References Botan::OID::get_id().
Definition at line 271 of file asn1_time.cpp.
References Botan::X509_Time::cmp().
Definition at line 606 of file bigint.h.
References Botan::BigInt::cmp().
BOTAN_DLL std::ostream & Botan::operator<< | ( | std::ostream & | stream, |
const BigInt & | n | ||
) |
Definition at line 16 of file big_io.cpp.
References Botan::BigInt::Decimal, Botan::BigInt::encode(), and Botan::BigInt::Hexadecimal.
int BOTAN_DLL Botan::operator<< | ( | int | out, |
Pipe & | pipe | ||
) |
Stream output operator; dumps the results from pipe's default message to the output stream.
out | file descriptor for an open output stream |
pipe | the pipe |
Definition at line 17 of file fd_unix.cpp.
References Botan::Pipe::read(), and Botan::Pipe::remaining().
Definition at line 156 of file big_ops3.cpp.
References bigint_shl2(), Botan::BigInt::data(), MP_WORD_BITS, Botan::BigInt::mutable_data(), Botan::BigInt::sig_words(), and Botan::BigInt::sign().
std::ostream & Botan::operator<< | ( | std::ostream & | os, |
const GeneralName & | gn | ||
) |
Definition at line 225 of file name_constraint.cpp.
References Botan::GeneralName::name(), and Botan::GeneralName::type().
std::ostream & Botan::operator<< | ( | std::ostream & | os, |
const GeneralSubtree & | gs | ||
) |
Definition at line 268 of file name_constraint.cpp.
References Botan::GeneralSubtree::base(), Botan::GeneralSubtree::maximum(), and Botan::GeneralSubtree::minimum().
BOTAN_DLL std::ostream & Botan::operator<< | ( | std::ostream & | out, |
const X509_DN & | dn | ||
) |
std::ostream & Botan::operator<< | ( | std::ostream & | out, |
Pipe & | pipe | ||
) |
Stream output operator; dumps the results from pipe's default message to the output stream.
out | an output stream |
pipe | the pipe |
Definition at line 16 of file pipe_io.cpp.
References Botan::Pipe::read(), and Botan::Pipe::remaining().
Definition at line 266 of file asn1_time.cpp.
References Botan::X509_Time::cmp().
Definition at line 602 of file bigint.h.
References Botan::BigInt::cmp().
Test two CRL entries for equality in all fields.
Definition at line 41 of file crl_ent.cpp.
References Botan::CRL_Entry::expire_time(), Botan::CRL_Entry::reason_code(), and Botan::CRL_Entry::serial_number().
bool BOTAN_DLL Botan::operator== | ( | const AlgorithmIdentifier & | a1, |
const AlgorithmIdentifier & | a2 | ||
) |
Definition at line 67 of file alg_id.cpp.
References Botan::AlgorithmIdentifier::oid, and Botan::AlgorithmIdentifier::parameters.
BOTAN_DLL bool Botan::operator== | ( | const OctetString & | x, |
const OctetString & | y | ||
) |
Compare two strings
x | an octet string |
y | an octet string |
Definition at line 95 of file symkey.cpp.
References Botan::OctetString::bits_of().
|
inline |
Definition at line 136 of file x509_dn.cpp.
References Botan::X509_DN::get_attributes(), and x500_name_cmp().
Equality operator
lhs | a curve |
rhs | a curve |
Definition at line 158 of file curve_gfp.h.
References Botan::CurveGFp::get_a(), Botan::CurveGFp::get_b(), and Botan::CurveGFp::get_p().
Definition at line 261 of file asn1_time.cpp.
References Botan::X509_Time::cmp().
Definition at line 598 of file bigint.h.
References Botan::BigInt::cmp().
Definition at line 273 of file asn1_time.cpp.
References Botan::X509_Time::cmp().
Definition at line 608 of file bigint.h.
References Botan::BigInt::cmp().
Definition at line 268 of file asn1_time.cpp.
References Botan::X509_Time::cmp().
Definition at line 604 of file bigint.h.
References Botan::BigInt::cmp().
int BOTAN_DLL Botan::operator>> | ( | int | in, |
Pipe & | pipe | ||
) |
File descriptor input operator; dumps the remaining bytes of input to the (assumed open) pipe message.
in | file descriptor for an open input stream |
pipe | the pipe |
Definition at line 39 of file fd_unix.cpp.
References Botan::Pipe::write().
BOTAN_DLL std::istream & Botan::operator>> | ( | std::istream & | stream, |
BigInt & | n | ||
) |
Definition at line 45 of file big_io.cpp.
Definition at line 174 of file big_ops3.cpp.
References bigint_shr2(), Botan::BigInt::bits(), Botan::BigInt::data(), MP_WORD_BITS, Botan::BigInt::sig_words(), and Botan::BigInt::sign().
BOTAN_DLL std::istream & Botan::operator>> | ( | std::istream & | in, |
X509_DN & | dn | ||
) |
Definition at line 325 of file x509_dn.cpp.
References Botan::X509_DN::add_attribute(), and Botan::X509_DN::deref_info_field().
std::istream & Botan::operator>> | ( | std::istream & | in, |
Pipe & | pipe | ||
) |
Stream input operator; dumps the remaining bytes of input to the (assumed open) pipe message.
in | the input stream |
pipe | the pipe |
Definition at line 32 of file pipe_io.cpp.
References Botan::Pipe::write().
BOTAN_DLL OctetString Botan::operator^ | ( | const OctetString & | x, |
const OctetString & | y | ||
) |
XOR two strings
x | an octet string |
y | an octet string |
Definition at line 122 of file symkey.cpp.
References Botan::OctetString::begin(), copy_mem(), Botan::OctetString::length(), Botan::CT::max(), and xor_buf().
std::vector<T, Alloc>& Botan::operator^= | ( | std::vector< T, Alloc > & | out, |
const std::vector< T, Alloc2 > & | in | ||
) |
Definition at line 168 of file mem_ops.h.
References xor_buf().
|
inline |
Definition at line 103 of file donna128.h.
References Botan::donna128::hi(), and Botan::donna128::lo().
PointGFp Botan::OS2ECP | ( | const std::vector< uint8_t, Alloc > & | data, |
const CurveGFp & | curve | ||
) |
Definition at line 283 of file point_gfp.h.
References OS2ECP().
Definition at line 544 of file point_gfp.cpp.
References Botan::BigInt::decode(), Botan::PointGFp::on_the_curve(), and Botan::ASN1::to_string().
Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), Botan::EC_Group::EC_Group(), Botan::EC_PrivateKey::EC_PrivateKey(), Botan::ECIES_Encryptor::ECIES_Encryptor(), and OS2ECP().
BOTAN_DLL std::vector< std::string > Botan::parse_algorithm_name | ( | const std::string & | scan_name | ) |
Parse a SCAN-style algorithm name
scan_name | the name |
Definition at line 85 of file parsing.cpp.
Referenced by get_aead(), get_cipher_mode(), and Botan::X509_Object::hash_used_for_signature().
BOTAN_DLL std::vector< uint32_t > Botan::parse_asn1_oid | ( | const std::string & | oid | ) |
Parse an ASN.1 OID
oid | the OID in string form |
Definition at line 189 of file parsing.cpp.
References to_u32bit().
Referenced by Botan::OID::OID().
secure_vector< uint8_t > BOTAN_DLL Botan::pbes2_decrypt | ( | const secure_vector< uint8_t > & | key_bits, |
const std::string & | passphrase, | ||
const std::vector< uint8_t > & | params | ||
) |
Decrypt a PKCS #5 v2.0 encrypted stream
key_bits | the input |
passphrase | the passphrase to use for decryption |
params | the PBES2 parameters |
Definition at line 164 of file pbes2.cpp.
References Botan::OID::as_string(), CONSTRUCTED, Botan::BER_Decoder::decode(), Botan::BER_Decoder::decode_optional(), DECRYPTION, Botan::BER_Decoder::end_cons(), get_cipher_mode(), get_pbkdf(), INTEGER, Botan::OIDS::lookup(), OCTET_STRING, Botan::AlgorithmIdentifier::oid, Botan::AlgorithmIdentifier::parameters, SEQUENCE, split_on(), Botan::BER_Decoder::start_cons(), UNIVERSAL, Botan::AlgorithmIdentifier::USE_NULL_PARAM, and Botan::BER_Decoder::verify_end().
std::pair< AlgorithmIdentifier, std::vector< uint8_t > > BOTAN_DLL Botan::pbes2_encrypt | ( | const secure_vector< uint8_t > & | key_bits, |
const std::string & | passphrase, | ||
std::chrono::milliseconds | msec, | ||
const std::string & | cipher, | ||
const std::string & | digest, | ||
RandomNumberGenerator & | rng | ||
) |
Encrypt with PBES2 from PKCS #5 v2.0
key_bits | the input |
passphrase | the passphrase to use for encryption |
msec | how many milliseconds to run PBKDF2 |
cipher | specifies the block cipher to use to encrypt |
digest | specifies the PRF to use with PBKDF2 (eg "HMAC(SHA-1)") |
rng | a random number generator |
std::pair< AlgorithmIdentifier, std::vector< uint8_t > > BOTAN_DLL Botan::pbes2_encrypt_iter | ( | const secure_vector< uint8_t > & | key_bits, |
const std::string & | passphrase, | ||
size_t | iterations, | ||
const std::string & | cipher, | ||
const std::string & | digest, | ||
RandomNumberGenerator & | rng | ||
) |
Encrypt with PBES2 from PKCS #5 v2.0
key_bits | the input |
passphrase | the passphrase to use for encryption |
iterations | how many iterations to run PBKDF2 |
cipher | specifies the block cipher to use to encrypt |
digest | specifies the PRF to use with PBKDF2 (eg "HMAC(SHA-1)") |
rng | a random number generator |
Definition at line 153 of file pbes2.cpp.
Referenced by Botan::PKCS8::BER_encode_encrypted_pbkdf_iter().
std::pair< AlgorithmIdentifier, std::vector< uint8_t > > BOTAN_DLL Botan::pbes2_encrypt_msec | ( | const secure_vector< uint8_t > & | key_bits, |
const std::string & | passphrase, | ||
std::chrono::milliseconds | msec, | ||
size_t * | out_iterations_if_nonnull, | ||
const std::string & | cipher, | ||
const std::string & | digest, | ||
RandomNumberGenerator & | rng | ||
) |
Encrypt with PBES2 from PKCS #5 v2.0
key_bits | the input |
passphrase | the passphrase to use for encryption |
msec | how many milliseconds to run PBKDF2 |
out_iterations_if_nonnull | if not null, set to the number of PBKDF iterations used |
cipher | specifies the block cipher to use to encrypt |
digest | specifies the PRF to use with PBKDF2 (eg "HMAC(SHA-1)") |
rng | a random number generator |
Definition at line 134 of file pbes2.cpp.
Referenced by Botan::PKCS8::BER_encode(), and Botan::PKCS8::BER_encode_encrypted_pbkdf_msec().
BOTAN_DLL size_t Botan::pbkdf2 | ( | MessageAuthenticationCode & | prf, |
uint8_t | out[], | ||
size_t | out_len, | ||
const std::string & | passphrase, | ||
const uint8_t | salt[], | ||
size_t | salt_len, | ||
size_t | iterations, | ||
std::chrono::milliseconds | msec | ||
) |
Definition at line 15 of file pbkdf2.cpp.
References clear_mem(), Botan::Buffered_Computation::final(), Botan::SymmetricAlgorithm::name(), Botan::Buffered_Computation::output_length(), round_up(), Botan::SymmetricAlgorithm::set_key(), Botan::ASN1::to_string(), Botan::Buffered_Computation::update(), Botan::Buffered_Computation::update_be(), and xor_buf().
Referenced by Botan::PKCS5_PBKDF2::pbkdf().
BOTAN_DLL std::vector< uint8_t > Botan::pkcs_hash_id | ( | const std::string & | hash_name | ) |
Return the PKCS #1 hash identifier
hash_name | the name of the hash function |
Invalid_Argument | if the hash has no known PKCS #1 hash id |
Definition at line 56 of file hash_id.cpp.
Referenced by Botan::EMSA_PKCS1v15::EMSA_PKCS1v15().
Modular exponentation
b | an integer base |
x | a positive exponent |
m | a positive modulus |
Definition at line 373 of file numthry.cpp.
References Botan::Power_Mod::execute(), Botan::Power_Mod::set_base(), and Botan::Power_Mod::set_exponent().
Referenced by botan_mp_powmod(), Botan::DL_Scheme_PublicKey::check_key(), Botan::DL_Scheme_PrivateKey::check_key(), Botan::DH_PrivateKey::DH_PrivateKey(), Botan::DSA_PrivateKey::DSA_PrivateKey(), Botan::ElGamal_PrivateKey::ElGamal_PrivateKey(), generate_srp6_verifier(), ressol(), srp6_client_agree(), Botan::SRP6_Server_Session::step1(), Botan::SRP6_Server_Session::step2(), and Botan::DL_Group::verify_group().
|
inline |
Definition at line 16 of file prefetch.h.
References Botan::CPUID::cache_line_size().
|
inline |
Definition at line 27 of file prefetch.h.
References Botan::CPUID::cache_line_size().
BOTAN_DLL const BigInt & Botan::prime_p521 | ( | ) |
NIST Prime reduction functions.
Reduces the value in place
ws is a workspace function which is used as a temporary, and will be resized as needed.
Definition at line 51 of file curve_nistp.cpp.
Referenced by redc_p521().
std::vector<std::string> Botan::probe_providers_of | ( | const std::string & | algo_spec, |
const std::vector< std::string > & | possible | ||
) |
Definition at line 101 of file scan_name.h.
|
inline |
Definition at line 171 of file numthry.h.
References is_prime().
gf2m Botan::random_code_element | ( | unsigned | code_length, |
RandomNumberGenerator & | rng | ||
) |
Definition at line 71 of file polyn_gf2m.cpp.
References random_gf2m().
Referenced by Botan::polyn_gf2m::polyn_gf2m().
gf2m Botan::random_gf2m | ( | RandomNumberGenerator & | rng | ) |
Definition at line 64 of file polyn_gf2m.cpp.
References make_uint16(), and Botan::RandomNumberGenerator::randomize().
Referenced by random_code_element().
BigInt BOTAN_DLL Botan::random_prime | ( | RandomNumberGenerator & | rng, |
size_t | bits, | ||
const BigInt & | coprime = 1 , |
||
size_t | equiv = 1 , |
||
size_t | equiv_mod = 2 |
||
) |
Randomly generate a prime
rng | a random number generator |
bits | how large the resulting prime should be in bits |
coprime | a positive integer the result should be coprime to |
equiv | a non-negative number that the result should be equivalent to modulo equiv_mod |
equiv_mod | the modulus equiv should be checked against |
Definition at line 17 of file make_prm.cpp.
References Botan::BigInt::bits(), gcd(), is_prime(), Botan::CT::min(), Botan::RandomNumberGenerator::next_byte(), PRIME_TABLE_SIZE, PRIMES, Botan::BigInt::set_bit(), and Botan::ASN1::to_string().
Referenced by Botan::DL_Group::DL_Group(), random_safe_prime(), and Botan::RSA_PrivateKey::RSA_PrivateKey().
BigInt BOTAN_DLL Botan::random_safe_prime | ( | RandomNumberGenerator & | rng, |
size_t | bits | ||
) |
Return a 'safe' prime, of the form p=2*q+1 with q prime
rng | a random number generator |
bits | is how long the resulting prime should be |
Definition at line 114 of file make_prm.cpp.
References is_prime(), random_prime(), and Botan::ASN1::to_string().
Referenced by Botan::DL_Group::DL_Group().
std::map< std::string, std::string > Botan::read_cfg | ( | std::istream & | is | ) |
Definition at line 28 of file read_cfg.cpp.
References clean_ws(), and Botan::ASN1::to_string().
Referenced by Botan::TLS::Text_Policy::Text_Policy().
BOTAN_DLL void Botan::redc_p521 | ( | BigInt & | x, |
secure_vector< word > & | ws | ||
) |
Definition at line 59 of file curve_nistp.cpp.
References bigint_add3_nc(), bigint_shr2(), BOTAN_ASSERT_EQUAL, clear_mem(), Botan::BigInt::data(), Botan::BigInt::mask_bits(), MP_WORD_BITS, Botan::BigInt::mutable_data(), prime_p521(), and Botan::BigInt::sig_words().
BOTAN_DLL std::string Botan::replace_char | ( | const std::string & | str, |
char | from_char, | ||
char | to_char | ||
) |
Replace a character in a string
str | the input string |
from_char | the character to replace |
to_char | the character to replace it with |
Definition at line 326 of file parsing.cpp.
BOTAN_DLL std::string Botan::replace_chars | ( | const std::string & | str, |
const std::set< char > & | from_chars, | ||
char | to_char | ||
) |
Replace a character in a string
str | the input string |
from_chars | the characters to replace |
to_char | the character to replace it with |
Definition at line 313 of file parsing.cpp.
Compute the square root of x modulo a prime using the Shanks-Tonnelli algorithm
x | the input |
p | the prime |
Definition at line 17 of file ressol.cpp.
References Botan::BigInt::is_even(), jacobi(), low_zero_bits(), Botan::Modular_Reducer::multiply(), power_mod(), Botan::BigInt::power_of_2(), and Botan::Modular_Reducer::square().
|
inline |
Swap a 16 bit integer
Definition at line 24 of file bswap.h.
References rotate_left().
Referenced by Botan::SIMD_4x32::bswap(), bswap_4(), load_be(), load_le(), and reverse_bytes().
|
inline |
Swap a 32 bit integer
Definition at line 32 of file bswap.h.
References rotate_left(), and rotate_right().
|
inline |
secure_vector< uint8_t > BOTAN_DLL Botan::rfc3394_keyunwrap | ( | const secure_vector< uint8_t > & | key, |
const SymmetricKey & | kek | ||
) |
Decrypt a key under a key encryption key using the algorithm described in RFC 3394
key | the encrypted key to decrypt |
kek | the key encryption key |
Definition at line 60 of file rfc3394.cpp.
References copy_mem(), Botan::BlockCipher::create_or_throw(), load_be< uint64_t >(), Botan::OctetString::size(), store_be(), Botan::ASN1::to_string(), and xor_buf().
secure_vector< uint8_t > BOTAN_DLL Botan::rfc3394_keywrap | ( | const secure_vector< uint8_t > & | key, |
const SymmetricKey & | kek | ||
) |
Encrypt a key under a key encryption key using the algorithm described in RFC 3394
key | the plaintext key to encrypt |
kek | the key encryption key |
Definition at line 15 of file rfc3394.cpp.
References copy_mem(), Botan::BlockCipher::create_or_throw(), Botan::OctetString::size(), store_be(), Botan::ASN1::to_string(), and xor_buf().
|
inline |
Bit rotation left
input | the input word |
rot | the number of bits to rotate |
Definition at line 21 of file rotate.h.
Referenced by Botan::DES::decrypt_n(), Botan::Noekeon::decrypt_n(), Botan::Twofish::decrypt_n(), Botan::KASUMI::decrypt_n(), Botan::TripleDES::decrypt_n(), Botan::Noekeon::encrypt_n(), Botan::DES::encrypt_n(), Botan::Twofish::encrypt_n(), Botan::KASUMI::encrypt_n(), Botan::TripleDES::encrypt_n(), Botan::GOST_28147_89::GOST_28147_89(), Botan::SHA_3::permute(), reverse_bytes(), and Botan::SIMD_4x32::rotate_left().
|
inline |
Bit rotation right
input | the input word |
rot | the number of bits to rotate |
Definition at line 32 of file rotate.h.
Referenced by Botan::Noekeon::decrypt_n(), Botan::Twofish::decrypt_n(), Botan::Noekeon::encrypt_n(), Botan::Twofish::encrypt_n(), and reverse_bytes().
|
inline |
Round down
n | an integer |
align_to | the alignment boundary |
Definition at line 38 of file rounding.h.
Referenced by botan_cipher_update(), and Botan::Buffered_Filter::write().
|
inline |
Round up
n | a non-negative integer |
align_to | the alignment boundary |
Definition at line 22 of file rounding.h.
References BOTAN_ASSERT.
Referenced by base64_decode_max_output(), base64_encode_max_output(), Botan::BigInt::BigInt(), Botan::BigInt::binary_decode(), Botan::BigInt::bytes(), Botan::TLS::TLS_CBC_HMAC_AEAD_Encryption::finish(), Botan::BigInt::grow_to(), Botan::CBC_Encryption::output_length(), Botan::TLS::TLS_CBC_HMAC_AEAD_Encryption::output_length(), pbkdf2(), Botan::BigInt::randomize(), Botan::TLS::TLS_CBC_HMAC_AEAD_Encryption::set_associated_data(), and square().
BOTAN_DLL std::string Botan::runtime_version_check | ( | uint32_t | major, |
uint32_t | minor, | ||
uint32_t | patch | ||
) |
Usable for checking that the DLL version loaded at runtime exactly matches the compile-time version. Call using BOTAN_VERSION_* macro values. Returns the empty string if an exact match, otherwise an appropriate message. Added with 1.11.26.
Definition at line 64 of file version.cpp.
References version_major(), version_minor(), and version_patch().
|
inline |
Memory comparison, input insensitive
p1 | a pointer to an array |
p2 | a pointer to another array |
n | the number of Ts in p1 and p2 |
Definition at line 98 of file mem_ops.h.
Referenced by botan_same_mem(), check_bcrypt(), check_passhash9(), Botan::CryptoBox::decrypt(), Botan::ChaCha20Poly1305_Decryption::finish(), Botan::GCM_Decryption::finish(), Botan::EAX_Decryption::finish(), Botan::CCM_Decryption::finish(), Botan::OCB_Decryption::finish(), Botan::TLS::TLS_CBC_HMAC_AEAD_Decryption::finish(), Botan::RTSS_Share::reconstruct(), Botan::TLS::Finished::verify(), and Botan::MessageAuthenticationCode::verify_mac().
|
inline |
Definition at line 52 of file stl_util.h.
Referenced by Botan::HTTP::http_sync().
|
inline |
Definition at line 63 of file stl_util.h.
BOTAN_DLL void Botan::secure_scrub_memory | ( | void * | ptr, |
size_t | n | ||
) |
Scrub memory contents in a way that a compiler should not elide, using some system specific technique. Note that this function might not zero the memory (for example, in some hypothetical implementation it might combine the memory contents with the output of a system PRNG), but if you can detect any difference in behavior at runtime then the clearing is side-effecting and you can just use clear_mem
.
Use this function to scrub memory just before deallocating it, or on a stack buffer before returning from the function.
ptr | a pointer to memory to scrub |
n | the number of bytes pointed to by ptr |
Definition at line 17 of file mem_ops.cpp.
Referenced by Botan::secure_allocator< T >::deallocate(), Botan::OS::free_locked_pages(), and Botan::newhope_poly::~newhope_poly().
|
inline |
|
inline |
Return the number of significant bytes in n
n | an integer value |
Definition at line 66 of file bit_ops.h.
References get_byte().
BOTAN_DLL std::vector< std::string > Botan::split_on | ( | const std::string & | str, |
char | delim | ||
) |
Split a string
str | the input string |
delim | the delimitor |
Definition at line 138 of file parsing.cpp.
References split_on_pred().
Referenced by Botan::X509_Object::check_signature(), Botan::PKCS11::MechanismWrapper::create_ecdh_mechanism(), create_private_key(), get_aead(), get_cipher_mode(), Botan::X509_Object::hash_used_for_signature(), pbes2_decrypt(), string_to_ipv4(), Botan::OCSP::Response::verify_signature(), Botan::Win32_CAPI_EntropySource::Win32_CAPI_EntropySource(), and Botan::X509_Cert_Options::X509_Cert_Options().
BOTAN_DLL std::vector< std::string > Botan::split_on_pred | ( | const std::string & | str, |
std::function< bool(char)> | pred | ||
) |
Split a string on a character predicate
str | the input string |
pred | the predicate |
Definition at line 143 of file parsing.cpp.
Referenced by split_on().
x | an integer |
Definition at line 19 of file mp_numth.cpp.
References bigint_sqr(), Botan::BigInt::data(), Botan::BigInt::mutable_data(), Botan::BigInt::Positive, round_up(), Botan::BigInt::sig_words(), and Botan::BigInt::size().
Referenced by Botan::Modular_Reducer::cube(), Botan::Modular_Reducer::Modular_Reducer(), and Botan::Modular_Reducer::square().
std::pair< BigInt, SymmetricKey > BOTAN_DLL Botan::srp6_client_agree | ( | const std::string & | username, |
const std::string & | password, | ||
const std::string & | group_id, | ||
const std::string & | hash_id, | ||
const std::vector< uint8_t > & | salt, | ||
const BigInt & | B, | ||
RandomNumberGenerator & | rng | ||
) |
SRP6a Client side
username | the username we are attempting login for |
password | the password we are attempting to use |
group_id | specifies the shared SRP group |
hash_id | specifies a secure hash function |
salt | is the salt value sent by the server |
B | is the server's public value |
rng | is a random number generator |
Definition at line 76 of file srp6.cpp.
References Botan::BigInt::bytes(), Botan::BigInt::encode_1363(), Botan::DL_Group::get_g(), Botan::DL_Group::get_p(), and power_mod().
Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange().
Return the group id for this SRP param set, or else thrown an exception
N | the group modulus |
g | the group generator |
Definition at line 52 of file srp6.cpp.
References Botan::BigInt::bits(), and Botan::ASN1::to_string().
Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange().
|
inline |
Store a big-endian uint16_t
in | the input uint16_t |
out | the byte array to write to |
Definition at line 441 of file loadstor.h.
References get_byte().
Referenced by Botan::TLS::Connection_Cipher_State::aead_nonce(), copy_out_be(), Botan::CAST_128::decrypt_n(), Botan::DES::decrypt_n(), Botan::Noekeon::decrypt_n(), Botan::SEED::decrypt_n(), Botan::XTEA::decrypt_n(), Botan::KASUMI::decrypt_n(), Botan::Blowfish::decrypt_n(), Botan::MISTY1::decrypt_n(), Botan::CAST_256::decrypt_n(), Botan::TripleDES::decrypt_n(), Botan::Blowfish::encrypt_n(), Botan::SEED::encrypt_n(), Botan::Noekeon::encrypt_n(), Botan::XTEA::encrypt_n(), Botan::DES::encrypt_n(), Botan::CAST_256::encrypt_n(), Botan::KASUMI::encrypt_n(), Botan::CAST_128::encrypt_n(), Botan::MISTY1::encrypt_n(), Botan::TripleDES::encrypt_n(), Botan::TLS::Connection_Cipher_State::format_ad(), Botan::SP800_108_Counter::kdf(), Botan::SP800_108_Feedback::kdf(), Botan::SP800_108_Pipeline::kdf(), Botan::TLS::make_hello_random(), rfc3394_keyunwrap(), rfc3394_keywrap(), Botan::SIMD_4x32::store_be(), store_be(), Botan::SIMD_4x32::store_le(), and Botan::MDx_HashFunction::write_count().
|
inline |
Store a big-endian uint32_t
in | the input uint32_t |
out | the byte array to write to |
Definition at line 473 of file loadstor.h.
References get_byte().
|
inline |
Store a big-endian uint64_t
in | the input uint64_t |
out | the byte array to write to |
Definition at line 509 of file loadstor.h.
References get_byte().
|
inline |
Store two big-endian words
out | the output byte array |
x0 | the first word |
x1 | the second word |
Definition at line 568 of file loadstor.h.
References store_be().
|
inline |
Store four big-endian words
out | the output byte array |
x0 | the first word |
x1 | the second word |
x2 | the third word |
x3 | the fourth word |
Definition at line 600 of file loadstor.h.
References store_be().
|
inline |
Store eight big-endian words
out | the output byte array |
x0 | the first word |
x1 | the second word |
x2 | the third word |
x3 | the fourth word |
x4 | the fifth word |
x5 | the sixth word |
x6 | the seventh word |
x7 | the eighth word |
Definition at line 647 of file loadstor.h.
References store_be().
|
inline |
Store a little-endian uint16_t
in | the input uint16_t |
out | the byte array to write to |
Definition at line 457 of file loadstor.h.
References get_byte().
Referenced by copy_out_le(), Botan::Threefish_512::decrypt_n(), Botan::Twofish::decrypt_n(), Botan::Serpent::decrypt_n(), Botan::GOST_28147_89::decrypt_n(), Botan::Threefish_512::encrypt_n(), Botan::Twofish::encrypt_n(), Botan::Serpent::encrypt_n(), Botan::GOST_28147_89::encrypt_n(), generate_mceliece_key(), Botan::RDRAND_RNG::randomize(), Botan::Stateful_RNG::randomize_with_ts_input(), Botan::RandomNumberGenerator::randomize_with_ts_input(), Botan::ChaCha::seek(), Botan::SIMD_4x32::store_le(), store_le(), Botan::ChaCha20Poly1305_Mode::update_len(), and Botan::MDx_HashFunction::write_count().
|
inline |
Store a little-endian uint32_t
in | the input uint32_t |
out | the byte array to write to |
Definition at line 491 of file loadstor.h.
References get_byte().
|
inline |
Store a little-endian uint64_t
in | the input uint64_t |
out | the byte array to write to |
Definition at line 531 of file loadstor.h.
References get_byte().
|
inline |
Store two little-endian words
out | the output byte array |
x0 | the first word |
x1 | the second word |
Definition at line 555 of file loadstor.h.
References store_le().
|
inline |
Store four little-endian words
out | the output byte array |
x0 | the first word |
x1 | the second word |
x2 | the third word |
x3 | the fourth word |
Definition at line 583 of file loadstor.h.
References store_le().
|
inline |
Store eight little-endian words
out | the output byte array |
x0 | the first word |
x1 | the second word |
x2 | the third word |
x3 | the fourth word |
x4 | the fifth word |
x5 | the sixth word |
x6 | the seventh word |
x7 | the eighth word |
Definition at line 621 of file loadstor.h.
References store_le().
BOTAN_DLL std::string Botan::string_join | ( | const std::vector< std::string > & | strs, |
char | delim | ||
) |
Join a string
strs | strings to join |
delim | the delimitor |
Definition at line 172 of file parsing.cpp.
Referenced by Botan::Parallel::name(), and Botan::CPUID::to_string().
BOTAN_DLL uint32_t Botan::string_to_ipv4 | ( | const std::string & | ip_str | ) |
Convert a string representation of an IPv4 address to a number
ip_str | the string representation |
Definition at line 263 of file parsing.cpp.
References split_on(), and to_u32bit().
Fused subtract-multiply
a | an integer |
b | an integer |
c | an integer |
Definition at line 57 of file mp_numth.cpp.
References Botan::BigInt::is_negative().
std::vector< polyn_gf2m > Botan::syndrome_init | ( | polyn_gf2m const & | generator, |
std::vector< gf2m > const & | support, | ||
int | n | ||
) |
Definition at line 723 of file polyn_gf2m.cpp.
References Botan::polyn_gf2m::get_degree(), lex_to_gray(), and Botan::polyn_gf2m::msp_field.
Referenced by generate_mceliece_key().
BOTAN_DLL RandomNumberGenerator & Botan::system_rng | ( | ) |
Return a shared reference to a global PRNG instance provided by the operating system. For instance might be instantiated by /dev/urandom or CryptGenRandom.
Definition at line 196 of file system_rng.cpp.
Referenced by Botan::System_RNG::add_entropy(), botan_pk_op_decrypt_create(), botan_pk_op_encrypt_create(), botan_pk_op_key_agreement_create(), botan_pk_op_sign_create(), botan_rng_reseed(), Botan::System_RNG::name(), and Botan::System_RNG::randomize().
BOTAN_DLL uint32_t Botan::timespec_to_u32bit | ( | const std::string & | timespec | ) |
Convert a time specification to a number
timespec | the time specification |
Definition at line 54 of file parsing.cpp.
References Botan::Charset::is_digit(), and to_u32bit().
|
inline |
Definition at line 20 of file stl_util.h.
Referenced by Botan::TLS::Channel::key_material_export().
BOTAN_DLL const char * Botan::to_string | ( | Certificate_Status_Code | code | ) |
Convert a status code to a human readable diagnostic message
code | the certifcate status |
Definition at line 12 of file cert_status.cpp.
References CA_CERT_NOT_FOR_CERT_ISSUER, CA_CERT_NOT_FOR_CRL_ISSUER, CANNOT_ESTABLISH_TRUST, CERT_CHAIN_LOOP, CERT_CHAIN_TOO_LONG, CERT_HAS_EXPIRED, CERT_IS_REVOKED, CERT_ISSUER_NOT_FOUND, CERT_NAME_NOMATCH, CERT_NOT_YET_VALID, CERT_PUBKEY_INVALID, CHAIN_LACKS_TRUST_ROOT, CHAIN_NAME_MISMATCH, CRL_BAD_SIGNATURE, CRL_HAS_EXPIRED, CRL_NOT_YET_VALID, INVALID_USAGE, NAME_CONSTRAINT_ERROR, NO_REVOCATION_DATA, OCSP_BAD_STATUS, OCSP_CERT_NOT_LISTED, OCSP_HAS_EXPIRED, OCSP_ISSUER_NOT_FOUND, OCSP_NO_HTTP, OCSP_NOT_YET_VALID, OCSP_RESPONSE_GOOD, OCSP_RESPONSE_INVALID, OCSP_RESPONSE_MISSING_KEYUSAGE, OCSP_SIGNATURE_ERROR, OCSP_SIGNATURE_OK, POLICY_ERROR, SIGNATURE_ERROR, SIGNATURE_METHOD_TOO_WEAK, UNKNOWN_CRITICAL_EXTENSION, UNTRUSTED_HASH, VALID_CRL_CHECKED, and VERIFIED.
|
inline |
Definition at line 25 of file stl_util.h.
Referenced by Botan::Path_Validation_Result::status_string().
BOTAN_DLL uint32_t Botan::to_u32bit | ( | const std::string & | str | ) |
Convert a string to a number
str | the string to convert |
Definition at line 18 of file parsing.cpp.
References Botan::CT::max(), and Botan::ASN1::to_string().
Referenced by Botan::SCAN_Name::arg_as_integer(), check_bcrypt(), create_private_key(), Botan::Data_Store::get1_uint32(), Botan::HTTP::http_sync(), parse_asn1_oid(), Botan::TLS::Text_Policy::srtp_profiles(), string_to_ipv4(), and timespec_to_u32bit().
std::vector<T> Botan::unlock | ( | const secure_vector< T > & | in | ) |
Definition at line 125 of file secmem.h.
References copy_mem().
Referenced by Botan::OCSP::CertID::CertID(), Botan::TLS::Connection_Cipher_State::Connection_Cipher_State(), Botan::BER_Decoder::decode(), Botan::EC_Group::EC_Group(), Botan::ECIES_Encryptor::ECIES_Encryptor(), Botan::PK_Ops::Encryption_with_EME::encrypt(), Botan::TLS::Session::encrypt(), Botan::KeyPair::encryption_consistency_check(), generate_bcrypt(), Botan::DER_Encoder::get_contents_unlocked(), Botan::TLS::Hello_Verify_Request::Hello_Verify_Request(), Botan::OCSP::CertID::is_id_for(), Botan::DL_Group::PEM_decode(), Botan::EC_PublicKey::public_key_bits(), Botan::DH_PublicKey::public_value(), Botan::ECDH_PublicKey::public_value(), Botan::PKCS10_Request::raw_public_key(), Botan::TLS::Session_Manager_SQL::Session_Manager_SQL(), and Botan::PK_Signer::signature().
bool Botan::value_exists | ( | const std::vector< T > & | vec, |
const T & | val | ||
) |
Existence check for values
Definition at line 86 of file stl_util.h.
Referenced by Botan::TLS::Policy::allowed_ecc_curve(), Botan::TLS::Policy::allowed_signature_method(), Botan::TLS::Policy::choose_curve(), Botan::TLS::Policy::ciphersuite_list(), and Botan::TLS::Client_Hello::Client_Hello().
BOTAN_DLL void Botan::verify_cert_constraints_valid_for_key_type | ( | const Public_Key & | pub_key, |
Key_Constraints | constraints | ||
) |
Check that key constraints are permitted for a specific public key.
pub_key | the public key on which the constraints shall be enforced on |
constraints | the constraints that shall be enforced on the key |
Exception | if the given constraints are not permitted for this key |
Definition at line 69 of file key_constraint.cpp.
References Botan::Public_Key::algo_name(), CRL_SIGN, DATA_ENCIPHERMENT, DECIPHER_ONLY, DIGITAL_SIGNATURE, ENCIPHER_ONLY, KEY_AGREEMENT, KEY_CERT_SIGN, key_constraints_to_string(), KEY_ENCIPHERMENT, and NON_REPUDIATION.
Referenced by Botan::X509::create_cert_req(), Botan::X509::create_self_signed_cert(), and Botan::X509_CA::sign_request().
|
inline |
Definition at line 177 of file numthry.h.
References is_prime().
BOTAN_DLL const char * Botan::version_cstr | ( | ) |
Definition at line 28 of file version.cpp.
References STR.
Referenced by botan_version_string(), and version_string().
BOTAN_DLL uint32_t Botan::version_datestamp | ( | ) |
Return the date this version of botan was released, in an integer of the form YYYYMMDD. For instance a version released on May 21, 2013 would return the integer 20130521. If the currently running version is not an official release, this function will return 0 instead.
Definition at line 55 of file version.cpp.
Referenced by botan_version_datestamp().
BOTAN_DLL uint32_t Botan::version_major | ( | ) |
Get the major version number.
Definition at line 60 of file version.cpp.
Referenced by botan_version_major(), and runtime_version_check().
BOTAN_DLL uint32_t Botan::version_minor | ( | ) |
Get the minor version number.
Definition at line 61 of file version.cpp.
Referenced by botan_version_minor(), and runtime_version_check().
BOTAN_DLL uint32_t Botan::version_patch | ( | ) |
Get the patch number.
Definition at line 62 of file version.cpp.
Referenced by botan_version_patch(), and runtime_version_check().
BOTAN_DLL std::string Botan::version_string | ( | ) |
Get a human-readable string identifying the version of Botan. No particular format should be assumed.
Definition at line 23 of file version.cpp.
References version_cstr().
|
inline |
Definition at line 717 of file mp_asmi.h.
References word_madd2().
Referenced by bigint_comba_mul16(), bigint_comba_mul4(), bigint_comba_mul6(), bigint_comba_mul8(), bigint_comba_mul9(), bigint_comba_sqr16(), bigint_comba_sqr4(), bigint_comba_sqr6(), bigint_comba_sqr8(), and bigint_comba_sqr9().
|
inline |
Definition at line 756 of file mp_asmi.h.
References word_add(), and word_madd2().
Referenced by bigint_comba_sqr16(), bigint_comba_sqr4(), bigint_comba_sqr6(), bigint_comba_sqr8(), and bigint_comba_sqr9().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 681 of file mp_asmi.h.
References word_madd3().
Referenced by bigint_monty_redc().
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 107 of file mp_asmi.h.
Referenced by bigint_add2_nc(), bigint_add3_nc(), bigint_cnd_abs(), bigint_cnd_add(), word3_muladd_2(), word8_add2(), and word8_add3().
|
inline |
Definition at line 59 of file mp_madd.h.
References mul64x64_128().
Referenced by bigint_linmul2(), bigint_linmul3(), bigint_modop(), word3_muladd(), word3_muladd_2(), word8_linmul2(), and word8_linmul3().
|
inline |
Definition at line 105 of file mp_madd.h.
References mul64x64_128().
Referenced by bigint_monty_redc(), and word8_madd3().
|
inline |
Definition at line 280 of file mp_asmi.h.
Referenced by bigint_cnd_sub(), bigint_monty_redc(), bigint_sub2(), bigint_sub2_rev(), bigint_sub3(), word8_sub2(), word8_sub2_rev(), and word8_sub3().
BOTAN_DLL bool Botan::x500_name_cmp | ( | const std::string & | name1, |
const std::string & | name2 | ||
) |
Compare two names using the X.509 comparison algorithm
name1 | the first name |
name2 | the second name |
Definition at line 222 of file parsing.cpp.
References Botan::Charset::caseless_cmp(), and Botan::Charset::is_space().
Referenced by operator==().
Path_Validation_Result BOTAN_DLL Botan::x509_path_validate | ( | const std::vector< X509_Certificate > & | end_certs, |
const Path_Validation_Restrictions & | restrictions, | ||
const std::vector< Certificate_Store * > & | trusted_roots, | ||
const std::string & | hostname = "" , |
||
Usage_Type | usage = Usage_Type::UNSPECIFIED , |
||
std::chrono::system_clock::time_point | validation_time = std::chrono::system_clock::now() , |
||
std::chrono::milliseconds | ocsp_timeout = std::chrono::milliseconds(0) , |
||
const std::vector< std::shared_ptr< const OCSP::Response >> & | ocsp_resp = {} |
||
) |
PKIX Path Validation
end_certs | certificate chain to validate |
restrictions | path validation restrictions |
trusted_roots | list of certificate stores that contain trusted certificates |
hostname | if not empty, compared against the DNS name in end_certs[0] |
usage | if not set to UNSPECIFIED, compared against the key usage in end_certs[0] |
validation_time | what reference time to use for validation |
ocsp_timeout | timeout for OCSP operations, 0 disables OCSP check |
ocsp_resp | additional OCSP responses to consider (eg from peer) |
Definition at line 562 of file x509path.cpp.
References Botan::PKIX::build_certificate_path(), Botan::PKIX::check_chain(), Botan::PKIX::check_crl(), Botan::PKIX::check_ocsp(), Botan::PKIX::merge_revocation_status(), Botan::Path_Validation_Restrictions::minimum_key_strength(), Botan::Path_Validation_Restrictions::ocsp_all_intermediates(), OCSP_NO_HTTP, OK, Botan::Path_Validation_Restrictions::require_revocation_information(), and Botan::Path_Validation_Restrictions::trusted_hashes().
Referenced by Botan::TLS::Callbacks::tls_verify_cert_chain(), and x509_path_validate().
Path_Validation_Result BOTAN_DLL Botan::x509_path_validate | ( | const X509_Certificate & | end_cert, |
const Path_Validation_Restrictions & | restrictions, | ||
const std::vector< Certificate_Store * > & | trusted_roots, | ||
const std::string & | hostname = "" , |
||
Usage_Type | usage = Usage_Type::UNSPECIFIED , |
||
std::chrono::system_clock::time_point | validation_time = std::chrono::system_clock::now() , |
||
std::chrono::milliseconds | ocsp_timeout = std::chrono::milliseconds(0) , |
||
const std::vector< std::shared_ptr< const OCSP::Response >> & | ocsp_resp = {} |
||
) |
PKIX Path Validation
end_cert | certificate to validate |
restrictions | path validation restrictions |
trusted_roots | list of stores that contain trusted certificates |
hostname | if not empty, compared against the DNS name in end_cert |
usage | if not set to UNSPECIFIED, compared against the key usage in end_cert |
validation_time | what reference time to use for validation |
ocsp_timeout | timeoutput for OCSP operations, 0 disables OCSP check |
ocsp_resp | additional OCSP responses to consider (eg from peer) |
Definition at line 626 of file x509path.cpp.
References x509_path_validate().
Path_Validation_Result BOTAN_DLL Botan::x509_path_validate | ( | const std::vector< X509_Certificate > & | end_certs, |
const Path_Validation_Restrictions & | restrictions, | ||
const Certificate_Store & | store, | ||
const std::string & | hostname = "" , |
||
Usage_Type | usage = Usage_Type::UNSPECIFIED , |
||
std::chrono::system_clock::time_point | validation_time = std::chrono::system_clock::now() , |
||
std::chrono::milliseconds | ocsp_timeout = std::chrono::milliseconds(0) , |
||
const std::vector< std::shared_ptr< const OCSP::Response >> & | ocsp_resp = {} |
||
) |
PKIX Path Validation
end_certs | certificate chain to validate |
restrictions | path validation restrictions |
store | store that contains trusted certificates |
hostname | if not empty, compared against the DNS name in end_certs[0] |
usage | if not set to UNSPECIFIED, compared against the key usage in end_certs[0] |
validation_time | what reference time to use for validation |
ocsp_timeout | timeoutput for OCSP operations, 0 disables OCSP check |
ocsp_resp | additional OCSP responses to consider (eg from peer) |
Definition at line 641 of file x509path.cpp.
References x509_path_validate().
Path_Validation_Result BOTAN_DLL Botan::x509_path_validate | ( | const X509_Certificate & | end_cert, |
const Path_Validation_Restrictions & | restrictions, | ||
const Certificate_Store & | store, | ||
const std::string & | hostname = "" , |
||
Usage_Type | usage = Usage_Type::UNSPECIFIED , |
||
std::chrono::system_clock::time_point | validation_time = std::chrono::system_clock::now() , |
||
std::chrono::milliseconds | ocsp_timeout = std::chrono::milliseconds(0) , |
||
const std::vector< std::shared_ptr< const OCSP::Response >> & | ocsp_resp = {} |
||
) |
PKIX Path Validation
end_cert | certificate to validate |
restrictions | path validation restrictions |
store | store that contains trusted certificates |
hostname | if not empty, compared against the DNS name in end_cert |
usage | if not set to UNSPECIFIED, compared against the key usage in end_cert |
validation_time | what reference time to use for validation |
ocsp_timeout | timeout for OCSP operations, 0 disables OCSP check |
ocsp_resp | additional OCSP responses to consider (eg from peer) |
Definition at line 657 of file x509path.cpp.
References x509_path_validate().
void Botan::xor_buf | ( | T | out[], |
const T | in[], | ||
size_t | length | ||
) |
XOR_ arrays. Postcondition out[i] = in[i] ^ out[i] forall i = 0...length
out | the input/output buffer |
in | the read-only input buffer |
length | the length of the buffers |
Definition at line 115 of file mem_ops.h.
Referenced by Botan::TLS::Connection_Cipher_State::aead_nonce(), aont_package(), aont_unpackage(), Botan::XMSS_WOTS_Common_Ops::chain(), Botan::XMSS_WOTS_PublicKey::chain(), Botan::Salsa20::cipher(), Botan::OFB::cipher(), Botan::RC4::cipher(), Botan::CTR_BE::cipher(), Botan::SHAKE_128_Cipher::cipher(), Botan::ChaCha::cipher(), Botan::DESX::decrypt_n(), Botan::Lion::decrypt_n(), Botan::DESX::encrypt_n(), Botan::Lion::encrypt_n(), Botan::XTS_Encryption::finish(), Botan::EAX_Encryption::finish(), Botan::XTS_Decryption::finish(), Botan::CCM_Encryption::finish(), Botan::OCB_Encryption::finish(), Botan::CTS_Encryption::finish(), Botan::CCM_Decryption::finish(), Botan::OCB_Decryption::finish(), Botan::CTS_Decryption::finish(), Botan::GHASH::ghash_update(), mgf1_mask(), operator^(), Botan::OctetString::operator^=(), operator^=(), pbkdf2(), Botan::XTS_Encryption::process(), Botan::CBC_Encryption::process(), Botan::CFB_Encryption::process(), Botan::XTS_Decryption::process(), Botan::CFB_Decryption::process(), Botan::CBC_Decryption::process(), rfc3394_keyunwrap(), rfc3394_keywrap(), Botan::SIV_Mode::S2V(), and xor_buf().
void Botan::xor_buf | ( | T | out[], |
const T | in[], | ||
const T | in2[], | ||
size_t | length | ||
) |
XOR arrays. Postcondition out[i] = in[i] ^ in2[i] forall i = 0...length
out | the output buffer |
in | the first input buffer |
in2 | the second output buffer |
length | the length of the three buffers |
void Botan::xor_buf | ( | std::vector< uint8_t, Alloc > & | out, |
const std::vector< uint8_t, Alloc2 > & | in, | ||
size_t | n | ||
) |
Definition at line 142 of file mem_ops.h.
References xor_buf().
void Botan::xor_buf | ( | std::vector< uint8_t, Alloc > & | out, |
const uint8_t * | in, | ||
size_t | n | ||
) |
Definition at line 150 of file mem_ops.h.
References xor_buf().
void Botan::xor_buf | ( | std::vector< uint8_t, Alloc > & | out, |
const uint8_t * | in, | ||
const std::vector< uint8_t, Alloc2 > & | in2, | ||
size_t | n | ||
) |
Definition at line 158 of file mem_ops.h.
References xor_buf().
void Botan::zap | ( | std::vector< T, Alloc > & | vec | ) |
Zeroise the values then free the memory
vec | the vector to zeroise and free |
Definition at line 221 of file secmem.h.
References zeroise().
Referenced by Botan::HMAC::clear(), Botan::AES_128::clear(), Botan::CAST_128::clear(), Botan::MISTY1::clear(), Botan::CAST_256::clear(), Botan::XTEA::clear(), Botan::SEED::clear(), Botan::Camellia_128::clear(), Botan::Twofish::clear(), Botan::DES::clear(), Botan::DESX::clear(), Botan::IDEA::clear(), Botan::KASUMI::clear(), Botan::Noekeon::clear(), Botan::Serpent::clear(), Botan::Threefish_512::clear(), Botan::RC4::clear(), Botan::Poly1305::clear(), Botan::Blowfish::clear(), Botan::Salsa20::clear(), Botan::TripleDES::clear(), Botan::Camellia_192::clear(), Botan::ChaCha::clear(), Botan::AES_192::clear(), Botan::GOST_28147_89::clear(), Botan::Camellia_256::clear(), and Botan::AES_256::clear().
void Botan::zeroise | ( | std::vector< T, Alloc > & | vec | ) |
Zeroise the values; length remains unchanged
vec | the vector to zeroise |
Definition at line 211 of file secmem.h.
References clear_mem().
Referenced by aont_package(), aont_unpackage(), Botan::ANSI_X919_MAC::clear(), Botan::MD4::clear(), Botan::Whirlpool::clear(), Botan::CBC_MAC::clear(), Botan::MD5::clear(), Botan::RIPEMD_160::clear(), Botan::SHA_160::clear(), Botan::CMAC::clear(), Botan::GOST_34_11::clear(), Botan::Tiger::clear(), Botan::SHA_3::clear(), Botan::Keccak_1600::clear(), Botan::SHAKE_128::clear(), Botan::Skein_512::clear(), Botan::Lion::clear(), Botan::OFB::clear(), Botan::CTR_BE::clear(), Botan::Blake2b::clear(), Botan::MDx_HashFunction::clear(), Botan::SHAKE_128_Cipher::clear(), Botan::SHAKE_256::clear(), Botan::GHASH::clear(), Botan::BigInt::clear(), Botan::MDx_HashFunction::final_result(), Botan::OCB_Encryption::finish(), Botan::OCB_Decryption::finish(), Botan::BigInt::operator+=(), Botan::OctetString::operator^=(), Botan::CBC_Mode::reset(), Botan::XTS_Mode::reset(), Botan::OCB_Mode::reset(), Botan::CBC_Decryption::reset(), Botan::GHASH::reset(), Botan::GHASH::set_associated_data(), Botan::OFB::set_iv(), Botan::CTR_BE::set_iv(), and zap().
const uint32_t Botan::CAST_SBOX1[256] |
Definition at line 15 of file cast_sboxes.h.
const uint32_t Botan::CAST_SBOX2[256] |
Definition at line 60 of file cast_sboxes.h.
const uint32_t Botan::CAST_SBOX3[256] |
Definition at line 105 of file cast_sboxes.h.
const uint32_t Botan::CAST_SBOX4[256] |
Definition at line 150 of file cast_sboxes.h.
const uint64_t Botan::DES_FPTAB1 |
Definition at line 504 of file des_tab.cpp.
Referenced by Botan::DES::decrypt_n(), Botan::TripleDES::decrypt_n(), Botan::DES::encrypt_n(), and Botan::TripleDES::encrypt_n().
const uint64_t Botan::DES_FPTAB2 |
Definition at line 570 of file des_tab.cpp.
Referenced by Botan::DES::decrypt_n(), Botan::TripleDES::decrypt_n(), Botan::DES::encrypt_n(), and Botan::TripleDES::encrypt_n().
const uint64_t Botan::DES_IPTAB1 |
Definition at line 372 of file des_tab.cpp.
Referenced by Botan::DES::decrypt_n(), Botan::TripleDES::decrypt_n(), Botan::DES::encrypt_n(), and Botan::TripleDES::encrypt_n().
const uint64_t Botan::DES_IPTAB2 |
Definition at line 438 of file des_tab.cpp.
Referenced by Botan::DES::decrypt_n(), Botan::TripleDES::decrypt_n(), Botan::DES::encrypt_n(), and Botan::TripleDES::encrypt_n().
const uint32_t Botan::DES_SPBOX1 |
Definition at line 12 of file des_tab.cpp.
const uint32_t Botan::DES_SPBOX2 |
Definition at line 57 of file des_tab.cpp.
const uint32_t Botan::DES_SPBOX3 |
Definition at line 102 of file des_tab.cpp.
const uint32_t Botan::DES_SPBOX4 |
Definition at line 147 of file des_tab.cpp.
const uint32_t Botan::DES_SPBOX5 |
Definition at line 192 of file des_tab.cpp.
const uint32_t Botan::DES_SPBOX6 |
Definition at line 237 of file des_tab.cpp.
const uint32_t Botan::DES_SPBOX7 |
Definition at line 282 of file des_tab.cpp.
const uint32_t Botan::DES_SPBOX8 |
Definition at line 327 of file des_tab.cpp.
const size_t Botan::HEX_CODEC_BUFFER_SIZE = 256 |
Size used for internal buffer in hex encoder/decoder
Definition at line 20 of file hex_filt.cpp.
const size_t Botan::MP_WORD_BITS = BOTAN_MP_WORD_BITS |
Definition at line 21 of file mp_core.h.
Referenced by Botan::BigInt::BigInt(), bigint_divop(), bigint_shl1(), bigint_shl2(), bigint_shr1(), bigint_shr2(), Botan::BigInt::bits(), Botan::BigInt::clear_bit(), divide(), Botan::Modular_Reducer::Modular_Reducer(), operator<<(), Botan::BigInt::operator<<=(), operator>>(), Botan::BigInt::operator>>=(), redc_p521(), Botan::Modular_Reducer::reduce(), and Botan::BigInt::set_bit().
const word Botan::MP_WORD_MASK = ~static_cast<word>(0) |
Definition at line 27 of file mp_types.h.
Referenced by Botan::BigInt::BigInt().
const word Botan::MP_WORD_MAX = MP_WORD_MASK |
Definition at line 29 of file mp_types.h.
Referenced by divide(), and monty_inverse().
const word Botan::MP_WORD_TOP_BIT = static_cast<word>(1) << (8*sizeof(word) - 1) |
Definition at line 28 of file mp_types.h.
Referenced by bigint_divop(), and divide().
const size_t Botan::PRIME_TABLE_SIZE = 6541 |
The size of the PRIMES[] array
Definition at line 240 of file numthry.h.
Referenced by Botan::DL_Group::DL_Group(), is_prime(), and random_prime().
const uint16_t Botan::PRIMES |
A const array of all primes less than 65535
Definition at line 12 of file primes.cpp.
Referenced by Botan::DL_Group::DL_Group(), is_prime(), and random_prime().