Botan 2.19.3
Crypto and TLS for C&
|
Namespaces | |
namespace | ARIA_F |
namespace | ASN1 |
namespace | Camellia_F |
namespace | Cert_Extension |
namespace | Charset |
namespace | CryptoBox |
namespace | CT |
namespace | FPE |
namespace | HTTP |
namespace | KeyPair |
namespace | OCSP |
namespace | OIDS |
namespace | OS |
namespace | PEM_Code |
namespace | PK_Ops |
namespace | PKCS11 |
namespace | PKCS8 |
namespace | PKIX |
namespace | Roughtime |
namespace | SHA1_F |
namespace | SHA1_SSE2_F |
namespace | Sodium |
namespace | stlCompatibilityDetails |
namespace | TLS |
namespace | X509 |
Functions | |
BigInt | abs (const BigInt &n) |
BOTAN_MALLOC_FN void * | allocate_memory (size_t elems, size_t elem_size) |
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 | argon2 (uint8_t output[], size_t output_len, const char *password, size_t password_len, const uint8_t salt[], size_t salt_len, const uint8_t key[], size_t key_len, const uint8_t ad[], size_t ad_len, uint8_t mode, size_t threads, size_t M, size_t t) |
bool | argon2_check_pwhash (const char *password, size_t password_len, const std::string &hash) |
std::string | argon2_generate_pwhash (const char *password, size_t password_len, RandomNumberGenerator &rng, size_t p, size_t M, size_t t, uint8_t y=2, size_t salt_len=16, size_t output_len=32) |
std::string | asn1_class_to_string (ASN1_Tag type) |
std::string | asn1_tag_to_string (ASN1_Tag type) |
void | assertion_failure (const char *expr_str, const char *assertion_made, const char *func, const char *file, int line) |
secure_vector< uint8_t > | base32_decode (const char input[], size_t input_length, bool ignore_ws) |
secure_vector< uint8_t > | base32_decode (const std::string &input, bool ignore_ws) |
size_t | base32_decode (uint8_t out[], const char in[], size_t input_length, size_t &input_consumed, bool final_inputs, bool ignore_ws) |
size_t | base32_decode (uint8_t output[], const char input[], size_t input_length, bool ignore_ws) |
size_t | base32_decode (uint8_t output[], const std::string &input, bool ignore_ws) |
size_t | base32_encode (char out[], const uint8_t in[], size_t input_length, size_t &input_consumed, bool final_inputs) |
template<typename Alloc > | |
std::string | base32_encode (const std::vector< uint8_t, Alloc > &input) |
std::string | base32_encode (const uint8_t input[], size_t input_length) |
std::vector< uint8_t > | base58_check_decode (const char input[], size_t input_length) |
std::vector< uint8_t > | base58_check_decode (const std::string &s) |
template<typename Alloc > | |
std::string | base58_check_encode (const std::vector< uint8_t, Alloc > &vec) |
std::string | base58_check_encode (const uint8_t input[], size_t input_length) |
std::vector< uint8_t > | base58_decode (const char input[], size_t input_length) |
std::vector< uint8_t > | base58_decode (const std::string &s) |
template<typename Alloc > | |
std::string | base58_encode (const std::vector< uint8_t, Alloc > &vec) |
std::string | base58_encode (const uint8_t input[], size_t input_length) |
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 (uint8_t out[], const char in[], 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) |
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) |
template<typename Base > | |
size_t | base_decode (Base &&base, uint8_t output[], const char input[], size_t input_length, size_t &input_consumed, bool final_inputs, bool ignore_ws=true) |
template<typename Base > | |
size_t | base_decode_full (Base &&base, uint8_t output[], const char input[], size_t input_length, bool ignore_ws) |
template<typename Vector , typename Base > | |
Vector | base_decode_to_vec (Base &&base, const char input[], size_t input_length, bool ignore_ws) |
template<class Base > | |
size_t | base_encode (Base &&base, char output[], const uint8_t input[], size_t input_length, size_t &input_consumed, bool final_inputs) |
template<typename Base > | |
std::string | base_encode_to_string (Base &&base, const uint8_t input[], size_t input_length) |
void | bcrypt_pbkdf (uint8_t output[], size_t output_len, const char *pass, size_t pass_len, const uint8_t salt[], size_t salt_len, size_t rounds) |
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_add (word cnd, word x[], word x_size, const word y[], size_t y_size) |
void | bigint_cnd_add_or_sub (CT::Mask< word > mask, word x[], const word y[], size_t size) |
word | bigint_cnd_addsub (CT::Mask< word > mask, word x[], const word y[], const word z[], size_t size) |
word | bigint_cnd_sub (word cnd, word x[], const word y[], size_t size) |
word | bigint_cnd_sub (word cnd, word x[], size_t x_size, const word y[], size_t y_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_mul24 (word z[48], const word x[24], const word y[24]) |
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_sqr24 (word z[48], const word x[24]) |
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]) |
CT::Mask< word > | bigint_ct_is_eq (const word x[], size_t x_size, const word y[], size_t y_size) |
CT::Mask< word > | bigint_ct_is_lt (const word x[], size_t x_size, const word y[], size_t y_size, bool lt_or_equal=false) |
word | bigint_divop (word n1, word n0, word d) |
word BOTAN_WARN_UNUSED_RESULT | bigint_linmul2 (word x[], size_t x_size, word y) |
void | bigint_linmul3 (word z[], const word x[], size_t x_size, word y) |
void | bigint_mod_sub (word t[], const word s[], const word mod[], size_t mod_sw, word ws[]) |
template<size_t N> | |
void | bigint_mod_sub_n (word t[], const word s[], const word mod[], word ws[]) |
word | bigint_modop (word n1, word n0, word d) |
void | bigint_monty_redc (word z[], const word p[], size_t p_size, word p_dash, word workspace[], size_t ws_size) |
void | bigint_monty_redc_16 (word z[], const word p[16], word p_dash, word ws[]) |
void | bigint_monty_redc_16 (word z[], const word p[], word p_dash, word ws[]) |
void | bigint_monty_redc_24 (word z[], const word p[24], word p_dash, word ws[]) |
void | bigint_monty_redc_24 (word z[], const word p[], word p_dash, word ws[]) |
void | bigint_monty_redc_32 (word z[], const word p[32], word p_dash, word ws[]) |
void | bigint_monty_redc_32 (word z[], const word p[], word p_dash, word ws[]) |
void | bigint_monty_redc_4 (word z[], const word p[4], word p_dash, word ws[]) |
void | bigint_monty_redc_4 (word z[], const word p[], word p_dash, word ws[]) |
void | bigint_monty_redc_6 (word z[], const word p[6], word p_dash, word ws[]) |
void | bigint_monty_redc_6 (word z[], const word p[], word p_dash, word ws[]) |
void | bigint_monty_redc_8 (word z[], const word p[8], word p_dash, word ws[]) |
void | bigint_monty_redc_8 (word z[], const word p[], word p_dash, word ws[]) |
void | bigint_mul (word z[], size_t z_size, const word x[], size_t x_size, size_t x_sw, const word y[], size_t y_size, size_t y_sw, word workspace[], size_t ws_size) |
void | bigint_shl1 (word x[], size_t x_size, size_t x_words, 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, const word x[], size_t x_size, size_t x_sw, word workspace[], size_t ws_size) |
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) |
CT::Mask< word > | bigint_sub_abs (word z[], const word x[], const word y[], size_t N, word ws[]) |
int32_t | bigint_sub_abs (word z[], const word x[], size_t x_size, const word y[], size_t y_size) |
template<typename T > | |
T | bit_permute_step (T x, T mask, size_t shift) |
size_t | bit_size_to_32bit_size (size_t bit_size) |
size_t | bit_size_to_byte_size (size_t bit_size) |
void | blamka_ssse3 (uint64_t T[128]) |
const BotanErrorCategory & | botan_category () noexcept |
template<typename T > | |
void | bswap_4 (T x[4]) |
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) |
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) |
calendar_point | calendar_value (const std::chrono::system_clock::time_point &time_point) |
template<size_t S, int64_t MUL = 1> | |
void | carry (int64_t &h0, int64_t &h1) |
template<size_t S> | |
void | carry0 (int32_t &h0, int32_t &h1) |
template<size_t S> | |
void | carry0 (int64_t &h0, int64_t &h1) |
uint64_t | carry_shift (const donna128 &a, size_t shift) |
uint8_t * | cast_char_ptr_to_uint8 (char *s) |
const uint8_t * | cast_char_ptr_to_uint8 (const char *s) |
const char * | cast_uint8_ptr_to_char (const uint8_t *b) |
char * | cast_uint8_ptr_to_char (uint8_t *b) |
void | CECPQ1_accept (uint8_t *shared_key, uint8_t *accept_message, const uint8_t *offer_message, RandomNumberGenerator &rng) |
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 | 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 *offer_message, CECPQ1_key *offer_key_output, RandomNumberGenerator &rng) |
void | CECPQ1_offer (uint8_t send[CECPQ1_OFFER_BYTES], CECPQ1_key *offer_key_output, RandomNumberGenerator &rng) |
template<typename T > | |
uint8_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, const std::map< std::string, std::string > &opts, RandomNumberGenerator &rng, const std::string &hash_fn, AlgorithmIdentifier &sig_algo) |
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 | 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) |
void | commoncrypto_adjust_key_size (const uint8_t key[], size_t length, const CommonCryptor_Opts &opts, secure_vector< uint8_t > &full_key) |
CommonCryptor_Opts | commoncrypto_opts_from_algo (const std::string &algo) |
CommonCryptor_Opts | commoncrypto_opts_from_algo_name (const std::string &algo_name) |
bool | constant_time_compare (const uint8_t x[], const uint8_t y[], size_t len) |
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) |
template<typename Alloc > | |
std::string | create_hex_fingerprint (const std::vector< uint8_t, Alloc > &vec, const std::string &hash_name) |
std::string | create_hex_fingerprint (const uint8_t bits[], size_t bits_len, const std::string &hash_name) |
std::unique_ptr< Private_Key > | create_private_key (const std::string &alg_name, RandomNumberGenerator &rng, const std::string ¶ms, const std::string &provider) |
uint8_t | ct_compare_u8 (const uint8_t x[], const uint8_t y[], size_t len) |
BigInt | ct_divide (const BigInt &x, const BigInt &y) |
void | ct_divide (const BigInt &x, const BigInt &y, BigInt &q_out, BigInt &r_out) |
void | ct_divide_u8 (const BigInt &x, uint8_t y, BigInt &q_out, uint8_t &r_out) |
BigInt | ct_inverse_mod_odd_modulus (const BigInt &n, const BigInt &mod) |
template<typename T > | |
T | ct_is_zero (T x) |
BigInt | ct_modulo (const BigInt &x, const BigInt &y) |
template<typename T > | |
size_t | ctz (T n) |
void | curve25519_basepoint (uint8_t mypublic[32], const uint8_t secret[32]) |
void | curve25519_donna (uint8_t mypublic[32], const uint8_t secret[32], const uint8_t basepoint[32]) |
void | deallocate_memory (void *p, size_t elems, size_t elem_size) |
gf2m | decode_gf2m (const uint8_t *mem) |
void | divide (const BigInt &x, const BigInt &y, BigInt &q, BigInt &r) |
size_t | dl_exponent_size (size_t bits) |
size_t | dl_work_factor (size_t bits) |
template<typename E , typename... Args> | |
void | do_throw_error (const char *file, int line, const char *func, Args... args) |
secure_vector< uint8_t > | EC2OSP (const PointGFp &point, uint8_t format) |
size_t | ecp_work_factor (size_t bits) |
void | ed25519_gen_keypair (uint8_t *pk, uint8_t *sk, const uint8_t seed[32]) |
void | ed25519_gen_keypair (uint8_t pk[32], uint8_t sk[64], const uint8_t seed[32]) |
void | ed25519_sign (uint8_t sig[64], const uint8_t m[], size_t mlen, const uint8_t sk[64], const uint8_t domain_sep[], size_t domain_sep_len) |
bool | ed25519_verify (const uint8_t *m, size_t mlen, const uint8_t sig[64], const uint8_t *pk, const uint8_t domain_sep[], size_t domain_sep_len) |
bool | ed25519_verify (const uint8_t msg[], size_t msg_len, const uint8_t sig[64], const uint8_t pk[32], const uint8_t domain_sep[], size_t domain_sep_len) |
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) |
template<typename T > | |
T | expand_top_bit (T a) |
void | fe_0 (fe &x) |
void | fe_1 (fe &x) |
void | fe_add (fe &x, const fe &a, const fe &b) |
void | fe_copy (fe &a, const fe &b) |
void | fe_frombytes (fe &x, const uint8_t *b) |
void | fe_invert (fe &x, const fe &z) |
int | fe_isnegative (const fe &x) |
int | fe_isnonzero (const fe &x) |
void | fe_mul (fe &x, const fe &a, const fe &b) |
void | fe_neg (fe &x, const fe &z) |
void | fe_pow22523 (fe &x, const fe &y) |
void | fe_sq (fe &x, const fe &z) |
void | fe_sq2 (fe &x, const fe &z) |
void | fe_sq_iter (fe &x, const fe &z, size_t iter) |
void | fe_sub (fe &x, const fe &a, const fe &b) |
void | fe_tobytes (uint8_t *b, const fe &x) |
secure_vector< gf2m > | find_roots_gf2m_decomp (const polyn_gf2m &polyn, size_t code_length) |
BigInt | gcd (const BigInt &a, const BigInt &b) |
void | ge_double_scalarmult_vartime (uint8_t out[32], const uint8_t *a, const ge_p3 *A, const uint8_t *b) |
void | ge_double_scalarmult_vartime (uint8_t out[32], const uint8_t a[], const ge_p3 *A, const uint8_t b[]) |
int | ge_frombytes_negate_vartime (ge_p3 *, const uint8_t *) |
void | ge_scalarmult_base (uint8_t out[32], const uint8_t in[32]) |
std::string | generate_bcrypt (const std::string &pass, RandomNumberGenerator &rng, uint16_t work_factor, char version) |
std::vector< uint8_t > | generate_dsa_primes (RandomNumberGenerator &rng, BigInt &p, BigInt &q, size_t pbits, size_t qbits) |
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) |
McEliece_PrivateKey | generate_mceliece_key (RandomNumberGenerator &rng, size_t ext_deg, size_t code_length, size_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_rsa_prime (RandomNumberGenerator &keygen_rng, RandomNumberGenerator &prime_test_rng, size_t bits, const BigInt &coprime, size_t prob) |
BigInt | generate_srp6_verifier (const std::string &identifier, const std::string &password, const std::vector< uint8_t > &salt, const DL_Group &group, const std::string &hash_id) |
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 &name, Cipher_Dir direction) |
BlockCipherModePaddingMethod * | get_bc_pad (const std::string &algo_spec) |
template<typename T > | |
constexpr 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, Cipher_Dir direction) |
Keyed_Filter * | get_cipher (const std::string &algo_spec, const SymmetricKey &key, const InitializationVector &iv, Cipher_Dir direction) |
Cipher_Mode * | get_cipher_mode (const std::string &algo_spec, Cipher_Dir direction, const std::string &provider="") |
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) |
KDF * | get_kdf (const std::string &algo_spec) |
PBKDF * | get_pbkdf (const std::string &algo_spec, const std::string &provider="") |
PBKDF * | get_s2k (const std::string &algo_spec) |
const std::vector< std::string > | get_sig_paddings (const std::string algo) |
gf2m | gray_to_lex (gf2m gray) |
bool | has_filesystem_impl () |
std::string | hash_for_emsa (const std::string &algo_spec) |
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) |
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 char input[], size_t input_length, size_t &input_consumed, bool ignore_ws) |
size_t | hex_decode (uint8_t output[], 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) |
template<typename Alloc > | |
std::string | hex_encode (const std::vector< uint8_t, Alloc > &input, bool uppercase=true) |
std::string | hex_encode (const uint8_t input[], size_t input_length, bool uppercase) |
template<typename T > | |
size_t | high_bit (T n) |
secure_vector< uint8_t > | hkdf_expand_label (const std::string &hash_fn, const uint8_t secret[], size_t secret_len, const std::string &label, const uint8_t hash_val[], size_t hash_val_len, size_t length) |
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) |
void | initialize_allocator () |
BigInt | inverse_euclid (const BigInt &x, const BigInt &modulus) |
BigInt | inverse_mod (const BigInt &n, const BigInt &mod) |
std::string | ipv4_to_string (uint32_t ip) |
bool | is_bailie_psw_probable_prime (const BigInt &n) |
bool | is_bailie_psw_probable_prime (const BigInt &n, const Modular_Reducer &mod_n) |
bool | is_lucas_probable_prime (const BigInt &C, const Modular_Reducer &mod_C) |
bool | is_miller_rabin_probable_prime (const BigInt &n, const Modular_Reducer &mod_n, RandomNumberGenerator &rng, size_t test_iterations) |
bool | is_passhash9_alg_supported (uint8_t alg_id) |
BigInt | is_perfect_square (const BigInt &C) |
template<typename T > | |
constexpr 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) |
uint64_t | load_3 (const uint8_t in[3]) |
uint64_t | load_4 (const uint8_t *in) |
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) |
size_t | low_zero_bits (const BigInt &n) |
std::unique_ptr< BlockCipher > | make_commoncrypto_block_cipher (const std::string &name) |
Cipher_Mode * | make_commoncrypto_cipher_mode (const std::string &name, Cipher_Dir direction) |
std::unique_ptr< HashFunction > | make_commoncrypto_hash (const std::string &name) |
Compression_Algorithm * | make_compressor (const std::string &name) |
Decompression_Algorithm * | make_decompressor (const std::string &name) |
boost::system::error_code | make_error_code (Botan::ErrorType e) |
constexpr uint16_t | make_uint16 (uint8_t i0, uint8_t i1) |
constexpr uint32_t | make_uint32 (uint8_t i0, uint8_t i1, uint8_t i2, uint8_t i3) |
constexpr 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 , class... Args> | |
stlCompatibilityDetails::_Unique_if< T >::_Known_bound | make_unique (Args &&...)=delete |
template<class T > | |
stlCompatibilityDetails::_Unique_if< T >::_Unknown_bound | make_unique (size_t n) |
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) |
secure_vector< uint8_t > | mceliece_decrypt (secure_vector< gf2m > &error_pos, const uint8_t *ciphertext, size_t ciphertext_len, 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) |
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_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) |
size_t | miller_rabin_test_iterations (size_t n_bits, size_t prob, bool random) |
BigInt | monty_execute (const Montgomery_Exponentation_State &precomputed_state, const BigInt &k, size_t max_k_bits) |
BigInt | monty_execute_vartime (const Montgomery_Exponentation_State &precomputed_state, const BigInt &k) |
word | monty_inverse (word a) |
BigInt | monty_multi_exp (std::shared_ptr< const Montgomery_Params > params_p, const BigInt &x_bn, const BigInt &z1, const BigInt &y_bn, const BigInt &z2) |
std::shared_ptr< const Montgomery_Exponentation_State > | monty_precompute (std::shared_ptr< const Montgomery_Params > params, const BigInt &g, size_t window_bits, bool const_time) |
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_keygen (uint8_t send[NEWHOPE_SENDABYTES], newhope_poly *sk, RandomNumberGenerator &rng, Newhope_Mode=Newhope_Mode::SHA3) |
void | newhope_shareda (uint8_t sharedkey[], const poly *sk, const uint8_t received[], Newhope_Mode mode) |
void | newhope_shareda (uint8_t sharedkey[NEWHOPE_SHARED_KEY_BYTES], const newhope_poly *ska, const uint8_t *received, Newhope_Mode mode=Newhope_Mode::SHA3) |
void | newhope_sharedb (uint8_t *sharedkey, uint8_t *send, const uint8_t *received, RandomNumberGenerator &rng, Newhope_Mode mode) |
void | newhope_sharedb (uint8_t sharedkey[NEWHOPE_SHARED_KEY_BYTES], uint8_t send[], const uint8_t *received, RandomNumberGenerator &rng, Newhope_Mode mode=Newhope_Mode::SHA3) |
secure_vector< uint8_t > | nist_key_unwrap (const uint8_t input[], size_t input_len, const BlockCipher &bc) |
secure_vector< uint8_t > | nist_key_unwrap_padded (const uint8_t input[], size_t input_len, const BlockCipher &bc) |
std::vector< uint8_t > | nist_key_wrap (const uint8_t input[], size_t input_len, const BlockCipher &bc) |
std::vector< uint8_t > | nist_key_wrap_padded (const uint8_t input[], size_t input_len, const BlockCipher &bc) |
BigInt | normalized_montgomery_inverse (const BigInt &a, const BigInt &p) |
secure_vector< uint8_t > | oaep_find_delim (uint8_t &valid_mask, const uint8_t input[], size_t input_len, const secure_vector< uint8_t > &Phash) |
bool | operator!= (const AlgorithmIdentifier &a1, const AlgorithmIdentifier &a2) |
bool | operator!= (const ASN1_Time &, const ASN1_Time &) |
bool | operator!= (const BigInt &a, const BigInt &b) |
bool | operator!= (const BigInt &a, word b) |
bool | operator!= (const CRL_Entry &a1, const CRL_Entry &a2) |
bool | operator!= (const CurveGFp &lhs, const CurveGFp &rhs) |
bool | operator!= (const EC_Group &lhs, const EC_Group &rhs) |
bool | operator!= (const OctetString &s1, const OctetString &s2) |
bool | operator!= (const OID &a, const OID &b) |
bool | operator!= (const PointGFp &lhs, const PointGFp &rhs) |
template<typename T , typename U > | |
bool | operator!= (const secure_allocator< T > &, const secure_allocator< U > &) |
bool | operator!= (const X509_Certificate &cert1, const X509_Certificate &cert2) |
bool | operator!= (const X509_DN &dn1, const X509_DN &dn2) |
BigInt | operator% (const BigInt &n, const BigInt &mod) |
word | operator% (const BigInt &n, word mod) |
ECIES_Flags | operator& (ECIES_Flags a, ECIES_Flags b) |
PointGFp | operator* (const BigInt &scalar, const PointGFp &point) |
BigInt | operator* (const BigInt &x, const BigInt &y) |
BigInt | operator* (const BigInt &x, word y) |
donna128 | operator* (const donna128 &x, uint64_t y) |
PointGFp | operator* (const PointGFp &point, const BigInt &scalar) |
donna128 | operator* (uint64_t y, const donna128 &x) |
BigInt | operator* (word x, const BigInt &y) |
BigInt | operator+ (const BigInt &x, const BigInt &y) |
BigInt | operator+ (const BigInt &x, word y) |
donna128 | operator+ (const donna128 &x, const donna128 &y) |
donna128 | operator+ (const donna128 &x, uint64_t y) |
OctetString | operator+ (const OctetString &k1, const OctetString &k2) |
OID | operator+ (const OID &oid, uint32_t new_comp) |
PointGFp | operator+ (const PointGFp &lhs, const PointGFp &rhs) |
BigInt | operator+ (word x, const BigInt &y) |
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) |
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) |
BigInt | operator- (const BigInt &x, const BigInt &y) |
BigInt | operator- (const BigInt &x, word y) |
PointGFp | operator- (const PointGFp &lhs) |
PointGFp | operator- (const PointGFp &lhs, const PointGFp &rhs) |
BigInt | operator/ (const BigInt &x, const BigInt &y) |
BigInt | operator/ (const BigInt &x, word y) |
bool | operator< (const ASN1_Time &, const ASN1_Time &) |
bool | operator< (const BigInt &a, const BigInt &b) |
bool | operator< (const BigInt &a, word b) |
bool | operator< (const OID &a, const OID &b) |
bool | operator< (const X509_DN &dn1, const X509_DN &dn2) |
BigInt | operator<< (const BigInt &x, size_t shift) |
int | operator<< (int fd, Pipe &pipe) |
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) |
std::ostream & | operator<< (std::ostream &out, Pipe &pipe) |
std::ostream & | operator<< (std::ostream &stream, const BigInt &n) |
bool | operator<= (const ASN1_Time &, const ASN1_Time &) |
bool | operator<= (const BigInt &a, const BigInt &b) |
bool | operator<= (const BigInt &a, word b) |
bool | operator== (const AlgorithmIdentifier &a1, const AlgorithmIdentifier &a2) |
bool | operator== (const ASN1_Time &, const ASN1_Time &) |
bool | operator== (const BigInt &a, const BigInt &b) |
bool | operator== (const BigInt &a, word b) |
bool | operator== (const CRL_Entry &a1, const CRL_Entry &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 ASN1_Time &, const ASN1_Time &) |
bool | operator> (const BigInt &a, const BigInt &b) |
bool | operator> (const BigInt &a, word b) |
bool | operator>= (const ASN1_Time &, const ASN1_Time &) |
bool | operator>= (const BigInt &a, const BigInt &b) |
bool | operator>= (const BigInt &a, word b) |
BigInt | operator>> (const BigInt &x, size_t shift) |
int | operator>> (int fd, Pipe &pipe) |
std::istream & | operator>> (std::istream &in, Pipe &pipe) |
std::istream & | operator>> (std::istream &in, X509_DN &dn) |
std::istream & | operator>> (std::istream &stream, BigInt &n) |
OctetString | operator^ (const OctetString &k1, const OctetString &k2) |
template<typename Alloc , typename Alloc2 > | |
std::vector< uint8_t, Alloc > & | operator^= (std::vector< uint8_t, Alloc > &out, const std::vector< uint8_t, Alloc2 > &in) |
donna128 | operator| (const donna128 &x, const donna128 &y) |
ECIES_Flags | operator| (ECIES_Flags a, ECIES_Flags b) |
template<typename Alloc > | |
PointGFp | OS2ECP (const std::vector< uint8_t, Alloc > &data, const CurveGFp &curve) |
std::pair< BigInt, BigInt > | OS2ECP (const uint8_t data[], size_t data_len, const BigInt &curve_p, const BigInt &curve_a, const BigInt &curve_b) |
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) |
bool | passes_miller_rabin_test (const BigInt &n, const Modular_Reducer &mod_n, const std::shared_ptr< Montgomery_Params > &monty_n, const BigInt &a) |
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 &password, const uint8_t salt[], size_t salt_len, size_t iterations, std::chrono::milliseconds msec) |
void | pbkdf2 (MessageAuthenticationCode &prf, uint8_t out[], size_t out_len, const uint8_t salt[], size_t salt_len, size_t iterations) |
std::vector< uint8_t > | pkcs_hash_id (const std::string &name) |
void | poly_double_n (uint8_t buf[], size_t n) |
void | poly_double_n (uint8_t out[], const uint8_t in[], size_t n) |
void | poly_double_n_le (uint8_t out[], const uint8_t in[], size_t n) |
bool | poly_double_supported_size (size_t n) |
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_p192 () |
const BigInt & | prime_p224 () |
const BigInt & | prime_p256 () |
const BigInt & | prime_p384 () |
const BigInt & | prime_p521 () |
std::vector< std::string > | probe_provider_private_key (const std::string &alg_name, const std::vector< std::string > possible) |
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 (uint16_t 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, size_t prob) |
BigInt | random_safe_prime (RandomNumberGenerator &rng, size_t bits) |
std::map< std::string, std::string > | read_cfg (std::istream &is) |
std::map< std::string, std::string > | read_kv (const std::string &kv) |
void | redc_mul (int64_t &s1, int64_t &s2, int64_t &s3, int64_t &s4, int64_t &s5, int64_t &s6, int64_t &X) |
void | redc_p192 (BigInt &x, secure_vector< word > &ws) |
void | redc_p224 (BigInt &x, secure_vector< word > &ws) |
void | redc_p256 (BigInt &x, secure_vector< word > &ws) |
void | redc_p384 (BigInt &x, secure_vector< word > &ws) |
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 | 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) |
size_t | RFC4880_decode_count (uint8_t iter) |
uint8_t | RFC4880_encode_count (size_t desired_iterations) |
size_t | RFC4880_round_iterations (size_t iterations) |
template<typename T > | |
T | rotate_left (T input, size_t rot) |
template<typename T > | |
T | rotate_right (T input, size_t rot) |
template<size_t ROT, typename T > | |
constexpr T | rotl (T input) |
template<typename T > | |
T | rotl_var (T input, size_t rot) |
template<size_t ROT, typename T > | |
constexpr T | rotr (T input) |
template<typename T > | |
T | rotr_var (T input, size_t rot) |
template<typename T > | |
constexpr 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) |
void | sc_muladd (uint8_t *, const uint8_t *, const uint8_t *, const uint8_t *) |
void | sc_reduce (uint8_t *) |
void | scrypt (uint8_t output[], size_t output_len, const char *password, size_t password_len, const uint8_t salt[], size_t salt_len, size_t N, size_t r, size_t p) |
void | scrypt (uint8_t output[], size_t output_len, const std::string &password, const uint8_t salt[], size_t salt_len, size_t N, size_t r, size_t p) |
size_t | scrypt_memory_usage (size_t N, size_t r, size_t p) |
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) |
template<typename K , typename V > | |
V | search_map (const std::map< K, V > &mapping, const K &key, const V &null_result=V()) |
void | secure_scrub_memory (void *ptr, size_t n) |
void | set_mem (uint8_t *ptr, size_t n, uint8_t val) |
void | SHA3_round (uint64_t T[25], const uint64_t A[25], uint64_t RC) |
const char * | short_version_cstr () |
std::string | short_version_string () |
bool | sig_algo_and_pad_ok (const std::string algo, const std::string padding) |
template<typename T > | |
size_t | significant_bytes (T n) |
std::vector< uint8_t > | sm2_compute_za (HashFunction &hash, const std::string &user_id, const EC_Group &domain, const PointGFp &pubkey) |
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 DL_Group &group, const std::string &hash_id, const std::vector< uint8_t > &salt, const BigInt &B, const size_t a_bits, RandomNumberGenerator &rng) |
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) |
template<typename T > | |
void | swap_bits (T &x, T &y, T mask, size_t shift) |
std::vector< polyn_gf2m > | syndrome_init (polyn_gf2m const &generator, std::vector< gf2m > const &support, int n) |
RandomNumberGenerator & | system_rng () |
void | throw_invalid_argument (const char *message, const char *func, const char *file) |
void | throw_invalid_state (const char *expr, const char *func, const char *file) |
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) |
std::string | to_string (ErrorType type) |
Convert an ErrorType to string. | |
uint32_t | to_u32bit (const std::string &str) |
uint16_t | to_uint16 (const std::string &str) |
std::string | tolower_string (const std::string &in) |
template<class To , class From > | |
To | typecast_copy (const From *src) noexcept |
template<typename T > | |
void | typecast_copy (T &out, const uint8_t in[]) |
template<typename T > | |
void | typecast_copy (T out[], const uint8_t in[], size_t N) |
template<typename T > | |
void | typecast_copy (uint8_t out[], T in) |
template<typename T > | |
void | typecast_copy (uint8_t out[], T in[], size_t N) |
std::string | ucs2_to_utf8 (const uint8_t ucs2[], size_t len) |
std::string | ucs4_to_utf8 (const uint8_t ucs4[], size_t len) |
template<typename T > | |
std::vector< T > | unlock (const secure_vector< T > &in) |
std::string | utf8_to_latin1 (const std::string &utf8) |
template<typename T > | |
bool | value_exists (const std::vector< T > &vec, const T &val) |
size_t | var_ctz32 (uint32_t n) |
void | vartime_divide (const BigInt &x, const BigInt &y_arg, BigInt &q_out, BigInt &r_out) |
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_add (word *w2, word *w1, word *w0, word x) |
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 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 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 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 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) |
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 , 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 Alloc > | |
void | xor_buf (std::vector< uint8_t, Alloc > &out, const uint8_t *in, size_t n) |
void | xor_buf (uint8_t out[], const uint8_t in[], const uint8_t in2[], size_t length) |
void | xor_buf (uint8_t out[], const uint8_t in[], size_t length) |
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 std::map< const std::string, std::vector< std::string > > | allowed_signature_paddings |
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 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 word | MP_WORD_MAX = ~static_cast<word>(0) |
const size_t | PRIME_TABLE_SIZE = 6541 |
const uint16_t | PRIMES [] |
const uint64_t | STREEBOG_Ax [8][256] |
const uint64_t | STREEBOG_C [12][8] |
(C) 2018,2019,2022 Jack Lloyd
Botan is released under the Simplified BSD License (see license.txt)
(C) 2018,2019 Jack Lloyd
Botan is released under the Simplified BSD License (see license.txt)
(C) 2022 Jack Lloyd
Botan is released under the Simplified BSD License (see license.txt)
(C) 2019 Jack Lloyd
Botan is released under the Simplified BSD License (see license.txt)
(C) 2018 Jack Lloyd (C) 2018 Ribose Inc
Botan is released under the Simplified BSD License (see license.txt)
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,2017 Matthias Gierlings
Botan is released under the Simplified BSD License (see license.txt)
typedef __vector unsigned int Botan::Altivec32x4 |
Definition at line 22 of file aes_power8.cpp.
typedef __vector unsigned long long Botan::Altivec64x2 |
Definition at line 21 of file aes_power8.cpp.
typedef __vector unsigned char Botan::Altivec8x16 |
Definition at line 23 of file aes_power8.cpp.
typedef BLAKE2b Botan::Blake2b |
using Botan::byte = typedef std::uint8_t |
typedef int32_t Botan::CCCryptorStatus |
Definition at line 23 of file commoncrypto.h.
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 394 of file ec_group.h.
Definition at line 134 of file ed25519_fe.h.
typedef uint16_t Botan::gf2m |
Definition at line 22 of file gf2m_small_m.h.
using Botan::InitializationVector = typedef OctetString |
using Botan::lock_guard_type = typedef lock_guard<T> |
typedef MessageAuthenticationCode Botan::MAC |
typedef noop_mutex Botan::mutex_type |
typedef PK_Key_Agreement_Key Botan::PK_KA_Key |
typedef Private_Key Botan::PKCS8_PrivateKey |
typedef newhope_poly Botan::poly |
Definition at line 25 of file newhope.cpp.
typedef RandomNumberGenerator Botan::RNG |
typedef PBKDF Botan::S2K |
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> > |
using Botan::SecureVector = typedef secure_vector<T> |
typedef SHA_160 Botan::SHA_1 |
using Botan::SymmetricKey = typedef OctetString |
using Botan::u16bit = typedef std::uint16_t |
using Botan::u32bit = typedef std::uint32_t |
using Botan::u64bit = typedef std::uint64_t |
typedef std::vector< secure_vector< uint8_t > > Botan::wots_keysig_t |
Definition at line 21 of file xmss_common_ops.h.
Definition at line 103 of file curve25519.h.
Definition at line 102 of file curve25519.h.
typedef Public_Key Botan::X509_PublicKey |
typedef ASN1_Time Botan::X509_Time |
Definition at line 386 of file asn1_obj.h.
anonymous enum |
Enumerator | |
---|---|
SM3_BLOCK_BYTES | |
SM3_DIGEST_BYTES |
enum Botan::ASN1_Tag : uint32_t |
ASN.1 Type and Class Tags This will become an enum class in a future major release
Definition at line 25 of file asn1_obj.h.
|
strong |
Certificate validation status code
Definition at line 17 of file pkix_enums.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 : int |
The two possible directions for cipher filters, determining whether they actually perform encryption or decryption.
Enumerator | |
---|---|
ENCRYPTION | |
DECRYPTION |
Definition at line 23 of file cipher_mode.h.
enum Botan::CRL_Code : uint32_t |
X.509v2 CRL Reason Code. This will become an enum class in a future major release
Definition at line 123 of file pkix_enums.h.
|
strong |
Enumerator | |
---|---|
Builtin | |
RandomlyGenerated | |
ExternalSource |
Definition at line 18 of file dl_group.h.
This class represents elliptic curce domain parameters
Enumerator | |
---|---|
EC_DOMPAR_ENC_EXPLICIT | |
EC_DOMPAR_ENC_IMPLICITCA | |
EC_DOMPAR_ENC_OID |
Definition at line 23 of file ec_group.h.
|
strong |
Enumerator | |
---|---|
Builtin | |
ExternalSource |
Definition at line 29 of file ec_group.h.
|
strong |
Definition at line 27 of file ecies.h.
|
strong |
Different types of errors that might occur
Enumerator | |
---|---|
Unknown | Some unknown error |
SystemError | An error while calling a system interface |
NotImplemented | An operation seems valid, but not supported by the current version |
OutOfMemory | Memory allocation failure |
InternalError | An internal error occurred |
IoError | An I/O error occurred |
InvalidObjectState | Invalid object state |
KeyNotSet | A key was not set on an object when this is required |
InvalidArgument | The application provided an argument which is invalid |
InvalidKeyLength | A key with invalid length was provided |
InvalidNonceLength | A nonce with invalid length was provided |
LookupError | An object type was requested but cannot be found |
EncodingFailure | Encoding a message or datum failed |
DecodingFailure | Decoding a message or datum failed |
TLSError | A TLS error (error_code will be the alert type) |
HttpError | An error during an HTTP operation |
InvalidTag | A message with an invalid authentication tag was detected |
RoughtimeError | An error during Roughtime validation |
OpenSSLError | An error when calling OpenSSL |
CommonCryptoError | An error when interacting with CommonCrypto API |
Pkcs11Error | An error when interacting with a PKCS11 device |
TPMError | An error when interacting with a TPM device |
DatabaseError | An error when interacting with a database |
ZlibError | An error when interacting with zlib |
Bzip2Error | An error when interacting with bzip2 |
LzmaError | An error when interacting with lzma |
Definition at line 20 of file exceptn.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 106 of file pkix_enums.h.
|
strong |
This chooses the XOF + hash for NewHope The official NewHope specification and reference implementation use SHA-3 and SHAKE-128. BoringSSL instead uses SHA-256 and AES-128 in CTR mode. CECPQ1 (x25519+NewHope) always uses BoringSSL's mode
Enumerator | |
---|---|
SHA3 | |
BoringSSL |
Definition at line 35 of file newhope.h.
|
strong |
|
strong |
Enumerator | |
---|---|
UNSPECIFIED | |
TLS_SERVER_AUTH | |
TLS_CLIENT_AUTH | |
CERTIFICATE_AUTHORITY | |
OCSP_RESPONDER | |
ENCRYPTION |
Definition at line 22 of file x509cert.h.
enum Botan::X509_Encoding |
The two types of X509 encoding supported by Botan. This enum is not used anymore, and will be removed in a future major release.
Enumerator | |
---|---|
RAW_BER | |
PEM |
Definition at line 25 of file x509_key.h.
Return the absolute value
n | an integer |
Definition at line 58 of file numthry.h.
References Botan::BigInt::abs().
Referenced by gcd().
BOTAN_MALLOC_FN void * Botan::allocate_memory | ( | size_t | elems, |
size_t | elem_size | ||
) |
Allocate a memory buffer by some method. This should only be used for primitive types (uint8_t, uint32_t, etc).
elems | the number of elements |
elem_size | the size of each element |
Definition at line 18 of file mem_ops.cpp.
References Botan::mlock_allocator::instance().
Referenced by Botan::secure_allocator< T >::allocate().
Return a^-1 * 2^k mod b Returns k, between n and 2n Not const time
Definition at line 27 of file mod_inv.cpp.
References Botan::BigInt::is_even().
Referenced by normalized_montgomery_inverse().
void 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 17 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::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 73 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().
void Botan::argon2 | ( | uint8_t | output[], |
size_t | output_len, | ||
const char * | password, | ||
size_t | password_len, | ||
const uint8_t | salt[], | ||
size_t | salt_len, | ||
const uint8_t | key[], | ||
size_t | key_len, | ||
const uint8_t | ad[], | ||
size_t | ad_len, | ||
uint8_t | y, | ||
size_t | p, | ||
size_t | M, | ||
size_t | t | ||
) |
Argon2 key derivation function
output | the output will be placed here |
output_len | length of output |
password | the user password |
password_len | the length of password |
salt | the salt |
salt_len | length of salt |
key | an optional secret key |
key_len | the length of key |
ad | an optional additional input |
ad_len | the length of ad |
y | the Argon2 variant (0 = Argon2d, 1 = Argon2i, 2 = Argon2id) |
p | the parallelization parameter |
M | the amount of memory to use in Kb |
t | the number of iterations to use |
Definition at line 370 of file argon2.cpp.
References BOTAN_ARG_CHECK, clear_mem(), Botan::HashFunction::create_or_throw(), and salt_len.
Referenced by argon2_check_pwhash(), argon2_generate_pwhash(), and Botan::Argon2::derive_key().
bool Botan::argon2_check_pwhash | ( | const char * | password, |
size_t | password_len, | ||
const std::string & | hash | ||
) |
Check a previously created password hash
password | the password to check against |
password_len | the length of password |
hash | the stored hash to check against |
Definition at line 57 of file argon2fmt.cpp.
References argon2(), base64_decode(), base64_decode_max_output(), constant_time_compare(), hash, split_on(), and to_u32bit().
std::string Botan::argon2_generate_pwhash | ( | const char * | password, |
size_t | password_len, | ||
RandomNumberGenerator & | rng, | ||
size_t | p, | ||
size_t | M, | ||
size_t | t, | ||
uint8_t | y = 2 , |
||
size_t | salt_len = 16 , |
||
size_t | output_len = 32 |
||
) |
Definition at line 26 of file argon2fmt.cpp.
References argon2(), base64_encode(), Botan::RandomNumberGenerator::randomize(), and salt_len.
std::string BOTAN_UNSTABLE_API Botan::asn1_class_to_string | ( | ASN1_Tag | type | ) |
Definition at line 87 of file asn1_obj.cpp.
References APPLICATION, CONSTRUCTED, CONTEXT_SPECIFIC, NO_OBJECT, type, and UNIVERSAL.
Referenced by Botan::BER_Object::assert_is_a().
std::string BOTAN_UNSTABLE_API Botan::asn1_tag_to_string | ( | ASN1_Tag | type | ) |
Definition at line 108 of file asn1_obj.cpp.
References BIT_STRING, BMP_STRING, BOOLEAN, ENUMERATED, GENERALIZED_TIME, IA5_STRING, INTEGER, NO_OBJECT, NULL_TAG, NUMERIC_STRING, OBJECT_ID, OCTET_STRING, PRINTABLE_STRING, SEQUENCE, SET, T61_STRING, type, UNIVERSAL_STRING, UTC_TIME, UTF8_STRING, and VISIBLE_STRING.
Referenced by Botan::BER_Object::assert_is_a().
BOTAN_NORETURN void Botan::assertion_failure | ( | const char * | expr_str, |
const char * | assertion_made, | ||
const char * | func, | ||
const char * | file, | ||
int | line | ||
) |
Called when an assertion fails Throws an Exception object
Definition at line 31 of file assert.cpp.
secure_vector< uint8_t > Botan::base32_decode | ( | const char | input[], |
size_t | input_length, | ||
bool | ignore_ws = true |
||
) |
Perform base32 decoding
input | some base32 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 220 of file base32.cpp.
secure_vector< uint8_t > Botan::base32_decode | ( | const std::string & | input, |
bool | ignore_ws = true |
||
) |
Perform base32 decoding
input | some base32 input |
ignore_ws | ignore whitespace on input; if false, throw an exception if whitespace is encountered |
Definition at line 227 of file base32.cpp.
References base32_decode().
size_t Botan::base32_decode | ( | uint8_t | output[], |
const char | input[], | ||
size_t | input_length, | ||
size_t & | input_consumed, | ||
bool | final_inputs, | ||
bool | ignore_ws = true |
||
) |
Perform base32 decoding
output | an array of at least base32_decode_max_output bytes |
input | some base32 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 195 of file base32.cpp.
References base_decode().
Referenced by base32_decode(), and base32_decode().
size_t Botan::base32_decode | ( | uint8_t | output[], |
const char | input[], | ||
size_t | input_length, | ||
bool | ignore_ws = true |
||
) |
Perform base32 decoding
output | an array of at least base32_decode_max_output bytes |
input | some base32 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 205 of file base32.cpp.
References base_decode_full().
size_t Botan::base32_decode | ( | uint8_t | output[], |
const std::string & | input, | ||
bool | ignore_ws = true |
||
) |
Perform base32 decoding
output | an array of at least base32_decode_max_output bytes |
input | some base32 input |
ignore_ws | ignore whitespace on input; if false, throw an exception if whitespace is encountered |
Definition at line 213 of file base32.cpp.
References base32_decode().
size_t Botan::base32_encode | ( | char | output[], |
const uint8_t | input[], | ||
size_t | input_length, | ||
size_t & | input_consumed, | ||
bool | final_inputs | ||
) |
Perform base32 encoding
output | an array of at least base32_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 180 of file base32.cpp.
References base_encode().
Referenced by base32_encode().
std::string Botan::base32_encode | ( | const std::vector< uint8_t, Alloc > & | input | ) |
Perform base32 encoding
input | some input |
Definition at line 50 of file base32.h.
References base32_encode().
std::string Botan::base32_encode | ( | const uint8_t | input[], |
size_t | input_length | ||
) |
Perform base32 encoding
input | some input |
input_length | length of input in bytes |
Definition at line 189 of file base32.cpp.
References base_encode_to_string().
std::vector< uint8_t > Botan::base58_check_decode | ( | const char | input[], |
size_t | input_length | ||
) |
Perform base58 decoding with checksum
Definition at line 171 of file base58.cpp.
References base58_decode(), and load_be< uint32_t >().
Referenced by base58_check_decode().
|
inline |
Definition at line 69 of file base58.h.
References base58_check_decode().
|
inline |
Definition at line 59 of file base58.h.
References base58_check_encode().
std::string Botan::base58_check_encode | ( | const uint8_t | input[], |
size_t | input_length | ||
) |
Perform base58 encoding with checksum
Definition at line 136 of file base58.cpp.
References base58_encode().
Referenced by base58_check_encode().
std::vector< uint8_t > Botan::base58_decode | ( | const char | input[], |
size_t | input_length | ||
) |
Perform base58 decoding
This is raw base58 encoding, without the checksum
Definition at line 144 of file base58.cpp.
References Botan::BigInt::binary_encode(), and Botan::BigInt::bytes().
Referenced by base58_check_decode(), and base58_decode().
|
inline |
Definition at line 64 of file base58.h.
References base58_decode().
|
inline |
Definition at line 53 of file base58.h.
References base58_encode().
std::string Botan::base58_encode | ( | const uint8_t | input[], |
size_t | input_length | ||
) |
Perform base58 encoding
This is raw base58 encoding, without the checksum
Definition at line 130 of file base58.cpp.
References base58_encode().
Referenced by base58_check_encode(), base58_encode(), and base58_encode().
secure_vector< uint8_t > 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 225 of file base64.cpp.
secure_vector< uint8_t > 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 232 of file base64.cpp.
References base64_decode().
size_t 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 200 of file base64.cpp.
References base_decode().
Referenced by argon2_check_pwhash(), base64_decode(), base64_decode(), botan_base64_decode(), Botan::Roughtime::Chain::Chain(), check_passhash9(), Botan::PEM_Code::decode(), Botan::Base64_Decoder::end_msg(), Botan::Encrypted_PSK_Database::get(), Botan::Encrypted_PSK_Database::list_names(), Botan::Roughtime::servers_from_str(), and Botan::Base64_Decoder::write().
size_t 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 210 of file base64.cpp.
References base_decode_full().
size_t 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 218 of file base64.cpp.
References base64_decode().
size_t 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 243 of file base64.cpp.
Referenced by argon2_check_pwhash(), and botan_base64_decode().
size_t 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 185 of file base64.cpp.
References base_encode().
Referenced by argon2_generate_pwhash(), Botan::OCSP::Request::base64_encode(), base64_encode(), botan_base64_encode(), Botan::PEM_Code::encode(), generate_passhash9(), Botan::Encrypted_PSK_Database::get(), Botan::Encrypted_PSK_Database::remove(), Botan::Encrypted_PSK_Database::set(), and Botan::Roughtime::Chain::to_string().
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::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 194 of file base64.cpp.
References base_encode_to_string().
size_t 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 238 of file base64.cpp.
size_t Botan::base_decode | ( | Base && | base, |
uint8_t | output[], | ||
const char | input[], | ||
size_t | input_length, | ||
size_t & | input_consumed, | ||
bool | final_inputs, | ||
bool | ignore_ws = true |
||
) |
Perform decoding using the base provided
base | object giving access to the encodings specifications |
output | an array of at least Base::decode_max_output bytes |
input | some base 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 124 of file codec_base.h.
References clear_mem().
Referenced by base32_decode(), base64_decode(), and base_decode_full().
size_t Botan::base_decode_full | ( | Base && | base, |
uint8_t | output[], | ||
const char | input[], | ||
size_t | input_length, | ||
bool | ignore_ws | ||
) |
Definition at line 189 of file codec_base.h.
References base_decode().
Referenced by base32_decode(), base64_decode(), and base_decode_to_vec().
Vector Botan::base_decode_to_vec | ( | Base && | base, |
const char | input[], | ||
size_t | input_length, | ||
bool | ignore_ws | ||
) |
Definition at line 203 of file codec_base.h.
References base_decode_full().
size_t Botan::base_encode | ( | Base && | base, |
char | output[], | ||
const uint8_t | input[], | ||
size_t | input_length, | ||
size_t & | input_consumed, | ||
bool | final_inputs | ||
) |
Perform encoding using the base provided
base | object giving access to the encodings specifications |
output | an array of at least base.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 34 of file codec_base.h.
Referenced by base32_encode(), base64_encode(), and base_encode_to_string().
std::string Botan::base_encode_to_string | ( | Base && | base, |
const uint8_t | input[], | ||
size_t | input_length | ||
) |
Definition at line 86 of file codec_base.h.
References base_encode(), and BOTAN_ASSERT_EQUAL.
Referenced by base32_encode(), and base64_encode().
void BOTAN_UNSTABLE_API Botan::bcrypt_pbkdf | ( | uint8_t | output[], |
size_t | output_len, | ||
const char * | pass, | ||
size_t | pass_len, | ||
const uint8_t | salt[], | ||
size_t | salt_len, | ||
size_t | rounds | ||
) |
Bcrypt PBKDF compatible with OpenBSD bcrypt_pbkdf
Definition at line 130 of file bcrypt_pbkdf.cpp.
References BOTAN_ARG_CHECK, clear_mem(), Botan::HashFunction::create_or_throw(), and salt_len.
Referenced by Botan::Bcrypt_PBKDF::derive_key(), and Botan::Bcrypt_PBKDF_Family::tune().
|
inline |
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 280 of file mp_core.h.
References bigint_add2_nc().
Referenced by Botan::BigInt::add(), and mul_add().
|
inline |
Two operand addition with carry out
Definition at line 227 of file mp_core.h.
References BOTAN_ASSERT, carry(), word8_add2(), and word_add().
Referenced by bigint_add2().
|
inline |
Three operand addition
Definition at line 289 of file mp_core.h.
References bigint_add3_nc().
Referenced by Botan::BigInt::add2().
|
inline |
Three operand addition with carry out
Definition at line 250 of file mp_core.h.
References bigint_add3_nc(), carry(), word8_add3(), and word_add().
Referenced by bigint_add3(), bigint_add3_nc(), Botan::BigInt::mod_add(), and redc_p521().
|
inline |
Compare x and y Return -1 if x < y Return 0 if x == y Return 1 if x > y
Definition at line 525 of file mp_core.h.
References BOTAN_DEBUG_ASSERT, Botan::CT::Mask< T >::is_equal(), Botan::CT::Mask< T >::is_lt(), Botan::CT::Mask< T >::is_zero(), and Botan::CT::unpoison().
Referenced by Botan::BigInt::add(), bigint_sub_abs(), Botan::BigInt::cmp(), and Botan::BigInt::cmp_word().
|
inline |
Definition at line 212 of file mp_core.h.
References carry(), Botan::CT::Mask< T >::expand(), and word_add().
|
inline |
Definition at line 79 of file mp_core.h.
References bigint_cnd_add().
|
inline |
Definition at line 42 of file mp_core.h.
References BOTAN_ASSERT, carry(), Botan::CT::Mask< T >::expand(), word8_add3(), and word_add().
Referenced by bigint_cnd_add(), Botan::BigInt::ct_cond_add(), redc_p192(), redc_p224(), redc_p256(), and redc_p384().
|
inline |
Definition at line 139 of file mp_core.h.
References carry(), Botan::CT::Mask< T >::select(), word8_add3(), word8_sub3(), word_add(), and word_sub().
|
inline |
Definition at line 176 of file mp_core.h.
References carry(), Botan::CT::Mask< T >::select(), word8_add3(), word8_sub3(), word_add(), and word_sub().
Referenced by bigint_mod_sub(), and bigint_mod_sub_n().
|
inline |
Definition at line 126 of file mp_core.h.
References bigint_cnd_sub().
|
inline |
Definition at line 88 of file mp_core.h.
References BOTAN_ASSERT, carry(), Botan::CT::Mask< T >::expand(), word8_sub3(), and word_sub().
Referenced by bigint_cnd_sub(), and redc_p521().
|
inline |
Definition at line 29 of file mp_core.h.
References Botan::CT::Mask< T >::expand().
Referenced by Botan::BigInt::ct_cond_swap().
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_mul24 | ( | word | z[48], |
const word | x[24], | ||
const word | y[24] | ||
) |
Definition at line 1535 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_sqr24 | ( | word | z[48], |
const word | x[24] | ||
) |
Definition at line 1132 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().
|
inline |
Definition at line 613 of file mp_core.h.
References Botan::CT::Mask< T >::is_zero().
Referenced by Botan::BigInt::is_equal().
|
inline |
Compare x and y Return ~0 if x[0:x_size] < y[0:y_size] or 0 otherwise If lt_or_equal is true, returns ~0 also for x == y
Definition at line 576 of file mp_core.h.
References Botan::CT::Mask< T >::expand(), Botan::CT::Mask< T >::is_equal(), Botan::CT::Mask< T >::is_lt(), and Botan::CT::Mask< T >::is_zero().
Referenced by bigint_mod_sub(), bigint_mod_sub_n(), and Botan::BigInt::is_less_than().
|
inline |
Compute ((n1<<bits) + n0) / d
Definition at line 721 of file mp_core.h.
Referenced by bigint_modop(), and vartime_divide().
|
inline |
Definition at line 489 of file mp_core.h.
References carry(), word8_linmul2(), and word_madd2().
Referenced by Botan::BigInt::mul(), and Botan::BigInt::operator*=().
|
inline |
Definition at line 504 of file mp_core.h.
References carry(), word8_linmul3(), and word_madd2().
Referenced by bigint_mul(), bigint_sqr(), Botan::BigInt::mul(), operator*(), and operator*().
|
inline |
Set t to t-s modulo mod
t | first integer |
s | second integer |
mod | the modulus |
mod_sw | size of t, s, and mod |
ws | workspace of size mod_sw |
Definition at line 687 of file mp_core.h.
References bigint_cnd_addsub(), bigint_ct_is_lt(), bigint_sub3(), BOTAN_DEBUG_ASSERT, BOTAN_UNUSED, and carry().
Referenced by Botan::BigInt::mod_sub().
|
inline |
Definition at line 703 of file mp_core.h.
References bigint_cnd_addsub(), bigint_ct_is_lt(), bigint_sub3(), BOTAN_DEBUG_ASSERT, BOTAN_UNUSED, and carry().
|
inline |
Compute ((n1<<bits) + n0) % d
Definition at line 755 of file mp_core.h.
References bigint_divop(), and word_madd2().
Referenced by operator%(), and Botan::BigInt::operator%=().
void Botan::bigint_monty_redc | ( | word | z[], |
const word | p[], | ||
size_t | p_size, | ||
word | p_dash, | ||
word | workspace[], | ||
size_t | ws_size | ||
) |
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 |
ws_size | size of workspace in words |
Definition at line 109 of file mp_monty.cpp.
References bigint_monty_redc_16(), bigint_monty_redc_24(), bigint_monty_redc_32(), bigint_monty_redc_4(), bigint_monty_redc_6(), bigint_monty_redc_8(), and BOTAN_ARG_CHECK.
Referenced by Botan::Montgomery_Params::mul(), Botan::Montgomery_Params::mul(), Botan::Montgomery_Params::mul_by(), Botan::Montgomery_Params::mul_by(), Botan::Montgomery_Params::redc(), Botan::Montgomery_Params::sqr(), and Botan::Montgomery_Params::square_this().
void Botan::bigint_monty_redc_16 | ( | word | z[], |
const word | p[16], | ||
word | p_dash, | ||
word | ws[] | ||
) |
Definition at line 293 of file mp_monty_n.cpp.
References bigint_sub3(), clear_mem(), Botan::CT::conditional_copy_mem(), word3_add(), and word3_muladd().
void Botan::bigint_monty_redc_16 | ( | word | z[], |
const word | p[], | ||
word | p_dash, | ||
word | ws[] | ||
) |
Referenced by bigint_monty_redc().
void Botan::bigint_monty_redc_24 | ( | word | z[], |
const word | p[24], | ||
word | p_dash, | ||
word | ws[] | ||
) |
Definition at line 656 of file mp_monty_n.cpp.
References bigint_sub3(), clear_mem(), Botan::CT::conditional_copy_mem(), word3_add(), and word3_muladd().
void Botan::bigint_monty_redc_24 | ( | word | z[], |
const word | p[], | ||
word | p_dash, | ||
word | ws[] | ||
) |
Referenced by bigint_monty_redc().
void Botan::bigint_monty_redc_32 | ( | word | z[], |
const word | p[32], | ||
word | p_dash, | ||
word | ws[] | ||
) |
Definition at line 1387 of file mp_monty_n.cpp.
References bigint_sub3(), clear_mem(), Botan::CT::conditional_copy_mem(), word3_add(), and word3_muladd().
void Botan::bigint_monty_redc_32 | ( | word | z[], |
const word | p[], | ||
word | p_dash, | ||
word | ws[] | ||
) |
Referenced by bigint_monty_redc().
void Botan::bigint_monty_redc_4 | ( | word | z[], |
const word | p[4], | ||
word | p_dash, | ||
word | ws[] | ||
) |
Definition at line 15 of file mp_monty_n.cpp.
References clear_mem(), Botan::CT::conditional_copy_mem(), word3_add(), word3_muladd(), and word_sub().
void Botan::bigint_monty_redc_4 | ( | word | z[], |
const word | p[], | ||
word | p_dash, | ||
word | ws[] | ||
) |
Referenced by bigint_monty_redc().
void Botan::bigint_monty_redc_6 | ( | word | z[], |
const word | p[6], | ||
word | p_dash, | ||
word | ws[] | ||
) |
Definition at line 71 of file mp_monty_n.cpp.
References clear_mem(), Botan::CT::conditional_copy_mem(), word3_add(), word3_muladd(), and word_sub().
void Botan::bigint_monty_redc_6 | ( | word | z[], |
const word | p[], | ||
word | p_dash, | ||
word | ws[] | ||
) |
Referenced by bigint_monty_redc().
void Botan::bigint_monty_redc_8 | ( | word | z[], |
const word | p[8], | ||
word | p_dash, | ||
word | ws[] | ||
) |
Definition at line 161 of file mp_monty_n.cpp.
References clear_mem(), Botan::CT::conditional_copy_mem(), word3_add(), word3_muladd(), and word_sub().
void Botan::bigint_monty_redc_8 | ( | word | z[], |
const word | p[], | ||
word | p_dash, | ||
word | ws[] | ||
) |
Referenced by bigint_monty_redc().
void Botan::bigint_mul | ( | word | z[], |
size_t | z_size, | ||
const word | x[], | ||
size_t | x_size, | ||
size_t | x_sw, | ||
const word | y[], | ||
size_t | y_size, | ||
size_t | y_sw, | ||
word | workspace[], | ||
size_t | ws_size | ||
) |
Definition at line 298 of file mp_karat.cpp.
References bigint_comba_mul16(), bigint_comba_mul24(), bigint_comba_mul4(), bigint_comba_mul6(), bigint_comba_mul8(), bigint_comba_mul9(), bigint_linmul3(), and clear_mem().
Referenced by Botan::Montgomery_Params::mul(), Botan::Montgomery_Params::mul(), Botan::BigInt::mul(), mul_add(), Botan::Montgomery_Params::mul_by(), Botan::Montgomery_Params::mul_by(), and operator*().
|
inline |
Definition at line 409 of file mp_core.h.
References carry(), carry_shift(), clear_mem(), copy_mem(), and Botan::CT::Mask< T >::expand().
Referenced by Botan::BigInt::operator<<=().
|
inline |
Definition at line 449 of file mp_core.h.
References carry(), carry_shift(), copy_mem(), and Botan::CT::Mask< T >::expand().
Referenced by operator<<().
|
inline |
Definition at line 427 of file mp_core.h.
References carry(), carry_shift(), clear_mem(), copy_mem(), and Botan::CT::Mask< T >::expand().
Referenced by Botan::BigInt::operator>>=().
|
inline |
Definition at line 466 of file mp_core.h.
References carry(), carry_shift(), copy_mem(), and Botan::CT::Mask< T >::expand().
Referenced by operator>>(), and redc_p521().
void Botan::bigint_sqr | ( | word | z[], |
size_t | z_size, | ||
const word | x[], | ||
size_t | x_size, | ||
size_t | x_sw, | ||
word | workspace[], | ||
size_t | ws_size | ||
) |
Definition at line 357 of file mp_karat.cpp.
References bigint_comba_sqr16(), bigint_comba_sqr24(), bigint_comba_sqr4(), bigint_comba_sqr6(), bigint_comba_sqr8(), bigint_comba_sqr9(), bigint_linmul3(), BOTAN_ASSERT, and clear_mem().
Referenced by Botan::Montgomery_Params::sqr(), Botan::BigInt::square(), and Botan::Montgomery_Params::square_this().
|
inline |
Two operand subtraction
Definition at line 300 of file mp_core.h.
References BOTAN_ASSERT, word8_sub2(), and word_sub().
Referenced by Botan::BigInt::add(), redc_p192(), redc_p224(), redc_p256(), and redc_p384().
|
inline |
Two operand subtraction, x = y - x; assumes y >= x
Definition at line 324 of file mp_core.h.
References BOTAN_ASSERT, word8_sub2_rev(), and word_sub().
Referenced by Botan::BigInt::add().
|
inline |
Three operand subtraction
Definition at line 342 of file mp_core.h.
References BOTAN_ASSERT, word8_sub3(), and word_sub().
Referenced by bigint_mod_sub(), bigint_mod_sub_n(), bigint_monty_redc_16(), bigint_monty_redc_24(), bigint_monty_redc_32(), bigint_sub_abs(), ct_divide(), ct_modulo(), Botan::BigInt::ct_reduce_below(), Botan::BigInt::mod_add(), and Botan::BigInt::reduce_below().
|
inline |
Return abs(x-y), ie if x >= y, then compute z = x - y Otherwise compute z = y - x No borrow is possible since the result is always >= 0
Returns ~0 if x >= y or 0 if x < y
z | output array of at least N words |
x | input array of N words |
y | input array of N words |
N | length of x and y |
ws | array of at least 2*N words |
Definition at line 377 of file mp_core.h.
References Botan::CT::conditional_copy_mem(), word8_sub3(), and word_sub().
Referenced by Botan::BigInt::add2(), and Botan::BigInt::rev_sub().
|
inline |
Set z to abs(x-y), ie if x >= y, then compute z = x - y Otherwise compute z = y - x No borrow is possible since the result is always >= 0
Return the relative size of x vs y (-1, 0, 1)
z | output array of max(x_size,y_size) words |
x | input param |
x_size | length of x |
y | input param |
y_size | length of y |
Definition at line 654 of file mp_core.h.
References bigint_cmp(), bigint_sub3(), Botan::CT::conditional_swap(), and Botan::CT::conditional_swap_ptr().
|
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().
void Botan::blamka_ssse3 | ( | uint64_t | T[128] | ) |
Definition at line 231 of file argon2_ssse3.cpp.
References store_le(), and T.
|
inlinenoexcept |
Definition at line 112 of file asio_error.h.
Referenced by make_error_code().
Swap 4 Ts in an array
Definition at line 98 of file bswap.h.
References bswap_4(), and reverse_bytes().
Referenced by Botan::SIMD_4x32::bswap(), bswap_4(), load_be(), and load_le().
size_t Botan::buffer_insert | ( | std::vector< T, Alloc > & | buf, |
size_t | buf_offset, | ||
const std::vector< T, Alloc2 > & | input | ||
) |
Definition at line 243 of file mem_ops.h.
References BOTAN_ASSERT_NOMSG, and copy_mem().
size_t Botan::buffer_insert | ( | std::vector< T, Alloc > & | buf, |
size_t | buf_offset, | ||
const T | input[], | ||
size_t | input_length | ||
) |
Definition at line 228 of file mem_ops.h.
References BOTAN_ASSERT_NOMSG, and copy_mem().
Referenced by Botan::Streebog::add_data(), Botan::MDx_HashFunction::add_data(), Botan::EME_PKCS1v15::pad(), Botan::CTR_BE::seek(), Botan::CTR_BE::set_iv(), Botan::OFB::set_iv(), Botan::Hex_Encoder::write(), and Botan::Base64_Encoder::write().
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 111 of file calendar.cpp.
Referenced by Botan::ASN1_Time::ASN1_Time().
|
inline |
Definition at line 32 of file ed25519_internal.h.
Referenced by bigint_add2_nc(), bigint_add3_nc(), bigint_cnd_abs(), bigint_cnd_add(), bigint_cnd_add_or_sub(), bigint_cnd_addsub(), bigint_cnd_sub(), bigint_linmul2(), bigint_linmul3(), bigint_mod_sub(), bigint_mod_sub_n(), bigint_shl1(), bigint_shl2(), bigint_shr1(), bigint_shr2(), Botan::Streebog::compress_64(), ge_scalarmult_base(), Botan::BigInt::mul(), Botan::BigInt::operator*=(), Botan::donna128::operator+=(), Botan::donna128::operator+=(), redc_p521(), Botan::Sodium::sodium_add(), Botan::Sodium::sodium_increment(), word3_muladd(), word3_muladd_2(), word8_add2(), word8_add3(), word8_linmul2(), word8_linmul3(), word8_madd3(), word8_sub2(), word8_sub2_rev(), word8_sub3(), word_add(), word_madd2(), word_madd3(), and word_sub().
|
inline |
Definition at line 55 of file ed25519_internal.h.
|
inline |
Definition at line 44 of file ed25519_internal.h.
|
inline |
Definition at line 116 of file donna128.h.
Referenced by bigint_shl1(), bigint_shl2(), bigint_shr1(), and bigint_shr2().
|
inline |
|
inline |
Definition at line 190 of file mem_ops.h.
Referenced by Botan::DER_Encoder::add_object(), Botan::TLS::append_tls_length_value(), Botan::BigInt::BigInt(), botan_mp_set_from_radix_str(), Botan::CryptoBox::decrypt(), Botan::CryptoBox::decrypt_bin(), Botan::KDF::derive_key(), Botan::KDF::derive_key(), Botan::PK_Key_Agreement::derive_key(), Botan::PK_Key_Agreement::derive_key(), Botan::KDF::derive_key(), Botan::Encrypted_PSK_Database::get(), hkdf_expand_label(), Botan::Pipe::process_msg(), Botan::Encrypted_PSK_Database::remove(), scrypt(), Botan::TLS::Channel::send(), Botan::TLS::Server_Name_Indicator::serialize(), Botan::TLS::Application_Layer_Protocol_Notification::serialize(), Botan::Encrypted_PSK_Database::set(), Botan::PSK_Database::set_str(), Botan::PK_Signer::update(), Botan::PK_Verifier::update(), Botan::Buffered_Computation::update(), Botan::HTTP::url_encode(), Botan::Roughtime::Response::validate(), Botan::Pipe::write(), Botan_FFI::write_str_output(), Botan_FFI::write_str_output(), and Botan_FFI::write_str_output().
|
inline |
Definition at line 195 of file mem_ops.h.
Referenced by Botan::BigInt::decode(), Botan::CryptoBox::decrypt(), Botan::Base64_Decoder::end_msg(), Botan::Hex_Decoder::end_msg(), Botan::PSK_Database::get_str(), Botan::TLS::TLS_Data_Reader::get_string(), Botan::HTTP::http_sync(), Botan::Encrypted_PSK_Database::list_names(), Botan::HTTP::operator<<(), operator<<(), operator>>(), Botan::DataSource_Stream::peek(), Botan::DataSource_Stream::read(), Botan::Pipe::read_all_as_string(), Botan::ASN1::to_string(), Botan::Base64_Decoder::write(), Botan::DataSink_Stream::write(), and Botan::Hex_Decoder::write().
|
inline |
void Botan::CECPQ1_accept | ( | uint8_t * | shared_key, |
uint8_t * | accept_message, | ||
const uint8_t * | offer_message, | ||
RandomNumberGenerator & | rng | ||
) |
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 26 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::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 41 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 * | offer_message, |
CECPQ1_key * | offer_key_output, | ||
RandomNumberGenerator & | rng | ||
) |
void Botan::CECPQ1_offer | ( | uint8_t | send[CECPQ1_OFFER_BYTES], |
CECPQ1_key * | offer_key_output, | ||
RandomNumberGenerator & | rng | ||
) |
Definition at line 15 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().
Definition at line 119 of file bit_ops.h.
References T.
Referenced by Botan::McEliece_PublicKey::get_message_word_bit_length(), Botan::McEliece_PrivateKey::McEliece_PrivateKey(), Botan::McEliece_PrivateKey::McEliece_PrivateKey(), and mceliece_work_factor().
bool 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 155 of file bcrypt.cpp.
References hash, same_mem(), and to_uint16().
Referenced by botan_bcrypt_is_valid().
bool 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 78 of file passhash9.cpp.
References base64_decode(), Botan::OctetString::bits_of(), constant_time_compare(), Botan::PBKDF::derive_key(), hash, and load_be< uint16_t >().
|
inline |
Definition at line 202 of file numthry.h.
References is_prime().
|
inline |
Definition at line 26 of file safeint.h.
PK_Signer * Botan::choose_sig_format | ( | const Private_Key & | key, |
const std::map< std::string, std::string > & | opts, | ||
RandomNumberGenerator & | rng, | ||
const std::string & | hash_fn, | ||
AlgorithmIdentifier & | alg_id | ||
) |
* Choose the default signature format for a certain public key signature * scheme. * * The only option recognized by opts at this moment is "padding" * Find an entry from src/build-data/oids.txt under [signature] of the form * <sig_algo>/<padding>[(<hash_algo>)] and add {"padding",<padding>} * to opts. *
key | will be the key to choose a padding scheme for |
opts | contains additional options for building the certificate |
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 326 of file x509_ca.cpp.
References Botan::X509_Object::choose_sig_format().
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 318 of file x509_ca.cpp.
References Botan::X509_Object::choose_sig_format().
Referenced by Botan::X509::create_self_signed_cert(), Botan::X509_CA::X509_CA(), Botan::X509_CA::X509_CA(), and Botan::X509_Object::~X509_Object().
|
inline |
Clamp
Definition at line 45 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. Warning: use secure_scrub_memory instead if the memory is about to be freed or otherwise the compiler thinks it can elide the writes.
ptr | a pointer to memory to zero |
bytes | the number of bytes to zero in ptr |
Definition at line 97 of file mem_ops.h.
Referenced by clear_mem(), and Botan::Memory_Pool::Memory_Pool().
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 115 of file mem_ops.h.
References clear_bytes(), and T.
Referenced by aont_package(), argon2(), base_decode(), bcrypt_pbkdf(), bigint_monty_redc_16(), bigint_monty_redc_24(), bigint_monty_redc_32(), bigint_monty_redc_4(), bigint_monty_redc_6(), bigint_monty_redc_8(), bigint_mul(), bigint_shl1(), bigint_shr1(), bigint_sqr(), Botan::BigInt::const_time_lookup(), Botan::Sodium::crypto_secretbox_xsalsa20poly1305(), Botan::Sodium::crypto_secretbox_xsalsa20poly1305_open(), Botan::BigInt::ct_reduce_below(), Botan::ZFEC::encode_shares(), Botan::BigInt::encode_words(), Botan::FE_25519::FE_25519(), Botan::Streebog::final_result(), Botan::MDx_HashFunction::final_result(), hex_decode(), Botan::PKCS11::MechanismWrapper::MechanismParameters::MechanismParameters(), Botan::PointGFp_Var_Point_Precompute::mul(), pbkdf2(), redc_p521(), Botan::Modular_Reducer::reduce(), Botan::BigInt::reduce_below(), Botan::BigInt::rev_sub(), Botan::polyn_gf2m::set_to_zero(), Botan::polyn_gf2m::sqmod_init(), Botan::StreamCipher::write_keystream(), Botan_FFI::write_output(), zeroise(), Botan::Zlib_Style_Stream< Stream, ByteType >::Zlib_Style_Stream(), and Botan::Zlib_Style_Stream< Stream, ByteType >::~Zlib_Style_Stream().
|
inline |
Definition at line 121 of file donna128.h.
References Botan::donna128::lo().
void Botan::commoncrypto_adjust_key_size | ( | const uint8_t | key[], |
size_t | length, | ||
const CommonCryptor_Opts & | opts, | ||
secure_vector< uint8_t > & | full_key | ||
) |
Definition at line 162 of file commoncrypto_utils.cpp.
References Botan::CommonCryptor_Opts::algo, and copy_mem().
CommonCryptor_Opts Botan::commoncrypto_opts_from_algo | ( | const std::string & | algo | ) |
Definition at line 111 of file commoncrypto_utils.cpp.
References Botan::SCAN_Name::algo_name(), Botan::SCAN_Name::cipher_mode(), Botan::SCAN_Name::cipher_mode_pad(), commoncrypto_opts_from_algo_name(), Botan::CommonCryptor_Opts::mode, and Botan::CommonCryptor_Opts::padding.
Referenced by make_commoncrypto_cipher_mode().
CommonCryptor_Opts Botan::commoncrypto_opts_from_algo_name | ( | const std::string & | algo_name | ) |
Definition at line 51 of file commoncrypto_utils.cpp.
References Botan::CommonCryptor_Opts::algo, Botan::CommonCryptor_Opts::block_size, and Botan::CommonCryptor_Opts::key_spec.
Referenced by commoncrypto_opts_from_algo(), and make_commoncrypto_block_cipher().
|
inline |
Memory comparison, input insensitive
x | a pointer to an array |
y | a pointer to another array |
len | the number of Ts in x and y |
Definition at line 82 of file mem_ops.h.
References ct_compare_u8().
Referenced by argon2_check_pwhash(), botan_constant_time_compare(), check_passhash9(), Botan::Sodium::crypto_secretbox_open_detached(), Botan::Sodium::crypto_secretbox_xsalsa20poly1305_open(), Botan::CryptoBox::decrypt_bin(), ed25519_verify(), Botan::CCM_Decryption::finish(), Botan::ChaCha20Poly1305_Decryption::finish(), Botan::EAX_Decryption::finish(), Botan::GCM_Decryption::finish(), Botan::OCB_Decryption::finish(), Botan::SIV_Decryption::finish(), Botan::TLS::TLS_CBC_HMAC_AEAD_Decryption::finish(), Botan::RTSS_Share::reconstruct(), Botan::Sodium::sodium_memcmp(), Botan::TLS::Finished::verify(), and Botan::MessageAuthenticationCode::verify_mac().
Copy memory
out | the destination array |
in | the source array |
n | the number of elements of in/out |
Definition at line 133 of file mem_ops.h.
References BOTAN_ASSERT_IMPLICATION, and T.
Referenced by Botan::TLS::Connection_Cipher_State::aead_nonce(), Botan::TLS::Connection_Cipher_State::aead_nonce(), aont_package(), aont_unpackage(), bigint_shl1(), bigint_shl2(), bigint_shr1(), bigint_shr2(), botan_privkey_ed25519_get_privkey(), botan_privkey_x25519_get_privkey(), botan_pubkey_ed25519_get_pubkey(), botan_pubkey_x25519_get_pubkey(), buffer_insert(), buffer_insert(), commoncrypto_adjust_key_size(), Botan::Streebog::compress_64(), Botan::Sodium::crypto_auth_hmacsha512256(), Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_seed_keypair(), curve25519_donna(), ed25519_gen_keypair(), Botan::BigInt::encode(), Botan::BigInt::encode_words(), Botan::CryptoBox::encrypt(), Botan::FE_25519::FE_25519(), Botan::TLS::TLS_CBC_HMAC_AEAD_Encryption::finish(), Botan::TLS::Stream_Handshake_IO::format(), Botan::CCM_Mode::format_b0(), Botan::CCM_Mode::format_c0(), Botan::TPM_Context::gen_random(), Botan::BER_Decoder::get_next_value(), Botan::GHASH::ghash_update(), hkdf_expand_label(), Botan::HKDF_Extract::kdf(), Botan::HKDF_Expand::kdf(), Botan::KDF1::kdf(), Botan::KDF1_18033::kdf(), Botan::KDF2::kdf(), Botan::X942_PRF::kdf(), Botan::SP800_108_Counter::kdf(), Botan::SP800_108_Feedback::kdf(), Botan::SP800_108_Pipeline::kdf(), mceies_encrypt(), mceliece_decrypt(), Botan::Montgomery_Params::mul_by(), Botan::Montgomery_Params::mul_by(), nist_key_unwrap_padded(), nist_key_wrap_padded(), operator^(), Botan::PKCS5_PBKDF1::pbkdf(), Botan::DataSource_Memory::peek(), Botan::CBC_Decryption::process(), Botan::CFB_Encryption::process(), Botan::DataSource_Memory::read(), Botan::Blowfish::salted_set_key(), Botan::CTR_BE::seek(), Botan::TLS::Session_Keys::Session_Keys(), Botan::CFB_Mode::shift_register(), Botan::RTSS_Share::split(), Botan::polyn_gf2m::sqmod_init(), Botan::Montgomery_Params::square_this(), Botan::Buffered_Filter::write(), Botan::Hex_Encoder::write(), Botan::Base64_Encoder::write(), Botan::Base64_Decoder::write(), Botan::Hex_Decoder::write(), Botan::ChaCha::write_keystream(), and Botan_FFI::write_output().
Definition at line 658 of file loadstor.h.
References get_byte(), store_be(), and T.
Referenced by copy_out_vec_be().
Definition at line 679 of file loadstor.h.
References get_byte(), store_le(), and T.
Referenced by Botan::SHAKE_128_Cipher::cipher(), copy_out_vec_le(), and Botan::Sodium::crypto_core_hsalsa20().
void Botan::copy_out_vec_be | ( | uint8_t | out[], |
size_t | out_bytes, | ||
const std::vector< T, Alloc > & | in | ||
) |
Definition at line 673 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 694 of file loadstor.h.
References copy_out_le().
Referenced by Botan::SHA_3::expand().
AlternativeName Botan::create_alt_name | ( | const Data_Store & | info | ) |
Definition at line 186 of file datastor.cpp.
References Botan::AlternativeName::add_attribute(), and Botan::Data_Store::search_for().
X509_DN Botan::create_dn | ( | const Data_Store & | info | ) |
Definition at line 167 of file datastor.cpp.
References Botan::X509_DN::add_attribute(), and Botan::Data_Store::search_for().
std::string Botan::create_hex_fingerprint | ( | const std::vector< uint8_t, Alloc > & | vec, |
const std::string & | hash_name | ||
) |
Definition at line 320 of file pk_keys.h.
References create_hex_fingerprint().
std::string Botan::create_hex_fingerprint | ( | const uint8_t | bits[], |
size_t | bits_len, | ||
const std::string & | hash_name | ||
) |
Definition at line 17 of file pk_keys.cpp.
References Botan::HashFunction::create_or_throw(), and hex_encode().
Referenced by create_hex_fingerprint(), Botan::X509_Certificate::fingerprint(), Botan::Private_Key::fingerprint_private(), and Botan::Public_Key::fingerprint_public().
std::unique_ptr< Private_Key > Botan::create_private_key | ( | const std::string & | algo_name, |
RandomNumberGenerator & | rng, | ||
const std::string & | algo_params = "" , |
||
const std::string & | provider = "" |
||
) |
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 260 of file pk_algs.cpp.
References BOTAN_UNUSED, split_on(), and to_u32bit().
Referenced by botan_privkey_create().
uint8_t Botan::ct_compare_u8 | ( | const uint8_t | x[], |
const uint8_t | y[], | ||
size_t | len | ||
) |
Memory comparison, input insensitive
x | a pointer to an array |
y | a pointer to another array |
len | the number of Ts in x and y |
Definition at line 56 of file mem_ops.cpp.
References Botan::CT::Mask< T >::is_zero().
Referenced by constant_time_compare(), and oaep_find_delim().
BigInt division, const time variant
This runs with control flow independent of the values of x/y. Warning: the loop bounds still leak the sizes of x and y.
x | an integer |
y | a non-zero integer |
Definition at line 63 of file divide.h.
References ct_divide().
BigInt division, const time variant
This runs with control flow independent of the values of x/y. Warning: the loop bounds still leak the sizes of x and y.
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 52 of file divide.cpp.
References bigint_sub3(), Botan::BigInt::bits(), Botan::BigInt::conditionally_set_bit(), Botan::BigInt::ct_cond_swap(), Botan::BigInt::data(), Botan::BigInt::get_bit(), Botan::BigInt::mutable_data(), Botan::BigInt::Positive, Botan::BigInt::sig_words(), and Botan::BigInt::size().
Referenced by ct_divide(), Botan::FPE_FE1::decrypt(), divide(), Botan::FPE_FE1::encrypt(), lcm(), and Botan::Modular_Reducer::Modular_Reducer().
BigInt division, const time variant
This runs with control flow independent of the values of x/y. Warning: the loop bounds still leak the sizes of x and y.
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 82 of file divide.cpp.
References Botan::BigInt::bits(), Botan::BigInt::conditionally_set_bit(), Botan::BigInt::flip_sign(), Botan::BigInt::get_bit(), Botan::CT::Mask< T >::is_gte(), Botan::BigInt::is_negative(), Botan::BigInt::Positive, and Botan::BigInt::sig_words().
Referenced by operator/(), and Botan::BigInt::to_dec_string().
Deprecated modular inversion function. Use inverse_mod instead.
Definition at line 322 of file mod_inv.cpp.
BigInt modulo, const time variant
Using this function is (slightly) cheaper than calling ct_divide and using only the remainder.
x | a non-negative integer |
modulo | a positive integer |
Definition at line 118 of file divide.cpp.
References bigint_sub3(), Botan::BigInt::bits(), Botan::BigInt::conditionally_set_bit(), Botan::BigInt::ct_cond_swap(), Botan::BigInt::data(), Botan::BigInt::get_bit(), Botan::BigInt::is_negative(), Botan::BigInt::is_nonzero(), Botan::BigInt::is_zero(), Botan::BigInt::mutable_data(), Botan::BigInt::Positive, Botan::BigInt::sig_words(), and Botan::BigInt::size().
Referenced by Botan::RSA_PrivateKey::check_key(), inverse_mod(), Botan::Modular_Reducer::reduce(), Botan::RSA_PrivateKey::RSA_PrivateKey(), and Botan::RSA_PrivateKey::RSA_PrivateKey().
Count the trailing zero bits in n
n | an integer value |
Definition at line 99 of file bit_ops.h.
References ct_is_zero(), and T.
Referenced by low_zero_bits().
void 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 16 of file curve25519.cpp.
References curve25519_donna().
Referenced by CECPQ1_accept(), CECPQ1_offer(), Botan::Curve25519_PrivateKey::check_key(), Botan::Sodium::crypto_scalarmult_curve25519_base(), Botan::Curve25519_PrivateKey::Curve25519_PrivateKey(), Botan::Curve25519_PrivateKey::Curve25519_PrivateKey(), and Botan::Curve25519_PrivateKey::Curve25519_PrivateKey().
void Botan::curve25519_donna | ( | uint8_t | mypublic[32], |
const uint8_t | secret[32], | ||
const uint8_t | basepoint[32] | ||
) |
Definition at line 440 of file donna.cpp.
References copy_mem(), Botan::CT::poison(), and Botan::CT::unpoison().
Referenced by CECPQ1_accept(), CECPQ1_finish(), Botan::Sodium::crypto_scalarmult_curve25519(), and curve25519_basepoint().
void Botan::deallocate_memory | ( | void * | p, |
size_t | elems, | ||
size_t | elem_size | ||
) |
Free a pointer returned by allocate_memory
p | the pointer returned by allocate_memory |
elems | the number of elements, as passed to allocate_memory |
elem_size | the size of each element, as passed to allocate_memory |
Definition at line 34 of file mem_ops.cpp.
References Botan::mlock_allocator::instance(), and secure_scrub_memory().
Referenced by Botan::secure_allocator< T >::deallocate().
gf2m Botan::decode_gf2m | ( | const uint8_t * | mem | ) |
Definition at line 103 of file gf2m_small_m.cpp.
Referenced by Botan::polyn_gf2m::polyn_gf2m().
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 52 of file workfactor.cpp.
Referenced by Botan::DL_Group::DL_Group().
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 46 of file workfactor.cpp.
References if_work_factor().
|
inline |
|
inline |
Definition at line 385 of file point_gfp.h.
References Botan::PointGFp::encode().
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().
void Botan::ed25519_gen_keypair | ( | uint8_t * | pk, |
uint8_t * | sk, | ||
const uint8_t | seed[32] | ||
) |
Definition at line 18 of file ed25519.cpp.
References copy_mem(), Botan::Buffered_Computation::final(), ge_scalarmult_base(), and Botan::Buffered_Computation::update().
Referenced by Botan::Sodium::crypto_sign_ed25519_seed_keypair(), Botan::Ed25519_PrivateKey::Ed25519_PrivateKey(), Botan::Ed25519_PrivateKey::Ed25519_PrivateKey(), and Botan::Ed25519_PrivateKey::Ed25519_PrivateKey().
void Botan::ed25519_gen_keypair | ( | uint8_t | pk[32], |
uint8_t | sk[64], | ||
const uint8_t | seed[32] | ||
) |
void Botan::ed25519_sign | ( | uint8_t | sig[64], |
const uint8_t | m[], | ||
size_t | mlen, | ||
const uint8_t | sk[64], | ||
const uint8_t | domain_sep[], | ||
size_t | domain_sep_len | ||
) |
Definition at line 36 of file ed25519.cpp.
References Botan::Buffered_Computation::final(), ge_scalarmult_base(), sc_muladd(), sc_reduce(), and Botan::Buffered_Computation::update().
Referenced by Botan::Sodium::crypto_sign_ed25519_detached().
bool Botan::ed25519_verify | ( | const uint8_t * | m, |
size_t | mlen, | ||
const uint8_t | sig[64], | ||
const uint8_t * | pk, | ||
const uint8_t | domain_sep[], | ||
size_t | domain_sep_len | ||
) |
Definition at line 71 of file ed25519.cpp.
References constant_time_compare(), Botan::Buffered_Computation::final(), ge_double_scalarmult_vartime(), ge_frombytes_negate_vartime(), sc_reduce(), and Botan::Buffered_Computation::update().
Referenced by Botan::Sodium::crypto_sign_ed25519_verify_detached().
bool Botan::ed25519_verify | ( | const uint8_t | msg[], |
size_t | msg_len, | ||
const uint8_t | sig[64], | ||
const uint8_t | pk[32], | ||
const uint8_t | domain_sep[], | ||
size_t | domain_sep_len | ||
) |
uint32_t Botan::encode_gf2m | ( | gf2m | to_enc, |
uint8_t * | mem | ||
) |
Definition at line 96 of file gf2m_small_m.cpp.
std::string Botan::erase_chars | ( | const std::string & | str, |
const std::set< char > & | chars | ||
) |
Erase characters from a string
Definition at line 292 of file parsing.cpp.
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().
If top bit of arg is set, return ~0. Otherwise return 0.
Definition at line 23 of file bit_ops.h.
References T.
Referenced by Botan::CT::Mask< T >::is_any_of(), and Botan::CT::Mask< T >::is_within_range().
|
inline |
Definition at line 170 of file ed25519_fe.h.
|
inline |
Definition at line 175 of file ed25519_fe.h.
Referenced by ge_frombytes_negate_vartime().
Definition at line 180 of file ed25519_fe.h.
References Botan::FE_25519::add().
Referenced by ge_frombytes_negate_vartime().
Definition at line 154 of file ed25519_fe.h.
|
inline |
Definition at line 144 of file ed25519_fe.h.
References Botan::FE_25519::from_bytes().
Referenced by ge_frombytes_negate_vartime().
Definition at line 215 of file ed25519_fe.h.
References Botan::FE_25519::invert().
|
inline |
Definition at line 164 of file ed25519_fe.h.
References Botan::FE_25519::is_negative().
Referenced by ge_frombytes_negate_vartime().
|
inline |
Definition at line 159 of file ed25519_fe.h.
References Botan::FE_25519::is_zero().
Referenced by ge_frombytes_negate_vartime().
Definition at line 195 of file ed25519_fe.h.
References Botan::FE_25519::mul().
Referenced by ge_frombytes_negate_vartime(), Botan::FE_25519::invert(), and Botan::FE_25519::pow_22523().
Definition at line 190 of file ed25519_fe.h.
References Botan::FE_25519::negate().
Referenced by ge_frombytes_negate_vartime().
Definition at line 220 of file ed25519_fe.h.
References Botan::FE_25519::pow_22523().
Referenced by ge_frombytes_negate_vartime().
Definition at line 200 of file ed25519_fe.h.
References Botan::FE_25519::sqr().
Referenced by ge_frombytes_negate_vartime(), Botan::FE_25519::invert(), and Botan::FE_25519::pow_22523().
Definition at line 210 of file ed25519_fe.h.
References Botan::FE_25519::sqr2().
Definition at line 205 of file ed25519_fe.h.
References Botan::FE_25519::sqr_iter().
Referenced by Botan::FE_25519::invert(), and Botan::FE_25519::pow_22523().
Definition at line 185 of file ed25519_fe.h.
References Botan::FE_25519::sub().
Referenced by ge_frombytes_negate_vartime().
|
inline |
Definition at line 149 of file ed25519_fe.h.
References Botan::FE_25519::to_bytes().
secure_vector< gf2m > Botan::find_roots_gf2m_decomp | ( | const polyn_gf2m & | polyn, |
size_t | code_length | ||
) |
Find the roots of a polynomial over GF(2^m) using the method by Federenko et al.
Definition at line 308 of file gf2m_rootfind_dcmp.cpp.
References find_roots_gf2m_decomp().
Referenced by find_roots_gf2m_decomp().
Compute the greatest common divisor
x | a positive integer |
y | a positive integer |
Definition at line 81 of file numthry.cpp.
References abs(), Botan::BigInt::bits(), BOTAN_ASSERT_NOMSG, Botan::BigInt::const_time_poison(), Botan::BigInt::const_time_unpoison(), Botan::BigInt::ct_cond_add(), Botan::BigInt::ct_cond_swap(), Botan::CT::Mask< T >::expand(), Botan::BigInt::is_even(), Botan::BigInt::is_odd(), Botan::BigInt::is_zero(), low_zero_bits(), Botan::BigInt::Positive, Botan::BigInt::set_sign(), and Botan::CT::unpoison().
Referenced by botan_mp_gcd(), Botan::ECIES_Decryptor::ECIES_Decryptor(), generate_rsa_prime(), lcm(), and random_prime().
void Botan::ge_double_scalarmult_vartime | ( | uint8_t | out[32], |
const uint8_t * | a, | ||
const ge_p3 * | A, | ||
const uint8_t * | b | ||
) |
Definition at line 519 of file ge.cpp.
void Botan::ge_double_scalarmult_vartime | ( | uint8_t | out[32], |
const uint8_t | a[], | ||
const ge_p3 * | A, | ||
const uint8_t | b[] | ||
) |
Referenced by ed25519_verify().
int Botan::ge_frombytes_negate_vartime | ( | ge_p3 * | h, |
const uint8_t * | s | ||
) |
Definition at line 458 of file ge.cpp.
References fe_1(), fe_add(), fe_frombytes(), fe_isnegative(), fe_isnonzero(), fe_mul(), fe_neg(), fe_pow22523(), fe_sq(), fe_sub(), Botan::ge_p3::T, Botan::ge_p3::X, Botan::ge_p3::Y, and Botan::ge_p3::Z.
Referenced by ed25519_verify().
void Botan::ge_scalarmult_base | ( | uint8_t | out[32], |
const uint8_t | in[32] | ||
) |
Definition at line 2118 of file ge.cpp.
References carry().
Referenced by ed25519_gen_keypair(), and ed25519_sign().
std::string Botan::generate_bcrypt | ( | const std::string & | password, |
RandomNumberGenerator & | rng, | ||
uint16_t | work_factor = 12 , |
||
char | version = 'a' |
||
) |
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 |
version | which version to emit (may be 'a', 'b', or 'y' all of which have identical behavior in this implementation). |
Definition at line 137 of file bcrypt.cpp.
References Botan::RandomNumberGenerator::random_vec().
Referenced by botan_bcrypt_generate().
std::vector< uint8_t > 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 122 of file dsa_gen.cpp.
References generate_dsa_primes(), and Botan::RandomNumberGenerator::randomize().
bool 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(), final, hash, is_prime(), Botan::Modular_Reducer::reduce(), Botan::BigInt::set_bit(), and X.
Referenced by Botan::DL_Group::DL_Group(), Botan::DL_Group::DL_Group(), and generate_dsa_primes().
McEliece_PrivateKey Botan::generate_mceliece_key | ( | RandomNumberGenerator & | rng, |
size_t | ext_deg, | ||
size_t | code_length, | ||
size_t | t | ||
) |
Definition at line 216 of file code_based_key_gen.cpp.
References bit_size_to_32bit_size(), Botan::polyn_gf2m::sqrt_mod_init(), store_le(), and syndrome_init().
Referenced by Botan::McEliece_PrivateKey::McEliece_PrivateKey().
std::string Botan::generate_passhash9 | ( | const std::string & | password, |
RandomNumberGenerator & | rng, | ||
uint16_t | work_factor = 15 , |
||
uint8_t | alg_id = 4 |
||
) |
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 44 of file passhash9.cpp.
References base64_encode(), Botan::OctetString::bits_of(), BOTAN_ARG_CHECK, Botan::PBKDF::derive_key(), get_byte(), and Botan::RandomNumberGenerator::randomize().
BigInt 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 hash, and Botan::RFC6979_Nonce_Generator::nonce_for().
BigInt Botan::generate_rsa_prime | ( | RandomNumberGenerator & | keygen_rng, |
RandomNumberGenerator & | prime_test_rng, | ||
size_t | bits, | ||
const BigInt & | coprime, | ||
size_t | prob = 128 |
||
) |
Generate a prime suitable for RSA p/q
keygen_rng | a random number generator |
prime_test_rng | a random number generator |
bits | how large the resulting prime should be in bits (must be >= 512) |
coprime | a positive integer that (prime - 1) should be coprime to |
prob | use test so false positive is bounded by 1/2**prob |
Definition at line 197 of file make_prm.cpp.
References Botan::BigInt::bits(), gcd(), Botan::BigInt::is_even(), is_miller_rabin_probable_prime(), miller_rabin_test_iterations(), and Botan::BigInt::set_bit().
Referenced by Botan::RSA_PrivateKey::RSA_PrivateKey().
BigInt Botan::generate_srp6_verifier | ( | const std::string & | identifier, |
const std::string & | password, | ||
const std::vector< uint8_t > & | salt, | ||
const DL_Group & | group, | ||
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 | specifies the shared SRP group |
hash_id | specifies a secure hash function |
Definition at line 137 of file srp6.cpp.
References Botan::BigInt::bits(), and Botan::DL_Group::power_g_p().
BigInt 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 127 of file srp6.cpp.
References generate_srp6_verifier().
Referenced by generate_srp6_verifier().
|
inline |
Get an AEAD mode by name (eg "AES-128/GCM" or "Serpent/EAX")
name | AEAD name |
direction | ENCRYPTION or DECRYPTION |
Definition at line 140 of file aead.h.
References Botan::AEAD_Mode::create(), and name.
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 Botan::Cipher_Mode::create().
|
inlineconstexpr |
Byte extraction
byte_num | which byte to extract, 0 == highest byte |
input | the value to extract from |
Definition at line 41 of file loadstor.h.
References T.
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::binary_encode(), Botan::BigInt::byte_at(), copy_out_be(), copy_out_le(), Botan::CryptoBox::decrypt_bin(), Botan::polyn_gf2m::encode(), Botan::CCM_Mode::encode_length(), Botan::CryptoBox::encrypt(), Botan::TLS::Connection_Cipher_State::format_ad(), generate_passhash9(), hkdf_expand_label(), ipv4_to_string(), Botan::TLS::Channel::key_material_export(), Botan::McEliece_PrivateKey::private_key_bits(), Botan::Processor_RNG::randomize(), Botan::TLS::Extensions::serialize(), Botan::TLS::Server_Name_Indicator::serialize(), Botan::TLS::Application_Layer_Protocol_Notification::serialize(), Botan::TLS::Supported_Groups::serialize(), Botan::TLS::Signature_Algorithms::serialize(), Botan::TLS::SRTP_Protection_Profiles::serialize(), Botan::TLS::Supported_Versions::serialize(), Botan::TLS::Server_Key_Exchange::Server_Key_Exchange(), Botan::CCM_Mode::set_associated_data(), sm2_compute_za(), Botan::RTSS_Share::split(), store_be(), store_be(), store_be(), store_le(), store_le(), and store_le().
|
inline |
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 212 of file filters.h.
References Botan::Cipher_Mode::create_or_throw().
Referenced by get_cipher(), and get_cipher().
|
inline |
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 228 of file filters.h.
References get_cipher(), and Botan::Keyed_Filter::set_key().
|
inline |
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 247 of file filters.h.
References get_cipher(), Botan::OctetString::length(), and Botan::Keyed_Filter::set_iv().
|
inline |
Get a cipher mode by name (eg "AES-128/CBC" or "Serpent/XTS")
algo_spec | cipher name |
direction | ENCRYPTION or DECRYPTION |
provider | provider implementation to choose |
Definition at line 189 of file cipher_mode.h.
References Botan::Cipher_Mode::create().
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 27 of file eme.cpp.
References Botan::SCAN_Name::algo_name(), Botan::SCAN_Name::arg(), Botan::SCAN_Name::arg_count(), Botan::HashFunction::create(), hash, and parse_algorithm_name().
Referenced by Botan::PK_Ops::Decryption_with_EME::Decryption_with_EME(), and Botan::PK_Ops::Encryption_with_EME::Encryption_with_EME().
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 44 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_TEST_API std::vector< std::string > Botan::get_files_recursive | ( | const std::string & | dir | ) |
Definition at line 126 of file filesystem.cpp.
References BOTAN_UNUSED.
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 241 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 |
Password based key derivation function factory method
algo_spec | the name of the desired PBKDF algorithm |
provider | the provider to use |
Definition at line 232 of file pbkdf.h.
References Botan::PBKDF::create_or_throw().
Referenced by get_s2k(), and Botan::TLS::Session_Manager_SQL::Session_Manager_SQL().
|
inline |
Definition at line 238 of file pbkdf.h.
References get_pbkdf().
BOTAN_TEST_API const std::vector< std::string > Botan::get_sig_paddings | ( | const std::string | algo | ) |
Returns the allowed padding schemes when using the given algorithm (key type) for creating digital signatures.
algo | the algorithm for which to look up supported padding schemes |
Definition at line 32 of file padding.cpp.
References allowed_signature_paddings.
Referenced by sig_algo_and_pad_ok().
Definition at line 31 of file code_based_util.h.
BOTAN_TEST_API bool Botan::has_filesystem_impl | ( | ) |
Definition at line 115 of file filesystem.cpp.
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 189 of file emsa.cpp.
References Botan::SCAN_Name::arg(), and Botan::SCAN_Name::arg_count().
Referenced by Botan::PKCS11::MechanismWrapper::create_ecdsa_mechanism().
std::vector< uint8_t > 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 189 of file hex.cpp.
References hex_decode().
std::vector< uint8_t > 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 204 of file hex.cpp.
References hex_decode().
size_t 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 146 of file hex.cpp.
References hex_decode().
size_t 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 89 of file hex.cpp.
References clear_mem().
Referenced by botan_hex_decode(), Botan::Hex_Decoder::end_msg(), Botan::Data_Store::get1_memvec(), hex_decode(), hex_decode(), hex_decode(), hex_decode(), hex_decode_locked(), Botan::OctetString::OctetString(), Botan::UUID::UUID(), and Botan::Hex_Decoder::write().
size_t 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 161 of file hex.cpp.
References hex_decode().
secure_vector< uint8_t > 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 168 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::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 183 of file hex.cpp.
References hex_decode_locked().
void 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 31 of file hex.cpp.
Referenced by Botan::Data_Store::add(), Botan::Data_Store::add(), botan_hex_encode(), create_hex_fingerprint(), hex_encode(), hex_encode(), Botan::X509_Certificate::issuer_info(), 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::X509_Certificate::subject_info(), Botan::BigInt::to_hex_string(), Botan::OctetString::to_string(), Botan::RTSS_Share::to_string(), Botan::UUID::to_string(), Botan::X509_Certificate::to_string(), Botan::HTTP::url_encode(), and Botan::UUID::UUID().
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().
std::string 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 46 of file hex.cpp.
References hex_encode().
Return the index of the highest set bit T is an unsigned integer type
n | an integer value |
Definition at line 55 of file bit_ops.h.
References T.
Referenced by Botan::OID::encode_into(), random_prime(), and Botan::BigInt::top_bits_free().
secure_vector< uint8_t > Botan::hkdf_expand_label | ( | const std::string & | hash_fn, |
const uint8_t | secret[], | ||
size_t | secret_len, | ||
const std::string & | label, | ||
const uint8_t | hash_val[], | ||
size_t | hash_val_len, | ||
size_t | length | ||
) |
HKDF-Expand-Label from TLS 1.3/QUIC
hash_fn | the hash to use |
secret | the secret bits |
secret_len | the length of secret |
label | the full label (no "TLS 1.3, " or "tls13 " prefix is applied) |
hash_val | the previous hash value (used for chaining, may be empty) |
hash_val_len | the length of hash_val |
length | the desired output length |
Definition at line 80 of file hkdf.cpp.
References BOTAN_ARG_CHECK, cast_char_ptr_to_uint8(), copy_mem(), Botan::MessageAuthenticationCode::create_or_throw(), get_byte(), and Botan::HKDF_Expand::kdf().
bool Botan::host_wildcard_match | ( | const std::string & | wildcard, |
const std::string & | host | ||
) |
Check if the given hostname is a match for the specified wildcard
Definition at line 339 of file parsing.cpp.
References tolower_string().
Referenced by Botan::X509_Certificate::matches_dns_name().
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 146 of file hash_id.cpp.
References name.
Referenced by Botan::EMSA_X931::EMSA_X931().
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 38 of file workfactor.cpp.
Referenced by dl_work_factor(), Botan::TPM_PrivateKey::estimated_strength(), and Botan::RSA_PublicKey::estimated_strength().
void BOTAN_UNSTABLE_API Botan::initialize_allocator | ( | ) |
Ensure the allocator is initialized
Definition at line 49 of file mem_ops.cpp.
References Botan::mlock_allocator::instance().
Referenced by Botan::Allocator_Initializer::Allocator_Initializer().
Deprecated modular inversion function. Use inverse_mod instead.
x | a positive integer |
modulus | a positive integer |
Definition at line 317 of file mod_inv.cpp.
References inverse_mod().
Modular inversion. This algorithm is const time with respect to x, as long as x is less than modulus. It also avoids leaking information about the modulus, except that it does leak which of 3 categories the modulus is in: an odd integer, a power of 2, or some other even number, and if the modulus is even, leaks the power of 2 which divides the modulus.
x | a positive integer |
modulus | a positive integer |
Definition at line 250 of file mod_inv.cpp.
References Botan::BigInt::bits(), BOTAN_ASSERT_NOMSG, Botan::BigInt::ct_cond_assign(), ct_modulo(), Botan::BigInt::is_even(), Botan::BigInt::is_negative(), Botan::BigInt::is_nonzero(), Botan::BigInt::is_odd(), Botan::BigInt::is_zero(), low_zero_bits(), Botan::BigInt::mask_bits(), Botan::BigInt::Positive, Botan::BigInt::power_of_2(), and Botan::BigInt::set_sign().
Referenced by botan_mp_mod_inverse(), Botan::RSA_PrivateKey::check_key(), Botan::Montgomery_Params::inv_mod_p(), inverse_euclid(), Botan::DL_Group::inverse_mod_p(), Botan::DL_Group::inverse_mod_q(), Botan::RSA_PrivateKey::RSA_PrivateKey(), and Botan::RSA_PrivateKey::RSA_PrivateKey().
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 278 of file parsing.cpp.
References get_byte().
Referenced by Botan::AlternativeName::decode_from(), and Botan::GeneralName::decode_from().
bool Botan::is_bailie_psw_probable_prime | ( | const BigInt & | n | ) |
Perform Bailie-PSW primality test
This is a combination of Miller-Rabin with base 2 and a Lucas test. No known composite integer passes both tests, though it is conjectured that infinitely many composite counterexamples exist.
n | the positive integer to test |
Definition at line 98 of file primality.cpp.
References is_bailie_psw_probable_prime().
bool BOTAN_TEST_API Botan::is_bailie_psw_probable_prime | ( | const BigInt & | n, |
const Modular_Reducer & | mod_n | ||
) |
Perform Bailie-PSW primality test
This is a combination of Miller-Rabin with base 2 and a Lucas test. No known composite integer passes both tests, though it is conjectured that infinitely many composite counterexamples exist.
n | the positive integer to test |
mod_n | a pre-created Modular_Reducer for n |
Definition at line 92 of file primality.cpp.
References is_lucas_probable_prime(), and passes_miller_rabin_test().
Referenced by is_bailie_psw_probable_prime(), and is_prime().
bool BOTAN_TEST_API Botan::is_lucas_probable_prime | ( | const BigInt & | n, |
const Modular_Reducer & | mod_n | ||
) |
Perform Lucas primality test
n | the positive integer to test |
mod_n | a pre-created Modular_Reducer for n |
Definition at line 17 of file primality.cpp.
References Botan::BigInt::bits(), Botan::BigInt::ct_cond_add(), Botan::BigInt::ct_cond_assign(), Botan::BigInt::flip_sign(), Botan::BigInt::get_bit(), Botan::BigInt::is_even(), Botan::BigInt::is_negative(), Botan::BigInt::is_odd(), is_perfect_square(), jacobi(), Botan::Modular_Reducer::multiply(), Botan::Modular_Reducer::reduce(), and Botan::Modular_Reducer::square().
Referenced by is_bailie_psw_probable_prime(), is_prime(), and random_prime().
bool BOTAN_TEST_API Botan::is_miller_rabin_probable_prime | ( | const BigInt & | n, |
const Modular_Reducer & | mod_n, | ||
RandomNumberGenerator & | rng, | ||
size_t | t | ||
) |
Perform t iterations of a Miller-Rabin primality test with random bases
n | the positive integer to test |
mod_n | a pre-created Modular_Reducer for n |
rng | a random number generator |
t | number of tests to perform |
Definition at line 143 of file primality.cpp.
References BOTAN_ASSERT_NOMSG, passes_miller_rabin_test(), and Botan::BigInt::random_integer().
Referenced by generate_rsa_prime(), is_prime(), and random_prime().
bool Botan::is_passhash9_alg_supported | ( | uint8_t | alg_id | ) |
Check if the PRF used with PBKDF2 is supported
alg_id | alg_id used in generate_passhash9() |
Definition at line 133 of file passhash9.cpp.
Test if the positive integer x is a perfect square ie if there exists some positive integer y st y*y == x See FIPS 186-4 sec C.4
Definition at line 196 of file numthry.cpp.
References Botan::BigInt::bits(), Botan::BigInt::power_of_2(), and X.
Referenced by is_lucas_probable_prime().
Power of 2 test. T should be an unsigned integer type
arg | an integer value |
Definition at line 43 of file bit_ops.h.
References T.
Referenced by Botan::MDx_HashFunction::MDx_HashFunction(), operator%(), Botan::BigInt::operator%=(), Botan::BigInt::operator/=(), Botan::Scrypt::Scrypt(), and Botan::CTR_BE::seek().
bool Botan::is_prime | ( | const BigInt & | n, |
RandomNumberGenerator & | rng, | ||
size_t | prob = 64 , |
||
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 228 of file numthry.cpp.
References Botan::BigInt::bits(), is_bailie_psw_probable_prime(), Botan::BigInt::is_even(), is_lucas_probable_prime(), is_miller_rabin_probable_prime(), Botan::RandomNumberGenerator::is_seeded(), miller_rabin_test_iterations(), PRIME_TABLE_SIZE, PRIMES, 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_safe_prime(), Botan::EC_Group::verify_group(), Botan::DL_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_zero(), and low_zero_bits().
Referenced by Botan::DL_Group::DL_Group(), is_lucas_probable_prime(), and ressol().
std::string Botan::key_constraints_to_string | ( | Key_Constraints | constraints | ) |
Definition at line 15 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 143 of file numthry.cpp.
References ct_divide(), and gcd().
Referenced by Botan::RSA_PrivateKey::check_key(), Botan::RSA_PrivateKey::RSA_PrivateKey(), and Botan::RSA_PrivateKey::RSA_PrivateKey().
Definition at line 40 of file code_based_util.h.
Referenced by syndrome_init().
|
inline |
Definition at line 19 of file ed25519_internal.h.
Referenced by Botan::FE_25519::from_bytes(), sc_muladd(), and sc_reduce().
|
inline |
Definition at line 26 of file ed25519_internal.h.
References load_le< uint32_t >().
Referenced by Botan::FE_25519::from_bytes(), sc_muladd(), and sc_reduce().
Load a big-endian word
in | a pointer to some bytes |
off | an offset into the array |
Definition at line 107 of file loadstor.h.
References T.
Referenced by Botan::Blowfish::decrypt_n(), Botan::CAST_128::decrypt_n(), Botan::XTEA::decrypt_n(), Botan::Blowfish::encrypt_n(), Botan::CAST_128::encrypt_n(), Botan::XTEA::encrypt_n(), and Botan::SIMD_4x32::load_be().
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 349 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 364 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 386 of file loadstor.h.
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 407 of file loadstor.h.
References bswap_4(), reverse_bytes(), and typecast_copy().
|
inline |
Load a big-endian uint16_t
in | a pointer to some bytes |
off | an offset into the array |
Definition at line 139 of file loadstor.h.
References make_uint16(), and typecast_copy().
Referenced by Botan::TLS::Datagram_Handshake_IO::add_record(), check_passhash9(), Botan::KASUMI::decrypt_n(), Botan::MISTY1::decrypt_n(), Botan::KASUMI::encrypt_n(), Botan::MISTY1::encrypt_n(), and ucs2_to_utf8().
|
inline |
Load a big-endian uint32_t
in | a pointer to some bytes |
off | an offset into the array |
Definition at line 179 of file loadstor.h.
References make_uint32(), and typecast_copy().
Referenced by base58_check_decode(), Botan::SHA_256::compress_digest(), Botan::AlternativeName::decode_from(), Botan::GeneralName::decode_from(), Botan::CAST_256::decrypt_n(), Botan::Noekeon::decrypt_n(), Botan::SEED::decrypt_n(), Botan::SHACAL2::decrypt_n(), Botan::SM4::decrypt_n(), Botan::CAST_256::encrypt_n(), Botan::Noekeon::encrypt_n(), Botan::SEED::encrypt_n(), Botan::SHACAL2::encrypt_n(), Botan::SM4::encrypt_n(), Botan::HOTP::generate_hotp(), Botan::CTR_BE::seek(), and ucs4_to_utf8().
|
inline |
Load a big-endian uint64_t
in | a pointer to some bytes |
off | an offset into the array |
Definition at line 217 of file loadstor.h.
References make_uint64(), and typecast_copy().
Referenced by Botan::SHA_512::compress_digest(), Botan::TLS::Session::decrypt(), nist_key_unwrap_padded(), and Botan::TLS::Server_Hello::random_signals_downgrade().
Load a little-endian word
in | a pointer to some bytes |
off | an offset into the array |
Definition at line 123 of file loadstor.h.
References T.
Referenced by Botan::Serpent::decrypt_n(), Botan::Threefish_512::decrypt_n(), Botan::Twofish::decrypt_n(), Botan::Serpent::encrypt_n(), Botan::Threefish_512::encrypt_n(), Botan::Twofish::encrypt_n(), and Botan::SIMD_4x32::load_le().
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 257 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 272 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 294 of file loadstor.h.
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 315 of file loadstor.h.
References bswap_4(), reverse_bytes(), and typecast_copy().
|
inline |
Load a little-endian uint16_t
in | a pointer to some bytes |
off | an offset into the array |
Definition at line 159 of file loadstor.h.
References make_uint16(), and typecast_copy().
|
inline |
Load a little-endian uint32_t
in | a pointer to some bytes |
off | an offset into the array |
Definition at line 198 of file loadstor.h.
References make_uint32(), and typecast_copy().
Referenced by Botan::Sodium::crypto_core_hsalsa20(), Botan::GOST_28147_89::decrypt_n(), Botan::GOST_28147_89::encrypt_n(), load_4(), random_prime(), Botan::RDRAND_RNG::rdrand(), Botan::RDRAND_RNG::rdrand_status(), Botan::ChaCha::seek(), Botan::Salsa20::seek(), Botan::ChaCha::set_iv(), and Botan::Salsa20::set_iv().
|
inline |
Load a little-endian uint64_t
in | a pointer to some bytes |
off | an offset into the array |
Definition at line 237 of file loadstor.h.
References make_uint64(), and typecast_copy().
Referenced by Botan::SHA_3::absorb(), Botan::Threefish_512::set_tweak(), and Botan::Sodium::sodium_free().
std::unique_ptr< Private_Key > Botan::load_private_key | ( | const AlgorithmIdentifier & | alg_id, |
const secure_vector< uint8_t > & | key_bits | ||
) |
Definition at line 159 of file pk_algs.cpp.
References Botan::AlgorithmIdentifier::get_oid(), and Botan::OID::to_formatted_string().
std::unique_ptr< Public_Key > Botan::load_public_key | ( | const AlgorithmIdentifier & | alg_id, |
const std::vector< uint8_t > & | key_bits | ||
) |
Definition at line 78 of file pk_algs.cpp.
References Botan::AlgorithmIdentifier::get_oid(), split_on(), and Botan::OID::to_formatted_string().
Referenced by Botan::X509::load_key().
size_t Botan::low_zero_bits | ( | const BigInt & | x | ) |
x | an integer |
Definition at line 39 of file numthry.cpp.
References Botan::CT::Mask< T >::cleared(), ctz(), Botan::CT::Mask< T >::expand(), Botan::BigInt::size(), and Botan::BigInt::word_at().
Referenced by gcd(), inverse_mod(), jacobi(), passes_miller_rabin_test(), and ressol().
std::unique_ptr< BlockCipher > Botan::make_commoncrypto_block_cipher | ( | const std::string & | name | ) |
Definition at line 150 of file commoncrypto_block.cpp.
References commoncrypto_opts_from_algo_name(), make_commoncrypto_block_cipher(), and name.
Referenced by Botan::BlockCipher::create(), and make_commoncrypto_block_cipher().
Cipher_Mode * Botan::make_commoncrypto_cipher_mode | ( | const std::string & | name, |
Cipher_Dir | direction | ||
) |
Definition at line 234 of file commoncrypto_mode.cpp.
References commoncrypto_opts_from_algo(), make_commoncrypto_cipher_mode(), and name.
Referenced by Botan::Cipher_Mode::create(), and make_commoncrypto_cipher_mode().
std::unique_ptr< HashFunction > Botan::make_commoncrypto_hash | ( | const std::string & | name | ) |
Definition at line 97 of file commoncrypto_hash.cpp.
References MAKE_COMMONCRYPTO_HASH_1, MAKE_COMMONCRYPTO_HASH_2, MAKE_COMMONCRYPTO_HASH_3, and name.
Referenced by Botan::HashFunction::create().
Compression_Algorithm * Botan::make_compressor | ( | const std::string & | name | ) |
Definition at line 27 of file compression.cpp.
References BOTAN_UNUSED, and name.
Referenced by Botan::Compression_Algorithm::create().
Decompression_Algorithm * Botan::make_decompressor | ( | const std::string & | name | ) |
Definition at line 71 of file compression.cpp.
References BOTAN_UNUSED, and name.
Referenced by Botan::Decompression_Algorithm::create().
|
inline |
Definition at line 118 of file asio_error.h.
References botan_category().
|
inlineconstexpr |
Make a uint16_t from two bytes
i0 | the first byte |
i1 | the second byte |
Definition at line 54 of file loadstor.h.
Referenced by Botan::TLS::Certificate_Req::Certificate_Req(), 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().
|
inlineconstexpr |
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 67 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 >(), load_le< uint32_t >(), and Botan::SIMD_4x32::splat_u8().
|
inlineconstexpr |
Make a uint64_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 87 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 62 of file stl_compatibility.h.
References make_unique(), and T.
Referenced by make_unique(), make_unique(), and make_unique().
|
delete |
References make_unique().
stlCompatibilityDetails::_Unique_if< T >::_Unknown_bound Botan::make_unique | ( | size_t | n | ) |
Definition at line 68 of file stl_compatibility.h.
References make_unique().
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.
Definition at line 96 of file stl_util.h.
Referenced by Botan::TLS::Channel::activate_session().
secure_vector< uint8_t > 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::AEAD_Mode::create_or_throw(), Botan::PK_KEM_Decryptor::decrypt(), DECRYPTION, and Botan::McEliece_PublicKey::get_code_length().
secure_vector< uint8_t > 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 35 of file mceies.cpp.
References BOTAN_ASSERT, copy_mem(), Botan::AEAD_Mode::create_or_throw(), Botan::PK_KEM_Encryptor::encrypt(), ENCRYPTION, Botan::McEliece_PublicKey::get_code_length(), and Botan::RandomNumberGenerator::random_vec().
secure_vector< uint8_t > Botan::mceliece_decrypt | ( | secure_vector< gf2m > & | error_pos, |
const uint8_t * | ciphertext, | ||
size_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 166 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_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 138 of file goppa_code.cpp.
References Botan::McEliece_PublicKey::get_code_length(), and mceliece_decrypt().
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 130 of file goppa_code.cpp.
References mceliece_decrypt().
Referenced by Botan::McEliece_PrivateKey::check_key(), mceliece_decrypt(), and mceliece_decrypt().
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 120 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().
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().
Referenced by Botan::McEliece_PublicKey::estimated_strength().
void 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.
size_t Botan::miller_rabin_test_iterations | ( | size_t | n_bits, |
size_t | prob, | ||
bool | random | ||
) |
Return required number of Miller-Rabin tests in order to reach the specified probability of error.
n_bits | the bit-length of the integer being tested |
prob | chance of false positive is bounded by 1/2**prob |
random | is set if (and only if) the integer was randomly generated by us and thus cannot have been maliciously constructed. |
Definition at line 165 of file primality.cpp.
Referenced by generate_rsa_prime(), is_prime(), and random_prime().
BigInt Botan::monty_execute | ( | const Montgomery_Exponentation_State & | precomputed_state, |
const BigInt & | k, | ||
size_t | max_k_bits | ||
) |
Definition at line 165 of file monty_exp.cpp.
References monty_execute().
Referenced by monty_execute(), passes_miller_rabin_test(), and power_mod().
BigInt Botan::monty_execute_vartime | ( | const Montgomery_Exponentation_State & | precomputed_state, |
const BigInt & | k | ||
) |
Definition at line 171 of file monty_exp.cpp.
References monty_execute_vartime().
Referenced by monty_execute_vartime().
word Botan::monty_inverse | ( | word | a | ) |
Definition at line 327 of file mod_inv.cpp.
References MP_WORD_MAX.
Referenced by Botan::Montgomery_Params::Montgomery_Params(), and Botan::Montgomery_Params::Montgomery_Params().
BigInt Botan::monty_multi_exp | ( | std::shared_ptr< const Montgomery_Params > | params_p, |
const BigInt & | x, | ||
const BigInt & | z1, | ||
const BigInt & | y, | ||
const BigInt & | z2 | ||
) |
Return (x^z1 * y^z2) % p
Definition at line 177 of file monty_exp.cpp.
References Botan::BigInt::bits(), Botan::BigInt::get_substring(), Botan::BigInt::is_negative(), monty_multi_exp(), Botan::Montgomery_Int::mul(), Botan::Montgomery_Int::mul_by(), round_up(), Botan::Montgomery_Int::square(), Botan::Montgomery_Int::square_this(), and Botan::Montgomery_Int::value().
Referenced by monty_multi_exp(), and Botan::DL_Group::multi_exponentiate().
std::shared_ptr< const Montgomery_Exponentation_State > Botan::monty_precompute | ( | std::shared_ptr< const Montgomery_Params > | params, |
const BigInt & | g, | ||
size_t | window_bits, | ||
bool | const_time | ||
) |
Definition at line 157 of file monty_exp.cpp.
References monty_precompute().
Referenced by monty_precompute(), passes_miller_rabin_test(), and power_mod().
|
inline |
Perform a 64x64->128 bit multiplication
Definition at line 85 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 30 of file mp_numth.cpp.
References bigint_add2(), bigint_mul(), Botan::BigInt::data(), Botan::BigInt::is_negative(), 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 73 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 | ||
) |
ECC point multiexponentiation - not constant time!
p1 | a point |
z1 | a scalar |
p2 | a point |
z2 | a scalar |
Definition at line 25 of file point_mul.cpp.
References Botan::PointGFp_Multi_Point_Precompute::multi_exp().
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::AlternativeName::add_othername(), Botan::X509_DN::contents(), Botan::AlternativeName::contents(), and Botan::X509_DN::get_attributes().
void Botan::newhope_keygen | ( | uint8_t * | send, |
poly * | sk, | ||
RandomNumberGenerator & | rng, | ||
Newhope_Mode | mode | ||
) |
Definition at line 720 of file newhope.cpp.
References NEWHOPE_SEED_BYTES, and Botan::RandomNumberGenerator::randomize().
Referenced by CECPQ1_offer().
void Botan::newhope_keygen | ( | uint8_t | send[NEWHOPE_SENDABYTES], |
newhope_poly * | sk, | ||
RandomNumberGenerator & | rng, | ||
Newhope_Mode | = Newhope_Mode::SHA3 |
||
) |
void Botan::newhope_shareda | ( | uint8_t | sharedkey[], |
const poly * | sk, | ||
const uint8_t | received[], | ||
Newhope_Mode | mode | ||
) |
Definition at line 779 of file newhope.cpp.
References Botan::HashFunction::create_or_throw(), hash, and SHA3.
Referenced by CECPQ1_finish().
void Botan::newhope_shareda | ( | uint8_t | sharedkey[NEWHOPE_SHARED_KEY_BYTES], |
const newhope_poly * | ska, | ||
const uint8_t * | received, | ||
Newhope_Mode | mode = Newhope_Mode::SHA3 |
||
) |
void Botan::newhope_sharedb | ( | uint8_t * | sharedkey, |
uint8_t * | send, | ||
const uint8_t * | received, | ||
RandomNumberGenerator & | rng, | ||
Newhope_Mode | mode | ||
) |
Definition at line 742 of file newhope.cpp.
References Botan::HashFunction::create_or_throw(), hash, NEWHOPE_SEED_BYTES, and SHA3.
Referenced by CECPQ1_accept().
void Botan::newhope_sharedb | ( | uint8_t | sharedkey[NEWHOPE_SHARED_KEY_BYTES], |
uint8_t | send[], | ||
const uint8_t * | received, | ||
RandomNumberGenerator & | rng, | ||
Newhope_Mode | mode = Newhope_Mode::SHA3 |
||
) |
secure_vector< uint8_t > Botan::nist_key_unwrap | ( | const uint8_t | input[], |
size_t | input_len, | ||
const BlockCipher & | bc | ||
) |
input | the value to be decrypted, output of nist_key_wrap |
input_len | length of input |
bc | a keyed 128-bit block cipher that will be used to decrypt input |
Definition at line 113 of file nist_keywrap.cpp.
References Botan::BlockCipher::block_size().
Referenced by rfc3394_keyunwrap().
secure_vector< uint8_t > Botan::nist_key_unwrap_padded | ( | const uint8_t | input[], |
size_t | input_len, | ||
const BlockCipher & | bc | ||
) |
input | the value to be decrypted, output of nist_key_wrap |
input_len | length of input |
bc | a keyed 128-bit block cipher that will be used to decrypt input |
Definition at line 161 of file nist_keywrap.cpp.
References Botan::BlockCipher::block_size(), copy_mem(), Botan::BlockCipher::decrypt(), and load_be< uint64_t >().
Referenced by Botan::Encrypted_PSK_Database::get(), and Botan::Encrypted_PSK_Database::list_names().
std::vector< uint8_t > Botan::nist_key_wrap | ( | const uint8_t | input[], |
size_t | input_len, | ||
const BlockCipher & | bc | ||
) |
Key wrap. See RFC 3394 and NIST SP800-38F
input | the value to be encrypted |
input_len | length of input, must be a multiple of 8 |
bc | a keyed 128-bit block cipher that will be used to encrypt input |
Definition at line 99 of file nist_keywrap.cpp.
References Botan::BlockCipher::block_size().
Referenced by rfc3394_keywrap().
std::vector< uint8_t > Botan::nist_key_wrap_padded | ( | const uint8_t | input[], |
size_t | input_len, | ||
const BlockCipher & | bc | ||
) |
KWP (key wrap with padding). See RFC 5649 and NIST SP800-38F
input | the value to be encrypted |
input_len | length of input |
bc | a keyed 128-bit block cipher that will be used to encrypt input |
Definition at line 134 of file nist_keywrap.cpp.
References Botan::BlockCipher::block_size(), copy_mem(), Botan::BlockCipher::encrypt(), and store_be().
Referenced by Botan::Encrypted_PSK_Database::get(), Botan::Encrypted_PSK_Database::remove(), and Botan::Encrypted_PSK_Database::set().
Call almost_montgomery_inverse and correct the result to a^-1 mod b
Definition at line 75 of file mod_inv.cpp.
References almost_montgomery_inverse(), and Botan::BigInt::is_odd().
secure_vector< uint8_t > BOTAN_TEST_API Botan::oaep_find_delim | ( | uint8_t & | valid_mask, |
const uint8_t | input[], | ||
size_t | input_len, | ||
const secure_vector< uint8_t > & | Phash | ||
) |
Definition at line 95 of file oaep.cpp.
References Botan::CT::Mask< T >::cleared(), Botan::CT::copy_output(), ct_compare_u8(), Botan::CT::Mask< T >::if_set_return(), Botan::CT::Mask< T >::is_equal(), Botan::CT::Mask< T >::is_zero(), Botan::CT::poison(), Botan::CT::Mask< T >::set(), and Botan::CT::unpoison().
bool Botan::operator!= | ( | const AlgorithmIdentifier & | a1, |
const AlgorithmIdentifier & | a2 | ||
) |
Definition at line 82 of file alg_id.cpp.
Definition at line 277 of file asn1_time.cpp.
References Botan::ASN1_Time::cmp().
|
inline |
Test two CRL entries for inequality in at least one field.
Definition at line 58 of file crl_ent.cpp.
Definition at line 247 of file curve_gfp.h.
Definition at line 387 of file ec_group.h.
bool Botan::operator!= | ( | const OctetString & | x, |
const OctetString & | y | ||
) |
Compare two strings
x | an octet string |
y | an octet string |
Definition at line 106 of file symkey.cpp.
Compare two OIDs.
Definition at line 311 of file asn1_obj.h.
Definition at line 355 of file point_gfp.h.
|
inline |
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 831 of file x509cert.cpp.
Definition at line 174 of file x509_dn.cpp.
Definition at line 131 of file big_ops3.cpp.
References Botan::BigInt::is_negative(), Botan::BigInt::is_positive(), Botan::BigInt::is_zero(), Botan::BigInt::sig_words(), vartime_divide(), and Botan::BigInt::word_at().
word Botan::operator% | ( | const BigInt & | n, |
word | mod | ||
) |
Definition at line 153 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 |
Point multiplication operator
scalar | the scalar value |
point | the point value |
Definition at line 394 of file point_gfp.cpp.
References Botan::PointGFp::add(), Botan::BigInt::bits(), BOTAN_DEBUG_ASSERT, Botan::BigInt::get_bit(), Botan::BigInt::is_negative(), Botan::PointGFp::mult2(), Botan::PointGFp::negate(), Botan::PointGFp::on_the_curve(), Botan::PointGFp::WORKSPACE_SIZE, and Botan::PointGFp::zero().
Definition at line 45 of file big_ops3.cpp.
References bigint_linmul3(), bigint_mul(), Botan::BigInt::cond_flip_sign(), Botan::BigInt::data(), Botan::BigInt::mutable_data(), Botan::BigInt::Positive, Botan::BigInt::sig_words(), Botan::BigInt::sign(), Botan::BigInt::size(), and Botan::BigInt::word_at().
Definition at line 74 of file big_ops3.cpp.
References bigint_linmul3(), Botan::BigInt::data(), Botan::BigInt::mutable_data(), Botan::BigInt::Positive, Botan::BigInt::set_sign(), Botan::BigInt::sig_words(), and Botan::BigInt::sign().
Definition at line 83 of file donna128.h.
References BOTAN_ARG_CHECK, Botan::donna128::hi(), Botan::donna128::lo(), and mul64x64_128().
Definition at line 378 of file point_gfp.h.
Definition at line 92 of file donna128.h.
Definition at line 1070 of file bigint.h.
References Botan::BigInt::add2(), Botan::BigInt::data(), Botan::BigInt::sig_words(), and Botan::BigInt::sign().
Definition at line 1075 of file bigint.h.
References Botan::BigInt::add2(), and Botan::BigInt::Positive.
Definition at line 97 of file donna128.h.
Definition at line 104 of file donna128.h.
OctetString Botan::operator+ | ( | const OctetString & | x, |
const OctetString & | y | ||
) |
Concatenate two strings
x | an octet string |
y | an octet string |
Definition at line 114 of file symkey.cpp.
References Botan::OctetString::bits_of().
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 122 of file asn1_oid.cpp.
References Botan::OID::get_components().
Definition at line 366 of file point_gfp.h.
Definition at line 1085 of file bigint.h.
References Botan::BigInt::add2(), Botan::BigInt::data(), Botan::BigInt::reverse_sign(), and Botan::BigInt::sig_words().
Definition at line 1090 of file bigint.h.
References Botan::BigInt::add2(), and Botan::BigInt::Negative.
Definition at line 361 of file point_gfp.h.
References Botan::PointGFp::negate().
Definition at line 372 of file point_gfp.h.
Definition at line 92 of file big_ops3.cpp.
References Botan::BigInt::sig_words(), vartime_divide(), and Botan::BigInt::word_at().
Definition at line 107 of file big_ops3.cpp.
References ct_divide_u8(), and vartime_divide().
|
inline |
Compare two OIDs.
Definition at line 132 of file asn1_oid.cpp.
References Botan::OID::get_components().
Definition at line 182 of file x509_dn.cpp.
References BOTAN_ASSERT_NOMSG, BOTAN_DEBUG_ASSERT, Botan::X509_DN::get_attributes(), and x500_name_cmp().
Definition at line 184 of file big_ops3.cpp.
References bigint_shl2(), Botan::BigInt::data(), Botan::BigInt::mutable_data(), Botan::BigInt::sig_words(), and Botan::BigInt::sign().
int 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().
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().
std::ostream & Botan::operator<< | ( | std::ostream & | out, |
const X509_DN & | dn | ||
) |
Definition at line 333 of file x509_dn.cpp.
References Botan::X509_DN::dn_info().
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 17 of file pipe_io.cpp.
References cast_uint8_ptr_to_char(), Botan::Pipe::read(), and Botan::Pipe::remaining().
std::ostream & Botan::operator<< | ( | std::ostream & | stream, |
const BigInt & | n | ||
) |
Definition at line 17 of file big_io.cpp.
References Botan::BigInt::to_dec_string(), and Botan::BigInt::to_hex_string().
Definition at line 1113 of file bigint.h.
References Botan::BigInt::cmp().
|
inline |
bool Botan::operator== | ( | const AlgorithmIdentifier & | a1, |
const AlgorithmIdentifier & | a2 | ||
) |
Definition at line 65 of file alg_id.cpp.
References Botan::AlgorithmIdentifier::get_oid(), Botan::AlgorithmIdentifier::get_parameters(), and Botan::AlgorithmIdentifier::parameters_are_null_or_empty().
|
inline |
Test two CRL entries for equality in all fields.
Definition at line 44 of file crl_ent.cpp.
References Botan::CRL_Entry::expire_time(), Botan::CRL_Entry::reason_code(), and Botan::CRL_Entry::serial_number().
bool Botan::operator== | ( | const OctetString & | x, |
const OctetString & | y | ||
) |
Compare two strings
x | an octet string |
y | an octet string |
Definition at line 98 of file symkey.cpp.
References Botan::OctetString::bits_of().
|
inline |
Definition at line 146 of file x509_dn.cpp.
References Botan::X509_DN::get_attributes(), and x500_name_cmp().
|
inline |
|
inline |
Definition at line 199 of file big_ops3.cpp.
References bigint_shr2(), Botan::BigInt::data(), Botan::BigInt::is_negative(), Botan::BigInt::is_zero(), Botan::BigInt::mutable_data(), Botan::BigInt::Positive, Botan::BigInt::set_sign(), Botan::BigInt::sig_words(), and Botan::BigInt::sign().
int 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 40 of file fd_unix.cpp.
References Botan::Pipe::write().
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 33 of file pipe_io.cpp.
References cast_uint8_ptr_to_char(), and Botan::Pipe::write().
std::istream & Botan::operator>> | ( | std::istream & | in, |
X509_DN & | dn | ||
) |
Definition at line 358 of file x509_dn.cpp.
References Botan::X509_DN::add_attribute(), and Botan::X509_DN::deref_info_field().
std::istream & Botan::operator>> | ( | std::istream & | stream, |
BigInt & | n | ||
) |
Definition at line 52 of file big_io.cpp.
OctetString Botan::operator^ | ( | const OctetString & | x, |
const OctetString & | y | ||
) |
XOR two strings
x | an octet string |
y | an octet string |
Definition at line 125 of file symkey.cpp.
References Botan::OctetString::begin(), copy_mem(), Botan::OctetString::length(), and xor_buf().
std::vector< uint8_t, Alloc > & Botan::operator^= | ( | std::vector< uint8_t, Alloc > & | out, |
const std::vector< uint8_t, Alloc2 > & | in | ||
) |
Definition at line 111 of file donna128.h.
References Botan::donna128::hi(), and Botan::donna128::lo().
|
inline |
PointGFp Botan::OS2ECP | ( | const std::vector< uint8_t, Alloc > & | data, |
const CurveGFp & | curve | ||
) |
Definition at line 414 of file point_gfp.h.
References OS2ECP().
std::pair< BigInt, BigInt > BOTAN_UNSTABLE_API Botan::OS2ECP | ( | const uint8_t | data[], |
size_t | data_len, | ||
const BigInt & | curve_p, | ||
const BigInt & | curve_a, | ||
const BigInt & | curve_b | ||
) |
Perform point decoding Use EC_Group::OS2ECP instead
data | the encoded point |
data_len | length of data in bytes |
curve_p | the curve equation prime |
curve_a | the curve equation a parameter |
curve_b | the curve equation b parameter |
Definition at line 684 of file point_gfp.cpp.
References Botan::BigInt::decode().
Perform point decoding Use EC_Group::OS2ECP instead
Definition at line 667 of file point_gfp.cpp.
References Botan::CurveGFp::get_a(), Botan::CurveGFp::get_b(), Botan::CurveGFp::get_p(), Botan::PointGFp::on_the_curve(), and OS2ECP().
Referenced by OS2ECP(), Botan::EC_Group::OS2ECP(), Botan::EC_Group::OS2ECP(), and OS2ECP().
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 95 of file parsing.cpp.
References name.
Referenced by Botan::AEAD_Mode::create(), Botan::Cipher_Mode::create(), get_eme(), and Botan::X509_Object::hash_used_for_signature().
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 199 of file parsing.cpp.
References BOTAN_UNUSED, and Botan::OID::get_components().
bool Botan::passes_miller_rabin_test | ( | const BigInt & | n, |
const Modular_Reducer & | mod_n, | ||
const std::shared_ptr< Montgomery_Params > & | monty_n, | ||
const BigInt & | a | ||
) |
Perform a single Miller-Rabin test with specified base
n | the positive integer to test |
mod_n | a pre-created Modular_Reducer for n |
monty_n | Montgomery parameters for n |
a | the base to check |
Definition at line 104 of file primality.cpp.
References Botan::BigInt::bits(), BOTAN_ASSERT_NOMSG, low_zero_bits(), monty_execute(), monty_precompute(), and Botan::Modular_Reducer::square().
Referenced by is_bailie_psw_probable_prime(), and is_miller_rabin_probable_prime().
secure_vector< uint8_t > 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 303 of file pbes2.cpp.
References Botan::Cipher_Mode::create(), Botan::BER_Decoder::decode(), DECRYPTION, Botan::BER_Decoder::end_cons(), Botan::AlgorithmIdentifier::get_oid(), Botan::AlgorithmIdentifier::get_parameters(), OCTET_STRING, Botan::OIDS::oid2str_or_throw(), SEQUENCE, split_on(), Botan::BER_Decoder::start_cons(), and Botan::BER_Decoder::verify_end().
std::pair< AlgorithmIdentifier, std::vector< uint8_t > > 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 |
Definition at line 260 of file pbes2.cpp.
std::pair< AlgorithmIdentifier, std::vector< uint8_t > > 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 292 of file pbes2.cpp.
Referenced by Botan::PKCS8::BER_encode_encrypted_pbkdf_iter().
std::pair< AlgorithmIdentifier, std::vector< uint8_t > > 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 273 of file pbes2.cpp.
Referenced by Botan::PKCS8::BER_encode(), and Botan::PKCS8::BER_encode_encrypted_pbkdf_msec().
size_t Botan::pbkdf2 | ( | MessageAuthenticationCode & | prf, |
uint8_t | out[], | ||
size_t | out_len, | ||
const std::string & | password, | ||
const uint8_t | salt[], | ||
size_t | salt_len, | ||
size_t | iterations, | ||
std::chrono::milliseconds | msec | ||
) |
Definition at line 35 of file pbkdf2.cpp.
References Botan::PBKDF2::iterations(), pbkdf2(), and salt_len.
Referenced by Botan::PBKDF2::derive_key(), Botan::PKCS5_PBKDF2::pbkdf(), pbkdf2(), and scrypt().
void Botan::pbkdf2 | ( | MessageAuthenticationCode & | prf, |
uint8_t | out[], | ||
size_t | out_len, | ||
const uint8_t | salt[], | ||
size_t | salt_len, | ||
size_t | iterations | ||
) |
Perform PBKDF2. The prf is assumed to be keyed already.
Definition at line 108 of file pbkdf2.cpp.
References BOTAN_ASSERT_NOMSG, clear_mem(), Botan::Buffered_Computation::final(), Botan::Buffered_Computation::output_length(), salt_len, Botan::Buffered_Computation::update(), Botan::Buffered_Computation::update_be(), and xor_buf().
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 77 of file hash_id.cpp.
References name.
Referenced by botan_pkcs_hash_id(), Botan::EMSA_PKCS1v15::EMSA_PKCS1v15(), and Botan::EMSA_PKCS1v15_Raw::EMSA_PKCS1v15_Raw().
|
inline |
Definition at line 27 of file poly_dbl.h.
References poly_double_n().
void BOTAN_TEST_API Botan::poly_double_n | ( | uint8_t | out[], |
const uint8_t | in[], | ||
size_t | n | ||
) |
Polynomial doubling in GF(2^n)
Definition at line 73 of file poly_dbl.cpp.
Referenced by Botan::CMAC::poly_double(), poly_double_n(), and Botan::SIV_Mode::S2V().
void BOTAN_TEST_API Botan::poly_double_n_le | ( | uint8_t | out[], |
const uint8_t | in[], | ||
size_t | n | ||
) |
Definition at line 94 of file poly_dbl.cpp.
Referenced by Botan::XTS_Mode::update_tweak().
|
inline |
Returns true iff poly_double_n is implemented for this size.
Definition at line 22 of file poly_dbl.h.
Referenced by Botan::CMAC::CMAC(), and Botan::XTS_Mode::XTS_Mode().
Modular exponentation
b | an integer base |
x | a positive exponent |
m | a positive modulus |
Definition at line 151 of file numthry.cpp.
References Botan::BigInt::bits(), Botan::BigInt::ct_cond_assign(), Botan::BigInt::get_bit(), Botan::BigInt::is_negative(), Botan::BigInt::is_odd(), Botan::BigInt::is_zero(), monty_execute(), monty_precompute(), Botan::Modular_Reducer::multiply(), Botan::Modular_Reducer::reduce(), and Botan::Modular_Reducer::square().
Referenced by botan_mp_powmod(), ressol(), srp6_client_agree(), Botan::SRP6_Server_Session::step2(), and Botan::DL_Group::verify_public_element().
Definition at line 16 of file prefetch.h.
References Botan::CPUID::cache_line_size(), and T.
Definition at line 27 of file prefetch.h.
References Botan::CPUID::cache_line_size(), and T.
const BigInt & Botan::prime_p192 | ( | ) |
Definition at line 105 of file nistp_redc.cpp.
const BigInt & Botan::prime_p224 | ( | ) |
Definition at line 200 of file nistp_redc.cpp.
const BigInt & Botan::prime_p256 | ( | ) |
Definition at line 302 of file nistp_redc.cpp.
const BigInt & Botan::prime_p384 | ( | ) |
Definition at line 430 of file nistp_redc.cpp.
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 15 of file nistp_redc.cpp.
std::vector< std::string > Botan::probe_provider_private_key | ( | const std::string & | alg_name, |
const std::vector< std::string > | possible | ||
) |
Definition at line 391 of file pk_algs.cpp.
References BOTAN_UNUSED.
std::vector< std::string > Botan::probe_providers_of | ( | const std::string & | algo_spec, |
const std::vector< std::string > & | possible | ||
) |
Definition at line 107 of file scan_name.h.
References probe_providers_of().
Referenced by probe_providers_of().
|
inline |
gf2m Botan::random_code_element | ( | uint16_t | 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::random_prime | ( | RandomNumberGenerator & | rng, |
size_t | bits, | ||
const BigInt & | coprime = 0 , |
||
size_t | equiv = 1 , |
||
size_t | equiv_mod = 2 , |
||
size_t | prob = 128 |
||
) |
Randomly generate a prime suitable for discrete logarithm parameters
rng | a random number generator |
bits | how large the resulting prime should be in bits |
coprime | a positive integer that (prime - 1) 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 |
prob | use test so false positive is bounded by 1/2**prob |
Definition at line 77 of file make_prm.cpp.
References Botan::BigInt::bits(), gcd(), high_bit(), Botan::BigInt::is_even(), is_lucas_probable_prime(), is_miller_rabin_probable_prime(), Botan::BigInt::is_negative(), Botan::BigInt::is_zero(), load_le< uint32_t >(), miller_rabin_test_iterations(), Botan::RandomNumberGenerator::next_byte(), PRIME_TABLE_SIZE, PRIMES, Botan::RandomNumberGenerator::randomize(), and Botan::BigInt::set_bit().
Referenced by Botan::DL_Group::DL_Group(), and random_safe_prime().
BigInt 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 268 of file make_prm.cpp.
References is_prime(), and random_prime().
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().
Referenced by Botan::TLS::Text_Policy::Text_Policy().
std::map< std::string, std::string > Botan::read_kv | ( | const std::string & | kv | ) |
Accepts key value pairs deliminated by commas:
"" (returns empty map) "K=V" (returns map {'K': 'V'}) "K1=V1,K2=V2" "K1=V1,K2=V2,K3=V3" "K1=V1,K2=V2,K3=a_value\,with\,commas_and_\=equals"
Values may be empty, keys must be non-empty and unique. Duplicate keys cause an exception.
Within both key and value, comma and equals can be escaped with backslash. Backslash can also be escaped.
Definition at line 12 of file read_kv.cpp.
References split_on().
|
inline |
Definition at line 65 of file ed25519_internal.h.
References X.
Referenced by sc_muladd(), and sc_reduce().
void Botan::redc_p192 | ( | BigInt & | x, |
secure_vector< word > & | ws | ||
) |
Definition at line 111 of file nistp_redc.cpp.
References bigint_cnd_add(), bigint_sub2(), BOTAN_ASSERT, BOTAN_ASSERT_NOMSG, BOTAN_DEBUG_ASSERT, BOTAN_UNUSED, Botan::BigInt::grow_to(), Botan::BigInt::mask_bits(), Botan::BigInt::mutable_data(), Botan::BigInt::size(), and Botan::CT::unpoison().
void Botan::redc_p224 | ( | BigInt & | x, |
secure_vector< word > & | ws | ||
) |
Definition at line 206 of file nistp_redc.cpp.
References bigint_cnd_add(), bigint_sub2(), BOTAN_ASSERT, BOTAN_ASSERT_NOMSG, BOTAN_DEBUG_ASSERT, BOTAN_UNUSED, Botan::BigInt::grow_to(), Botan::BigInt::mask_bits(), Botan::BigInt::mutable_data(), Botan::BigInt::size(), and Botan::CT::unpoison().
void Botan::redc_p256 | ( | BigInt & | x, |
secure_vector< word > & | ws | ||
) |
Definition at line 308 of file nistp_redc.cpp.
References bigint_cnd_add(), bigint_sub2(), BOTAN_ASSERT, BOTAN_ASSERT_NOMSG, BOTAN_DEBUG_ASSERT, BOTAN_UNUSED, Botan::BigInt::grow_to(), Botan::BigInt::mask_bits(), Botan::BigInt::mutable_data(), Botan::BigInt::size(), and Botan::CT::unpoison().
void Botan::redc_p384 | ( | BigInt & | x, |
secure_vector< word > & | ws | ||
) |
Definition at line 436 of file nistp_redc.cpp.
References bigint_cnd_add(), bigint_sub2(), BOTAN_ASSERT, BOTAN_ASSERT_NOMSG, BOTAN_DEBUG_ASSERT, BOTAN_UNUSED, Botan::BigInt::grow_to(), Botan::BigInt::mask_bits(), Botan::BigInt::mutable_data(), Botan::BigInt::size(), and Botan::CT::unpoison().
void Botan::redc_p521 | ( | BigInt & | x, |
secure_vector< word > & | ws | ||
) |
Definition at line 23 of file nistp_redc.cpp.
References bigint_add3_nc(), bigint_cnd_sub(), bigint_shr2(), BOTAN_ASSERT_EQUAL, carry(), clear_mem(), Botan::BigInt::data(), Botan::CT::Mask< T >::expand(), Botan::BigInt::grow_to(), Botan::CT::Mask< T >::is_equal(), Botan::BigInt::mask_bits(), MP_WORD_MAX, Botan::BigInt::mutable_data(), Botan::BigInt::resize(), Botan::BigInt::size(), and Botan::BigInt::word_at().
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 316 of file parsing.cpp.
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 303 of file parsing.cpp.
Compute the square root of x modulo a prime using the Tonelli-Shanks algorithm
x | the input |
p | the prime |
Definition at line 16 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 25 of file bswap.h.
References reverse_bytes().
Referenced by bswap_4(), load_be(), load_le(), reverse_bytes(), reverse_bytes(), and reverse_bytes().
|
inline |
Swap a 32 bit integer
Definition at line 37 of file bswap.h.
References reverse_bytes().
|
inline |
Swap a 64 bit integer
Definition at line 66 of file bswap.h.
References reverse_bytes().
secure_vector< uint8_t > 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 28 of file rfc3394.cpp.
References BOTAN_ARG_CHECK, Botan::BlockCipher::create_or_throw(), nist_key_unwrap(), and Botan::OctetString::size().
Referenced by botan_key_unwrap3394().
secure_vector< uint8_t > 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 14 of file rfc3394.cpp.
References BOTAN_ARG_CHECK, Botan::BlockCipher::create_or_throw(), nist_key_wrap(), and Botan::OctetString::size().
Referenced by botan_key_wrap3394().
size_t Botan::RFC4880_decode_count | ( | uint8_t | encoded_iter | ) |
Decode the iteration count from RFC 4880 encoding
Definition at line 69 of file pgp_s2k.cpp.
Referenced by Botan::OpenPGP_S2K::decode_count(), and RFC4880_round_iterations().
uint8_t Botan::RFC4880_encode_count | ( | size_t | iterations | ) |
RFC 4880 encodes the iteration count to a single-byte value
Definition at line 56 of file pgp_s2k.cpp.
Referenced by Botan::OpenPGP_S2K::encode_count(), and RFC4880_round_iterations().
|
inline |
Round an arbitrary iteration count to next largest iteration count supported by RFC4880 encoding.
Definition at line 40 of file pgp_s2k.h.
References RFC4880_decode_count(), and RFC4880_encode_count().
Referenced by Botan::RFC4880_S2K_Family::tune().
Definition at line 96 of file rotate.h.
References rotl_var(), and T.
Definition at line 104 of file rotate.h.
References rotr_var(), and T.
Bit rotation left, variable rotation amount
input | the input word |
rot | the number of bits to rotate, must be between 0 and sizeof(T)*8-1 |
Definition at line 48 of file rotate.h.
References rotl_var(), and T.
Referenced by rotate_left(), and rotl_var().
Bit rotation right, variable rotation amount
input | the input word |
rot | the number of bits to rotate, must be between 0 and sizeof(T)*8-1 |
Definition at line 60 of file rotate.h.
References rotr_var(), and T.
Referenced by rotate_right(), and rotr_var().
Round down
n | an integer |
align_to | the alignment boundary |
Definition at line 37 of file rounding.h.
Referenced by Botan::Buffered_Filter::write().
|
inline |
Round up
n | a non-negative integer |
align_to | the alignment boundary |
Definition at line 21 of file rounding.h.
References BOTAN_ARG_CHECK.
Referenced by Botan::BigInt::binary_decode(), Botan::BigInt::bytes(), Botan::TLS::TLS_CBC_HMAC_AEAD_Encryption::finish(), monty_multi_exp(), Botan::PointGFp_Base_Point_Precompute::mul(), Botan::PointGFp_Var_Point_Precompute::mul(), Botan::PointGFp_Multi_Point_Precompute::multi_exp(), Botan::CBC_Encryption::output_length(), Botan::TLS::TLS_CBC_HMAC_AEAD_Encryption::output_length(), Botan::PointGFp_Base_Point_Precompute::PointGFp_Base_Point_Precompute(), Botan::BigInt::randomize(), and Botan::TLS::TLS_CBC_HMAC_AEAD_Encryption::set_associated_data().
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 84 of file version.cpp.
References short_version_string(), version_major(), version_minor(), and version_patch().
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 217 of file mem_ops.h.
References T.
Referenced by check_bcrypt(), Botan::PK_Verifier::check_signature(), Botan::Sodium::crypto_verify_16(), Botan::Sodium::crypto_verify_32(), Botan::Sodium::crypto_verify_64(), Botan::TLS::Session::decrypt(), and Botan::RTSS_Share::reconstruct().
void Botan::sc_muladd | ( | uint8_t * | s, |
const uint8_t * | a, | ||
const uint8_t * | b, | ||
const uint8_t * | c | ||
) |
Definition at line 26 of file sc_muladd.cpp.
References load_3(), load_4(), and redc_mul().
Referenced by ed25519_sign().
void Botan::sc_reduce | ( | uint8_t * | s | ) |
Definition at line 25 of file sc_reduce.cpp.
References load_3(), load_4(), and redc_mul().
Referenced by ed25519_sign(), and ed25519_verify().
void Botan::scrypt | ( | uint8_t | output[], |
size_t | output_len, | ||
const char * | password, | ||
size_t | password_len, | ||
const uint8_t | salt[], | ||
size_t | salt_len, | ||
size_t | N, | ||
size_t | r, | ||
size_t | p | ||
) |
Scrypt key derivation function (RFC 7914)
output | the output will be placed here |
output_len | length of output |
password | the user password |
password_len | length of password |
salt | the salt |
salt_len | length of salt |
N | the CPU/Memory cost parameter, must be power of 2 |
r | the block size parameter |
p | the parallelization parameter |
Suitable parameters for most uses would be N = 32768, r = 8, p = 1
Scrypt uses approximately (p + N + 1) * 128 * r bytes of memory
Definition at line 211 of file scrypt.cpp.
References cast_char_ptr_to_uint8(), Botan::MessageAuthenticationCode::create_or_throw(), pbkdf2(), and salt_len.
Referenced by Botan::Scrypt::derive_key(), scrypt(), and Botan::Scrypt_Family::tune().
|
inline |
Scrypt key derivation function (RFC 7914) Before 2.8 this function was the primary interface for scrypt
output | the output will be placed here |
output_len | length of output |
password | the user password |
salt | the salt |
salt_len | length of salt |
N | the CPU/Memory cost parameter, must be power of 2 |
r | the block size parameter |
p | the parallelization parameter |
Suitable parameters for most uses would be N = 32768, r = 8, p = 1
Scrypt uses approximately (p + N + 1) * 128 * r bytes of memory
Definition at line 109 of file scrypt.h.
|
inline |
Definition at line 120 of file scrypt.h.
Referenced by Botan::Scrypt::total_memory_usage(), and Botan::Scrypt_Family::tune().
|
inline |
Definition at line 63 of file stl_util.h.
|
inline |
Definition at line 52 of file stl_util.h.
Referenced by Botan::HTTP::http_sync().
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 66 of file os_utils.cpp.
Referenced by botan_scrub_mem(), deallocate_memory(), Botan::OS::free_locked_pages(), Botan::GHASH::ghash_update(), Botan::Sodium::sodium_free(), Botan::Sodium::sodium_memzero(), Botan::FE_25519::~FE_25519(), and Botan::newhope_poly::~newhope_poly().
|
inline |
|
inline |
Definition at line 53 of file sha3_round.h.
References T.
Referenced by Botan::SHA_3::permute().
const char * Botan::short_version_cstr | ( | ) |
Same as version_short_string except returning a pointer to the string.
Definition at line 22 of file version.cpp.
References STR.
Referenced by short_version_string().
std::string Botan::short_version_string | ( | ) |
Return a version string of the form "MAJOR.MINOR.PATCH" where each of the values is an integer.
Definition at line 70 of file version.cpp.
References short_version_cstr().
Referenced by runtime_version_check().
bool Botan::sig_algo_and_pad_ok | ( | const std::string | algo, |
const std::string | padding | ||
) |
Returns true iff the given padding scheme is valid for the given signature algorithm (key type).
algo | the signature algorithm to be used |
padding | the padding scheme to be used |
Definition at line 39 of file padding.cpp.
References get_sig_paddings().
Referenced by Botan::EMSA1::config_for_x509(), Botan::EMSA_PKCS1v15::config_for_x509(), and Botan::PSSR::config_for_x509().
Return the number of significant bytes in n
n | an integer value |
Definition at line 77 of file bit_ops.h.
std::vector< uint8_t > Botan::sm2_compute_za | ( | HashFunction & | hash, |
const std::string & | user_id, | ||
const EC_Group & | domain, | ||
const PointGFp & | pubkey | ||
) |
Definition at line 52 of file sm2.cpp.
References Botan::BigInt::encode_1363(), Botan::EC_Group::get_a(), Botan::PointGFp::get_affine_x(), Botan::PointGFp::get_affine_y(), Botan::EC_Group::get_b(), get_byte(), Botan::EC_Group::get_g_x(), Botan::EC_Group::get_g_y(), Botan::EC_Group::get_p_bytes(), and hash.
Referenced by botan_pubkey_sm2_compute_za().
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 148 of file parsing.cpp.
References split_on_pred().
Referenced by argon2_check_pwhash(), Botan::AEAD_Mode::create(), Botan::Cipher_Mode::create(), Botan::PKCS11::MechanismWrapper::create_ecdh_mechanism(), create_private_key(), Botan::TLS::Text_Policy::get_list(), Botan::X509_Object::hash_used_for_signature(), Botan::TLS::Text_Policy::key_exchange_groups(), load_public_key(), pbes2_decrypt(), read_kv(), string_to_ipv4(), Botan::X509_Object::verify_signature(), Botan::OCSP::Response::verify_signature(), and Botan::X509_Cert_Options::X509_Cert_Options().
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 |
This function will likely be removed in a future release
Definition at line 153 of file parsing.cpp.
Referenced by split_on().
x | an integer |
Definition at line 19 of file mp_numth.cpp.
References Botan::BigInt::square().
Referenced by Botan::Modular_Reducer::cube(), and Botan::Modular_Reducer::square().
std::pair< BigInt, SymmetricKey > Botan::srp6_client_agree | ( | const std::string & | username, |
const std::string & | password, | ||
const DL_Group & | group, | ||
const std::string & | hash_id, | ||
const std::vector< uint8_t > & | salt, | ||
const BigInt & | B, | ||
size_t | a_bits, | ||
RandomNumberGenerator & | rng | ||
) |
SRP6a Client side
username | the username we are attempting login for |
password | the password we are attempting to use |
group | 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 |
a_bits | size of secret exponent in bits |
rng | is a random number generator |
Definition at line 92 of file srp6.cpp.
References Botan::BigInt::encode_1363(), Botan::DL_Group::get_g(), Botan::DL_Group::get_p(), Botan::DL_Group::mod_p(), Botan::DL_Group::p_bytes(), Botan::DL_Group::power_g_p(), and power_mod().
std::pair< BigInt, SymmetricKey > 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 77 of file srp6.cpp.
References Botan::DL_Group::exponent_bits(), and srp6_client_agree().
Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), and srp6_client_agree().
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 53 of file srp6.cpp.
References Botan::BigInt::bits(), Botan::DL_Group::get_g(), and Botan::DL_Group::get_p().
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 438 of file loadstor.h.
References get_byte(), and typecast_copy().
Referenced by Botan::TLS::Connection_Cipher_State::aead_nonce(), Botan::TLS::Connection_Cipher_State::aead_nonce(), Botan::BigInt::binary_encode(), copy_out_be(), Botan::FPE_FE1::decrypt(), Botan::Blowfish::decrypt_n(), Botan::CAST_128::decrypt_n(), Botan::CAST_256::decrypt_n(), Botan::KASUMI::decrypt_n(), Botan::MISTY1::decrypt_n(), Botan::Noekeon::decrypt_n(), Botan::SEED::decrypt_n(), Botan::SHACAL2::decrypt_n(), Botan::SM4::decrypt_n(), Botan::XTEA::decrypt_n(), Botan::FPE_FE1::encrypt(), Botan::TLS::Session::encrypt(), Botan::Blowfish::encrypt_n(), Botan::CAST_128::encrypt_n(), Botan::CAST_256::encrypt_n(), Botan::KASUMI::encrypt_n(), Botan::MISTY1::encrypt_n(), Botan::Noekeon::encrypt_n(), Botan::SEED::encrypt_n(), Botan::SHACAL2::encrypt_n(), Botan::SM4::encrypt_n(), Botan::XTEA::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(), nist_key_wrap_padded(), Botan::CTR_BE::seek(), Botan::SIMD_4x32::store_be(), store_be(), store_be(), store_be(), Botan::Buffered_Computation::update_be(), Botan::Buffered_Computation::update_be(), Botan::Buffered_Computation::update_be(), 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 470 of file loadstor.h.
References get_byte(), and typecast_copy().
|
inline |
Store a big-endian uint64_t
in | the input uint64_t |
out | the byte array to write to |
Definition at line 506 of file loadstor.h.
References get_byte(), and typecast_copy().
Store two big-endian words
out | the output byte array |
x0 | the first word |
x1 | the second word |
Definition at line 565 of file loadstor.h.
References store_be(), and T.
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 597 of file loadstor.h.
References store_be(), and T.
|
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 644 of file loadstor.h.
References store_be(), and T.
|
inline |
Store a little-endian uint16_t
in | the input uint16_t |
out | the byte array to write to |
Definition at line 454 of file loadstor.h.
References get_byte(), and typecast_copy().
Referenced by blamka_ssse3(), copy_out_le(), Botan::GOST_28147_89::decrypt_n(), Botan::Serpent::decrypt_n(), Botan::Threefish_512::decrypt_n(), Botan::Twofish::decrypt_n(), Botan::GOST_28147_89::encrypt_n(), Botan::Serpent::encrypt_n(), Botan::Threefish_512::encrypt_n(), Botan::Twofish::encrypt_n(), Botan::Streebog::final_result(), generate_mceliece_key(), Botan::Processor_RNG::randomize(), Botan::RandomNumberGenerator::randomize_with_ts_input(), Botan::Stateful_RNG::randomize_with_ts_input(), Botan::Salsa20::salsa_core(), Botan::ChaCha::seek(), Botan::Salsa20::seek(), Botan::Sodium::sodium_malloc(), Botan::SIMD_4x32::store_le(), store_le(), store_le(), store_le(), Botan::Buffered_Computation::update_le(), Botan::Buffered_Computation::update_le(), Botan::Buffered_Computation::update_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 488 of file loadstor.h.
References get_byte(), and typecast_copy().
|
inline |
Store a little-endian uint64_t
in | the input uint64_t |
out | the byte array to write to |
Definition at line 528 of file loadstor.h.
References get_byte(), and typecast_copy().
Store two little-endian words
out | the output byte array |
x0 | the first word |
x1 | the second word |
Definition at line 552 of file loadstor.h.
References store_le(), and T.
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 580 of file loadstor.h.
References store_le(), and T.
|
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 618 of file loadstor.h.
References store_le(), and T.
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 182 of file parsing.cpp.
Referenced by Botan::Parallel::name(), and Botan::CPUID::to_string().
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 253 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 59 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 721 of file polyn_gf2m.cpp.
References Botan::polyn_gf2m::get_degree(), lex_to_gray(), and Botan::polyn_gf2m::m_sp_field.
Referenced by generate_mceliece_key().
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 283 of file system_rng.cpp.
Referenced by Botan::System_RNG::accepts_input(), 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::clear(), Botan::System_RNG::is_seeded(), Botan::System_RNG::name(), Botan::Sodium::randombytes_buf(), Botan::System_RNG::randomize(), and Botan::Stateful_RNG::randomize_with_ts_input().
BOTAN_NORETURN void BOTAN_UNSTABLE_API Botan::throw_invalid_argument | ( | const char * | message, |
const char * | func, | ||
const char * | file | ||
) |
Called when an invalid argument is used Throws Invalid_Argument
Definition at line 13 of file assert.cpp.
BOTAN_NORETURN void BOTAN_UNSTABLE_API Botan::throw_invalid_state | ( | const char * | message, |
const char * | func, | ||
const char * | file | ||
) |
Called when an invalid state is encountered Throws Invalid_State
Definition at line 22 of file assert.cpp.
uint32_t Botan::timespec_to_u32bit | ( | const std::string & | timespec | ) |
Convert a time specification to a number
timespec | the time specification |
Definition at line 64 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().
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 11 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, CERT_SERIAL_NEGATIVE, CHAIN_LACKS_TRUST_ROOT, CHAIN_NAME_MISMATCH, CRL_BAD_SIGNATURE, CRL_HAS_EXPIRED, CRL_NOT_YET_VALID, DN_TOO_LONG, DUPLICATE_CERT_EXTENSION, DUPLICATE_CERT_POLICY, EXT_IN_V1_V2_CERT, INVALID_USAGE, NAME_CONSTRAINT_ERROR, NO_MATCHING_CRLDP, NO_REVOCATION_DATA, OCSP_BAD_STATUS, OCSP_CERT_NOT_LISTED, OCSP_HAS_EXPIRED, OCSP_IS_TOO_OLD, OCSP_ISSUER_NOT_FOUND, OCSP_NO_HTTP, OCSP_NO_REVOCATION_URL, OCSP_NOT_YET_VALID, OCSP_RESPONSE_GOOD, OCSP_RESPONSE_INVALID, OCSP_RESPONSE_MISSING_KEYUSAGE, OCSP_SERVER_NOT_AVAILABLE, OCSP_SIGNATURE_ERROR, OCSP_SIGNATURE_OK, POLICY_ERROR, SIGNATURE_ALGO_BAD_PARAMS, SIGNATURE_ALGO_UNKNOWN, SIGNATURE_ERROR, SIGNATURE_METHOD_TOO_WEAK, UNKNOWN_CRITICAL_EXTENSION, UNTRUSTED_HASH, V2_IDENTIFIERS_IN_V1_CERT, VALID_CRL_CHECKED, and VERIFIED.
|
inline |
Definition at line 25 of file stl_util.h.
std::string Botan::to_string | ( | ErrorType | type | ) |
Convert an ErrorType to string.
Definition at line 11 of file exceptn.cpp.
References Bzip2Error, CommonCryptoError, DatabaseError, DecodingFailure, EncodingFailure, HttpError, InternalError, InvalidArgument, InvalidKeyLength, InvalidNonceLength, InvalidObjectState, InvalidTag, IoError, KeyNotSet, LookupError, LzmaError, NotImplemented, OpenSSLError, OutOfMemory, Pkcs11Error, RoughtimeError, SystemError, TLSError, TPMError, type, Unknown, and ZlibError.
Referenced by botan_x509_cert_validation_status(), Botan::BotanErrorCategory::message(), and Botan::Path_Validation_Result::status_string().
uint32_t Botan::to_u32bit | ( | const std::string & | str | ) |
Convert a string to a number
str | the string to convert |
Definition at line 35 of file parsing.cpp.
Referenced by Botan::SCAN_Name::arg_as_integer(), argon2_check_pwhash(), create_private_key(), Botan::Data_Store::get1_uint32(), Botan::TLS::Text_Policy::get_len(), Botan::HTTP::http_sync(), string_to_ipv4(), timespec_to_u32bit(), and to_uint16().
uint16_t Botan::to_uint16 | ( | const std::string & | str | ) |
Convert a string to a number
str | the string to convert |
Definition at line 25 of file parsing.cpp.
References to_u32bit().
Referenced by check_bcrypt(), and Botan::TLS::Text_Policy::srtp_profiles().
std::string Botan::tolower_string | ( | const std::string & | in | ) |
Definition at line 327 of file parsing.cpp.
Referenced by host_wildcard_match().
|
inlinenoexcept |
Definition at line 168 of file mem_ops.h.
References BOTAN_IS_TRIVIALLY_COPYABLE.
Definition at line 162 of file mem_ops.h.
References typecast_copy().
Definition at line 157 of file mem_ops.h.
References typecast_copy().
Definition at line 145 of file mem_ops.h.
References BOTAN_IS_TRIVIALLY_COPYABLE, and T.
Referenced by Botan::Roughtime::Response::from_bits(), load_be(), load_be< uint16_t >(), load_be< uint32_t >(), load_be< uint64_t >(), load_le(), load_le< uint16_t >(), load_le< uint32_t >(), load_le< uint64_t >(), store_be(), store_be(), store_be(), store_le(), store_le(), store_le(), typecast_copy(), typecast_copy(), xor_buf(), and xor_buf().
std::string BOTAN_UNSTABLE_API Botan::ucs2_to_utf8 | ( | const uint8_t | ucs2[], |
size_t | len | ||
) |
Convert a sequence of UCS-2 (big endian) characters to a UTF-8 string This is used for ASN.1 BMPString type
ucs2 | the sequence of UCS-2 characters |
len | length of ucs2 in bytes, must be a multiple of 2 |
Definition at line 61 of file charset.cpp.
References load_be< uint16_t >().
Referenced by Botan::ASN1_String::decode_from().
std::string BOTAN_UNSTABLE_API Botan::ucs4_to_utf8 | ( | const uint8_t | ucs4[], |
size_t | len | ||
) |
Convert a sequence of UCS-4 (big endian) characters to a UTF-8 string This is used for ASN.1 UniversalString type
ucs4 | the sequence of UCS-4 characters |
len | length of ucs4 in bytes, must be a multiple of 4 |
Definition at line 78 of file charset.cpp.
References load_be< uint32_t >().
Referenced by Botan::ASN1_String::decode_from().
std::vector< T > Botan::unlock | ( | const secure_vector< T > & | in | ) |
Definition at line 72 of file secmem.h.
Referenced by Botan::OCSP::CertID::CertID(), Botan::Roughtime::Chain::Chain(), Botan::DL_Group::DL_Group(), Botan::DL_Group::DL_Group_from_PEM(), Botan::PK_Ops::Encryption_with_EME::encrypt(), Botan::KeyPair::encryption_consistency_check(), Botan::OCSP::CertID::is_id_for(), Botan::DL_Group::PEM_decode(), Botan::DH_PublicKey::public_value(), Botan::Cipher_Mode_Filter::set_iv(), and Botan::PK_Signer::signature().
std::string BOTAN_UNSTABLE_API Botan::utf8_to_latin1 | ( | const std::string & | utf8 | ) |
Convert a UTF-8 string to Latin-1 If a character outside the Latin-1 range is encountered, an exception is thrown.
Definition at line 98 of file charset.cpp.
Referenced by Botan::ASN1_String::iso_8859(), and Botan::Charset::transcode().
Existence check for values
Definition at line 86 of file stl_util.h.
Referenced by Botan::TLS::Policy::acceptable_ciphersuite(), Botan::TLS::Policy::allowed_signature_hash(), Botan::TLS::Policy::allowed_signature_method(), Botan::TLS::Policy::choose_key_exchange_group(), Botan::TLS::Policy::ciphersuite_list(), and Botan::TLS::Client_Hello::Client_Hello().
|
inline |
void BOTAN_UNSTABLE_API Botan::vartime_divide | ( | const BigInt & | x, |
const BigInt & | y, | ||
BigInt & | q, | ||
BigInt & | r | ||
) |
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 159 of file divide.cpp.
References bigint_divop(), BOTAN_ASSERT_NOMSG, BOTAN_DEBUG_ASSERT, Botan::BigInt::grow_to(), Botan::CT::Mask< T >::is_equal(), Botan::BigInt::is_negative(), Botan::BigInt::is_zero(), MP_WORD_MAX, Botan::BigInt::mutable_data(), Botan::BigInt::Positive, Botan::BigInt::reduce_below(), Botan::BigInt::set_sign(), Botan::BigInt::sig_words(), Botan::BigInt::top_bits_free(), and Botan::BigInt::word_at().
Referenced by botan_mp_div(), operator%(), operator/(), and operator/().
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 |
Invalid_Argument | if the given constraints are not permitted for this key |
Definition at line 70 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, name, and NON_REPUDIATION.
Referenced by Botan::X509::create_cert_req(), and Botan::X509::create_self_signed_cert().
|
inline |
const char * Botan::version_cstr | ( | ) |
Same as version_string() except returning a pointer to a statically allocated string.
Definition at line 33 of file version.cpp.
References STR.
Referenced by botan_version_string(), and version_string().
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 75 of file version.cpp.
Referenced by botan_version_datestamp().
uint32_t Botan::version_major | ( | ) |
Get the major version number.
Definition at line 80 of file version.cpp.
Referenced by botan_version_major(), and runtime_version_check().
uint32_t Botan::version_minor | ( | ) |
Get the minor version number.
Definition at line 81 of file version.cpp.
Referenced by botan_version_minor(), and runtime_version_check().
uint32_t Botan::version_patch | ( | ) |
Get the patch number.
Definition at line 82 of file version.cpp.
Referenced by botan_version_patch(), and runtime_version_check().
std::string Botan::version_string | ( | ) |
Get a human-readable string identifying the version of Botan. No particular format should be assumed.
Definition at line 65 of file version.cpp.
References version_cstr().
|
inline |
Definition at line 500 of file mp_asmi.h.
Referenced by bigint_monty_redc_16(), bigint_monty_redc_24(), bigint_monty_redc_32(), bigint_monty_redc_4(), bigint_monty_redc_6(), and bigint_monty_redc_8().
|
inline |
Definition at line 451 of file mp_asmi.h.
References carry(), and word_madd2().
Referenced by bigint_comba_mul16(), bigint_comba_mul24(), bigint_comba_mul4(), bigint_comba_mul6(), bigint_comba_mul8(), bigint_comba_mul9(), bigint_comba_sqr16(), bigint_comba_sqr24(), bigint_comba_sqr4(), bigint_comba_sqr6(), bigint_comba_sqr8(), bigint_comba_sqr9(), bigint_monty_redc_16(), bigint_monty_redc_24(), bigint_monty_redc_32(), bigint_monty_redc_4(), bigint_monty_redc_6(), and bigint_monty_redc_8().
|
inline |
Definition at line 536 of file mp_asmi.h.
References carry(), word_add(), and word_madd2().
Referenced by bigint_comba_sqr16(), bigint_comba_sqr24(), bigint_comba_sqr4(), bigint_comba_sqr6(), bigint_comba_sqr8(), and bigint_comba_sqr9().
|
inline |
Definition at line 138 of file mp_asmi.h.
References carry(), and word_add().
Referenced by bigint_add2_nc().
|
inline |
Definition at line 173 of file mp_asmi.h.
References carry(), and word_add().
Referenced by bigint_add3_nc(), bigint_cnd_add(), bigint_cnd_add_or_sub(), and bigint_cnd_addsub().
|
inline |
Definition at line 346 of file mp_asmi.h.
References carry(), and word_madd2().
Referenced by bigint_linmul2().
|
inline |
Definition at line 381 of file mp_asmi.h.
References carry(), and word_madd2().
Referenced by bigint_linmul3().
|
inline |
Definition at line 415 of file mp_asmi.h.
References carry(), and word_madd3().
|
inline |
Definition at line 240 of file mp_asmi.h.
References carry(), and word_sub().
Referenced by bigint_sub2().
|
inline |
Definition at line 275 of file mp_asmi.h.
References carry(), and word_sub().
Referenced by bigint_sub2_rev().
|
inline |
Definition at line 310 of file mp_asmi.h.
References carry(), and word_sub().
Referenced by bigint_cnd_add_or_sub(), bigint_cnd_addsub(), bigint_cnd_sub(), bigint_sub3(), and bigint_sub_abs().
|
inline |
Definition at line 107 of file mp_asmi.h.
References carry().
Referenced by bigint_add2_nc(), bigint_add3_nc(), bigint_cnd_abs(), bigint_cnd_add(), bigint_cnd_add_or_sub(), bigint_cnd_addsub(), word3_muladd_2(), word8_add2(), and word8_add3().
|
inline |
Definition at line 46 of file mp_madd.h.
References carry(), and mul64x64_128().
Referenced by bigint_linmul2(), bigint_linmul3(), bigint_modop(), word3_muladd(), word3_muladd_2(), word8_linmul2(), and word8_linmul3().
|
inline |
Definition at line 92 of file mp_madd.h.
References carry(), and mul64x64_128().
Referenced by word8_madd3().
|
inline |
Definition at line 209 of file mp_asmi.h.
References carry().
Referenced by bigint_cnd_add_or_sub(), bigint_cnd_addsub(), bigint_cnd_sub(), bigint_monty_redc_4(), bigint_monty_redc_6(), bigint_monty_redc_8(), bigint_sub2(), bigint_sub2_rev(), bigint_sub3(), bigint_sub_abs(), word8_sub2(), word8_sub2_rev(), and word8_sub3().
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 212 of file parsing.cpp.
References Botan::Charset::caseless_cmp(), and Botan::Charset::is_space().
Referenced by operator<(), and operator==().
Path_Validation_Result 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 | timeout for OCSP operations, 0 disables OCSP check |
ocsp_resp | additional OCSP responses to consider (eg from peer) |
Definition at line 944 of file x509path.cpp.
References x509_path_validate().
Path_Validation_Result 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 (with end entity certificate in end_certs[0]) |
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 850 of file x509path.cpp.
References Botan::Path_Validation_Restrictions::max_ocsp_age(), 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(), Botan::Path_Validation_Result::successful_validation(), and Botan::Path_Validation_Restrictions::trusted_hashes().
Referenced by botan_x509_cert_verify(), botan_x509_cert_verify_with_crl(), Botan::TLS::Callbacks::tls_verify_cert_chain(), x509_path_validate(), x509_path_validate(), and x509_path_validate().
Path_Validation_Result 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 960 of file x509path.cpp.
References x509_path_validate().
Path_Validation_Result 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 | timeout for OCSP operations, 0 disables OCSP check |
ocsp_resp | additional OCSP responses to consider (eg from peer) |
Definition at line 929 of file x509path.cpp.
References x509_path_validate().
void Botan::xor_buf | ( | std::vector< uint8_t, Alloc > & | out, |
const std::vector< uint8_t, Alloc2 > & | in, | ||
size_t | n | ||
) |
void Botan::xor_buf | ( | std::vector< uint8_t, Alloc > & | out, |
const uint8_t * | in, | ||
const std::vector< uint8_t, Alloc2 > & | in2, | ||
size_t | n | ||
) |
void Botan::xor_buf | ( | std::vector< uint8_t, Alloc > & | out, |
const uint8_t * | in, | ||
size_t | n | ||
) |
|
inline |
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 |
Definition at line 297 of file mem_ops.h.
References typecast_copy().
|
inline |
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 262 of file mem_ops.h.
References typecast_copy().
Referenced by Botan::TLS::Connection_Cipher_State::aead_nonce(), Botan::TLS::Connection_Cipher_State::aead_nonce(), aont_package(), aont_unpackage(), Botan::XMSS_WOTS_PublicKey::chain(), Botan::ChaCha::cipher(), Botan::CTR_BE::cipher(), Botan::OFB::cipher(), Botan::RC4::cipher(), Botan::Salsa20::cipher(), Botan::SHAKE_128_Cipher::cipher(), Botan::DESX::decrypt_n(), Botan::Lion::decrypt_n(), Botan::BlockCipher::decrypt_n_xex(), Botan::Block_Cipher_Fixed_Params< BS, KMIN, KMAX, KMOD, BaseClass >::decrypt_n_xex(), Botan::DESX::encrypt_n(), Botan::Lion::encrypt_n(), Botan::BlockCipher::encrypt_n_xex(), Botan::Block_Cipher_Fixed_Params< BS, KMIN, KMAX, KMOD, BaseClass >::encrypt_n_xex(), Botan::CCM_Encryption::finish(), Botan::CCM_Decryption::finish(), Botan::EAX_Encryption::finish(), Botan::OCB_Encryption::finish(), Botan::OCB_Decryption::finish(), Botan::CTS_Encryption::finish(), Botan::CTS_Decryption::finish(), Botan::XTS_Encryption::finish(), Botan::XTS_Decryption::finish(), mgf1_mask(), operator^(), Botan::OctetString::operator^=(), operator^=(), pbkdf2(), Botan::CBC_Encryption::process(), Botan::CBC_Decryption::process(), Botan::CFB_Encryption::process(), Botan::SIV_Mode::S2V(), xor_buf(), xor_buf(), and xor_buf().
Zeroise the values then free the memory
vec | the vector to zeroise and free |
Definition at line 124 of file secmem.h.
References zeroise().
Referenced by Botan::AES_128::clear(), Botan::AES_192::clear(), Botan::AES_256::clear(), Botan::ARIA_128::clear(), Botan::ARIA_192::clear(), Botan::ARIA_256::clear(), Botan::Blowfish::clear(), Botan::Camellia_128::clear(), Botan::Camellia_192::clear(), Botan::Camellia_256::clear(), Botan::CAST_128::clear(), Botan::CAST_256::clear(), Botan::DES::clear(), Botan::TripleDES::clear(), Botan::DESX::clear(), Botan::GOST_28147_89::clear(), Botan::IDEA::clear(), Botan::KASUMI::clear(), Botan::Lion::clear(), Botan::MISTY1::clear(), Botan::Noekeon::clear(), Botan::SEED::clear(), Botan::Serpent::clear(), Botan::SHACAL2::clear(), Botan::SM4::clear(), Botan::Threefish_512::clear(), Botan::Twofish::clear(), Botan::XTEA::clear(), Botan::CBC_MAC::clear(), Botan::HMAC::clear(), Botan::Poly1305::clear(), Botan::SipHash::clear(), Botan::ANSI_X919_MAC::clear(), Botan::ChaCha::clear(), Botan::CTR_BE::clear(), Botan::RC4::clear(), Botan::Salsa20::clear(), Botan::SHAKE_128_Cipher::clear(), and Botan::GHASH::clear().
Zeroise the values; length remains unchanged
vec | the vector to zeroise |
Definition at line 114 of file secmem.h.
References clear_mem().
Referenced by aont_package(), aont_unpackage(), Botan::BLAKE2b::clear(), Botan::GOST_34_11::clear(), Botan::Keccak_1600::clear(), Botan::MD5::clear(), Botan::MDx_HashFunction::clear(), Botan::RIPEMD_160::clear(), Botan::SHA_160::clear(), Botan::SHA_3::clear(), Botan::SHAKE_128::clear(), Botan::SHAKE_256::clear(), Botan::Skein_512::clear(), Botan::Streebog::clear(), Botan::Tiger::clear(), Botan::Whirlpool::clear(), Botan::CMAC::clear(), Botan::GMAC::clear(), Botan::CTR_BE::clear(), Botan::OFB::clear(), Botan::Streebog::final_result(), Botan::MDx_HashFunction::final_result(), Botan::OCB_Encryption::finish(), Botan::OCB_Decryption::finish(), Botan::OctetString::operator^=(), Botan::GHASH::reset(), Botan::OCB_Mode::reset(), Botan::CBC_Decryption::reset(), Botan::CFB_Mode::reset(), Botan::CTR_BE::seek(), Botan::GHASH::set_associated_data(), Botan::CTR_BE::set_iv(), Botan::OFB::set_iv(), and zap().
const std::map<const std::string, std::vector<std::string> > Botan::allowed_signature_paddings |
Definition at line 20 of file padding.cpp.
Referenced by get_sig_paddings().
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 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 18 of file hex_filt.cpp.
Referenced by Botan::Hex_Decoder::Hex_Decoder(), Botan::Hex_Encoder::Hex_Encoder(), and Botan::Hex_Encoder::Hex_Encoder().
const word Botan::MP_WORD_MAX = ~static_cast<word>(0) |
Definition at line 22 of file mp_core.h.
Referenced by monty_inverse(), redc_p521(), and vartime_divide().
const size_t Botan::PRIME_TABLE_SIZE = 6541 |
The size of the PRIMES[] array
Definition at line 287 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 odd primes less than 65535
Definition at line 12 of file primes.cpp.
Referenced by Botan::DL_Group::DL_Group(), is_prime(), and random_prime().
|
extern |
Definition at line 34 of file streebog_precalc.cpp.
|
extern |
Definition at line 742 of file streebog_precalc.cpp.
Referenced by Botan::Streebog::compress_64().