Botan 3.3.0
Crypto and TLS for C&
|
Namespaces | |
namespace | AES_AARCH64 |
namespace | ARIA_F |
namespace | ASN1 |
namespace | Camellia_F |
namespace | Cert_Extension |
namespace | concepts |
namespace | CryptoBox |
namespace | CT |
namespace | detail |
namespace | details |
namespace | Dilithium |
namespace | fmt_detail |
namespace | FPE |
namespace | HTTP |
namespace | KeyPair |
namespace | Kuznyechik_F |
namespace | OCSP |
namespace | OIDS |
namespace | OS |
namespace | PEM_Code |
namespace | PK_Ops |
namespace | PKCS11 |
namespace | PKCS8 |
namespace | PKIX |
namespace | ranges |
namespace | Roughtime |
namespace | Serpent_F |
namespace | SHA1_F |
namespace | SHA1_SSE2_F |
namespace | Sodium |
namespace | Threefish_F |
namespace | TLS |
namespace | X509 |
Concepts | |
concept | md_hash_implementation |
concept | updatable_object |
concept | appendable_object |
concept | absorbing_object |
Typedefs | |
typedef __vector unsigned int | Altivec32x4 |
typedef __vector unsigned long long | Altivec64x2 |
typedef __vector unsigned char | Altivec8x16 |
using | byte = std::uint8_t |
typedef int32_t | CCCryptorStatus |
typedef std::vector< std::set< Certificate_Status_Code > > | CertificatePathStatusCodes |
typedef FE_25519 | fe |
using | ForsLeafSecret = Strong<secure_vector<uint8_t>, struct ForsLeafSecret_> |
using | ForsSignature = Strong<std::vector<uint8_t>, struct ForsSignature_> |
using | FrodoDomainSeparator = Strong<std::array<uint8_t, 1>, struct FrodoDoaminSeparator_> |
using | FrodoIntermediateSharedSecret = Strong<secure_vector<uint8_t>, struct FrodoIntermediateSharedSecret_> |
using | FrodoPackedMatrix = Strong<std::vector<uint8_t>, struct FrodoPackedMatrix_> |
using | FrodoPlaintext = Strong<secure_vector<uint8_t>, struct FrodoPlaintext_> |
using | FrodoPublicKeyHash = Strong<std::vector<uint8_t>, struct FrodoPublicKeyHash_> |
using | FrodoSalt = Strong<std::vector<uint8_t>, struct FrodoSalt_> |
using | FrodoSampleR = Strong<secure_vector<uint8_t>, struct FrodoSampleR_> |
using | FrodoSeedA = Strong<std::vector<uint8_t>, struct FrodoSeedA_> |
using | FrodoSeedS = Strong<secure_vector<uint8_t>, struct FrodoSeedS_> |
using | FrodoSeedSE = Strong<secure_vector<uint8_t>, struct FrodoSeedSE_> |
using | FrodoSeedZ = Strong<std::vector<uint8_t>, struct FrodoSeedZ_> |
using | FrodoSerializedMatrix = Strong<secure_vector<uint8_t>, struct FrodoSerializedMatrix_> |
using | GenerateLeafFunction = std::function<void(StrongSpan<SphincsTreeNode> , TreeNodeIndex)> |
typedef uint16_t | gf2m |
using | HypertreeLayerIndex = Strong<uint32_t, struct HypertreeLayerIndex_> |
Index of a layer in the XMSS hyper-tree. | |
using | InitializationVector = OctetString |
typedef Invalid_Authentication_Tag | Integrity_Failure |
template<typename T > | |
using | lock_guard_type = lock_guard<T> |
typedef MessageAuthenticationCode | MAC |
using | mutex_type = noop_mutex |
typedef EC_Point | PointGFp |
using | recursive_mutex_type = noop_mutex |
typedef RandomNumberGenerator | RNG |
typedef PBKDF | S2K |
using | s32bit = std::int32_t |
template<typename T > | |
using | secure_deque = std::deque<T, secure_allocator<T>> |
template<typename T > | |
using | secure_vector = std::vector<T, secure_allocator<T>> |
template<typename T > | |
using | SecureVector = secure_vector<T> |
typedef SM2_PrivateKey | SM2_Encryption_PrivateKey |
typedef SM2_PublicKey | SM2_Encryption_PublicKey |
typedef SM2_PrivateKey | SM2_Signature_PrivateKey |
typedef SM2_PublicKey | SM2_Signature_PublicKey |
using | SphincsAuthenticationPath = Strong<std::vector<uint8_t>, struct SphincsAuthenticationPath_> |
using | SphincsHashedMessage = Strong<std::vector<uint8_t>, struct SphincsHashedMessage_> |
using | SphincsHypertreeSignature = Strong<std::vector<uint8_t>, struct SphincsXmssSignature_> |
using | SphincsMessageRandomness = Strong<secure_vector<uint8_t>, struct SphincsMessageRandomness_> |
using | SphincsOptionalRandomness = Strong<secure_vector<uint8_t>, struct SphincsOptionalRandomness_> |
using | SphincsPublicSeed = Strong<std::vector<uint8_t>, struct SphincsPublicSeed_> |
using | SphincsSecretPRF = Strong<secure_vector<uint8_t>, struct SphincsSecretPRF_> |
using | SphincsSecretSeed = Strong<secure_vector<uint8_t>, struct SphincsSecretSeed_> |
using | SphincsTreeNode = Strong<std::vector<uint8_t>, struct SphincsTreeNode_> |
Either an XMSS or FORS tree node or leaf. | |
using | SphincsXmssSignature = Strong<std::vector<uint8_t>, struct SphincsXmssSignature_> |
using | SymmetricKey = OctetString |
using | TreeLayerIndex = Strong<uint32_t, struct TreeLayerIndex_, EnableArithmeticWithPlainNumber> |
Index of the layer within a FORS/XMSS tree. | |
using | TreeNodeIndex = Strong<uint32_t, struct TreeNodeIndex_, EnableArithmeticWithPlainNumber> |
Index of an individual node inside an XMSS or FORS tree. | |
using | u16bit = std::uint16_t |
using | u32bit = std::uint32_t |
using | u64bit = std::uint64_t |
typedef std::vector< secure_vector< uint8_t > > | wots_keysig_t |
using | WotsChainIndex = Strong<uint32_t, struct WotsChainIndex_> |
Index of a WOTS chain within a single usage of WOTS. | |
using | WotsHashIndex = Strong<uint8_t, struct WotsHashIndex_, EnableArithmeticWithPlainNumber> |
Index of a hash application inside a single WOTS chain (integers in "base_w") | |
using | WotsNode = Strong<secure_vector<uint8_t>, struct WotsNode_> |
Start (or intermediate) node of a WOTS+ chain. | |
using | WotsPublicKey = Strong<std::vector<uint8_t>, struct WotsPublicKey_> |
using | WotsPublicKeyNode = Strong<std::vector<uint8_t>, struct WotsPublicKeyNode_> |
End node of a WOTS+ chain (part of the WOTS+ public key) | |
using | WotsSignature = Strong<secure_vector<uint8_t>, struct WotsSignature_> |
typedef Curve25519_PrivateKey | X25519_PrivateKey |
typedef Curve25519_PublicKey | X25519_PublicKey |
typedef ASN1_Time | X509_Time |
using | XmssTreeIndexInLayer = Strong<uint64_t, struct XmssTreeIndexInLayer_, EnableArithmeticWithPlainNumber> |
Index of an XMSS tree (unique for just the local hyper-tree layer) | |
Functions | |
BigInt | abs (const BigInt &n) |
BOTAN_MALLOC_FN void * | allocate_memory (size_t elems, size_t elem_size) |
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 y, size_t p, size_t M, size_t t) |
bool | argon2_check_pwhash (const char *password, size_t password_len, std::string_view input_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, size_t salt_len, size_t output_len) |
std::string | asn1_class_to_string (ASN1_Class type) |
std::string | asn1_tag_to_string (ASN1_Type type) |
void | assert_unreachable (const char *file, int line) |
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 (std::string_view 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[], std::string_view 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) |
std::string | base32_encode (const uint8_t input[], size_t input_length) |
std::string | base32_encode (std::span< const uint8_t > input) |
std::vector< uint8_t > | base58_check_decode (const char input[], size_t input_length) |
std::vector< uint8_t > | base58_check_decode (std::string_view s) |
std::string | base58_check_encode (const uint8_t input[], size_t input_length) |
std::string | base58_check_encode (std::span< const uint8_t > vec) |
std::vector< uint8_t > | base58_decode (const char input[], size_t input_length) |
std::vector< uint8_t > | base58_decode (std::string_view s) |
std::string | base58_encode (const uint8_t input[], size_t input_length) |
std::string | base58_encode (std::span< const uint8_t > vec) |
secure_vector< uint8_t > | base64_decode (const char input[], size_t input_length, bool ignore_ws) |
size_t | base64_decode (std::span< uint8_t > output, std::string_view input, bool ignore_ws) |
secure_vector< uint8_t > | base64_decode (std::string_view 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[], std::string_view 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) |
std::string | base64_encode (const uint8_t input[], size_t input_length) |
std::string | base64_encode (std::span< const uint8_t > input) |
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) |
BOTAN_FUZZER_API void | basecase_mul (word z[], size_t z_size, const word x[], size_t x_size, const word y[], size_t y_size) |
BOTAN_FUZZER_API void | basecase_sqr (word z[], size_t z_size, const word x[], size_t x_size) |
void | bcrypt_pbkdf (uint8_t output[], size_t output_len, const char *password, size_t password_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_vartime (word n1, word n0, word d) |
word | 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_vartime (word n1, word n0, word d) |
void | bigint_monty_redc (word z[], const word p[], size_t p_size, word p_dash, word ws[], size_t ws_size) |
BOTAN_FUZZER_API void | bigint_monty_redc_16 (word z[32], const word p[16], word p_dash, word ws[]) |
BOTAN_FUZZER_API void | bigint_monty_redc_24 (word z[48], const word p[24], word p_dash, word ws[]) |
BOTAN_FUZZER_API void | bigint_monty_redc_32 (word z[64], const word p[32], word p_dash, word ws[]) |
BOTAN_FUZZER_API void | bigint_monty_redc_4 (word z[8], const word p[4], word p_dash, word ws[]) |
BOTAN_FUZZER_API void | bigint_monty_redc_6 (word z[12], const word p[6], word p_dash, word ws[]) |
BOTAN_FUZZER_API void | bigint_monty_redc_8 (word z[16], const word p[8], word p_dash, word ws[]) |
BOTAN_FUZZER_API void | bigint_monty_redc_generic (word z[], size_t z_size, const word p[], size_t p_size, 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 > | |
constexpr 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) |
BOTAN_FUNC_ISA ("avx2") void Argon2 | |
BOTAN_FUNC_ISA ("sse2") void IDEA | |
BOTAN_FUNC_ISA ("ssse3,aes") void AES_128 | |
BOTAN_FUNC_ISA (BOTAN_VPERM_ISA) size_t ZFEC | |
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) |
template<size_t S, int64_t MUL = 1> requires (S > 0 && S < 64) | |
void | carry (int64_t &h0, int64_t &h1) |
template<size_t S> requires (S > 0 && S < 32) | |
void | carry0 (int32_t &h0, int32_t &h1) |
template<size_t S> requires (S > 0 && S < 64) | |
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) |
template<typename T > requires (std::is_integral<T>::value && sizeof(T) < 32) | |
constexpr uint8_t | ceil_log2 (T x) |
template<typename T > requires (std::is_integral<T>::value) | |
constexpr T | ceil_tobytes (T bits) |
std::vector< WotsHashIndex > | chain_lengths (const SphincsTreeNode &msg, const Sphincs_Parameters ¶ms) |
bool | check_bcrypt (std::string_view pass, std::string_view hash) |
bool | check_passhash9 (std::string_view pass, std::string_view hash) |
size_t | checked_add (size_t x, size_t y, const char *file, int line) |
template<typename RT , typename AT > | |
RT | checked_cast_to (AT i) |
std::optional< size_t > | checked_mul (size_t x, size_t y) |
template<typename T > | |
constexpr T | choose (T mask, T a, T b) |
constexpr void | clear_bytes (void *ptr, size_t bytes) |
template<ranges::contiguous_output_range R> requires std::is_trivially_copyable_v<std::ranges::range_value_t<R>> | |
constexpr void | clear_mem (R &&mem) |
template<typename T > | |
constexpr 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 (std::string_view algo) |
CommonCryptor_Opts | commoncrypto_opts_from_algo_name (std::string_view algo_name) |
void | compute_root (StrongSpan< SphincsTreeNode > out, const Sphincs_Parameters ¶ms, Sphincs_Hash_Functions &hashes, const SphincsTreeNode &leaf, TreeNodeIndex leaf_idx, uint32_t idx_offset, StrongSpan< const SphincsAuthenticationPath > authentication_path, uint32_t total_tree_height, Sphincs_Address &tree_address) |
template<typename... Ts> | |
decltype(auto) | concat (Ts &&... buffers) |
template<typename ResultT , typename... Ts> | |
ResultT | concat_as (Ts &&... buffers) |
bool | constant_time_compare (const uint8_t x[], const uint8_t y[], size_t len) |
bool | constant_time_compare (std::span< const uint8_t > x, std::span< const uint8_t > y) |
template<ranges::contiguous_output_range OutR, ranges::contiguous_range InR> requires std::is_same_v<std::ranges::range_value_t<OutR>, std::ranges::range_value_t<InR>> && std::is_trivially_copyable_v<std::ranges::range_value_t<InR>> | |
constexpr void | copy_mem (OutR &&out, InR &&in) |
template<typename T > requires std::is_trivial<typename std::decay<T>::type>::value | |
constexpr 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) |
auto | create_aes_row_generator (const FrodoKEMConstants &constants, StrongSpan< const FrodoSeedA > seed_a) |
std::unique_ptr< Private_Key > | create_ec_private_key (std::string_view alg_name, const EC_Group &ec_group, RandomNumberGenerator &rng) |
std::string | create_hex_fingerprint (const uint8_t bits[], size_t bits_len, std::string_view hash_name) |
std::string | create_hex_fingerprint (std::span< const uint8_t > vec, std::string_view hash_name) |
std::unique_ptr< Private_Key > | create_private_key (std::string_view alg_name, RandomNumberGenerator &rng, std::string_view params, std::string_view provider) |
auto | create_shake_row_generator (const FrodoKEMConstants &constants, StrongSpan< const FrodoSeedA > seed_a) |
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_word (const BigInt &x, word y, BigInt &q_out, word &r_out) |
template<typename T > requires (std::is_integral<T>::value) | |
constexpr T | ct_is_zero (T x) |
BigInt | ct_modulo (const BigInt &x, const BigInt &y) |
template<typename T > requires (std::is_integral<T>::value) | |
constexpr 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) |
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) |
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) |
template<typename T > | |
uint16_t | expand_mask_16bit (T tst) |
void | expand_message_xmd (std::string_view hash_fn, uint8_t output[], size_t output_len, const uint8_t input[], size_t input_len, const uint8_t domain_sep[], size_t domain_sep_len) |
template<typename T > requires (std::is_integral<T>::value) | |
constexpr 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) |
template<typename... T> | |
std::string | fmt (std::string_view format, const T &... args) |
std::string | format_char_for_display (char c) |
SphincsTreeNode | fors_public_key_from_signature (const SphincsHashedMessage &hashed_message, StrongSpan< const ForsSignature > signature, const Sphincs_Address &address, const Sphincs_Parameters ¶ms, Sphincs_Hash_Functions &hashes) |
SphincsTreeNode | fors_sign_and_pkgen (StrongSpan< ForsSignature > sig_out, const SphincsHashedMessage &hashed_message, const SphincsSecretSeed &secret_seed, const Sphincs_Address &address, const Sphincs_Parameters ¶ms, Sphincs_Hash_Functions &hashes) |
void | gamma (SIMD_4x32 &A0, SIMD_4x32 &A1, SIMD_4x32 &A2, SIMD_4x32 &A3) |
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 *v, const uint8_t *) |
void | ge_scalarmult_base (uint8_t out[32], const uint8_t in[32]) |
template<typename GeneralVariantT , typename SpecialT > requires (std::is_constructible_v<GeneralVariantT, std::decay_t<SpecialT>>) | |
constexpr GeneralVariantT | generalize_to (SpecialT &&specific) noexcept |
Converts a given variant into another variant-ish whose type states are a super set of the given variant. | |
template<typename GeneralVariantT , typename... SpecialTs> | |
constexpr GeneralVariantT | generalize_to (std::variant< SpecialTs... > specific) noexcept |
Converts a given variant into another variant-ish whose type states are a super set of the given variant. | |
std::string | generate_bcrypt (std::string_view 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 (std::string_view pass, RandomNumberGenerator &rng, uint16_t work_factor, uint8_t alg_id) |
BigInt | generate_rfc6979_nonce (const BigInt &x, const BigInt &q, const BigInt &h, std::string_view hash) |
BigInt | generate_rsa_prime (RandomNumberGenerator &keygen_rng, RandomNumberGenerator &prime_test_rng, size_t bits, const BigInt &coprime, size_t prob) |
AEAD_Mode * | get_aead (std::string_view name, Cipher_Dir direction) |
template<size_t B, typename T > requires (B < sizeof(T)) | |
constexpr uint8_t | get_byte (T input) |
template<typename T > | |
constexpr uint8_t | get_byte_var (size_t byte_num, T input) |
Keyed_Filter * | get_cipher (std::string_view algo_spec, Cipher_Dir direction) |
Keyed_Filter * | get_cipher (std::string_view algo_spec, const SymmetricKey &key, Cipher_Dir direction) |
Keyed_Filter * | get_cipher (std::string_view algo_spec, const SymmetricKey &key, const InitializationVector &iv, Cipher_Dir direction) |
Cipher_Mode * | get_cipher_mode (std::string_view algo_spec, Cipher_Dir direction, std::string_view provider="") |
std::vector< std::string > | get_files_recursive (std::string_view dir) |
KDF * | get_kdf (std::string_view algo_spec) |
PBKDF * | get_pbkdf (std::string_view algo_spec, std::string_view provider="") |
PBKDF * | get_s2k (std::string_view algo_spec) |
gf2m | gray_to_lex (gf2m gray) |
bool | has_filesystem_impl () |
EC_Point | hash_to_curve_sswu (const EC_Group &group, std::string_view hash_fn, const uint8_t input[], size_t input_len, const uint8_t domain_sep[], size_t domain_sep_len, bool random_oracle) |
std::vector< uint8_t > | hex_decode (const char input[], size_t input_length, bool ignore_ws) |
size_t | hex_decode (std::span< uint8_t > output, std::string_view input, bool ignore_ws) |
std::vector< uint8_t > | hex_decode (std::string_view 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[], std::string_view 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 (std::string_view input, bool ignore_ws) |
void | hex_encode (char output[], const uint8_t input[], size_t input_length, bool uppercase) |
std::string | hex_encode (const uint8_t input[], size_t input_length, bool uppercase) |
std::string | hex_encode (std::span< const uint8_t > input, bool uppercase=true) |
template<typename T > requires (std::is_unsigned<T>::value) | |
constexpr size_t | high_bit (T n) |
secure_vector< uint8_t > | hkdf_expand_label (std::string_view hash_fn, const uint8_t secret[], size_t secret_len, std::string_view label, const uint8_t hash_val[], size_t hash_val_len, size_t length) |
template<typename... Alts, typename... Ts> | |
constexpr bool | holds_any_of (const std::variant< Ts... > &v) noexcept |
bool | host_wildcard_match (std::string_view issued_, std::string_view host_) |
void | ht_sign (StrongSpan< SphincsHypertreeSignature > out_sig, const SphincsTreeNode &message_to_sign, const SphincsSecretSeed &secret_seed, XmssTreeIndexInLayer tree_index_in_layer, TreeNodeIndex idx_leaf, const Sphincs_Parameters ¶ms, Sphincs_Hash_Functions &hashes) |
bool | ht_verify (const SphincsTreeNode &signed_msg, StrongSpan< const SphincsHypertreeSignature > ht_sig, const SphincsTreeNode &pk_root, XmssTreeIndexInLayer tree_index_in_layer, TreeNodeIndex idx_leaf, const Sphincs_Parameters ¶ms, Sphincs_Hash_Functions &hashes) |
uint8_t | ieee1363_hash_id (std::string_view name) |
size_t | if_work_factor (size_t bits) |
template<typename T > | |
void | ignore_param (T &&) |
template<typename... T> | |
void | ignore_params (T &&... args) |
void | initialize_allocator () |
bool | intersects (ASN1_Class x, ASN1_Class y) |
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) |
template<typename GeneralVariantT , typename SpecialT > | |
constexpr bool | is_generalizable_to (const SpecialT &) noexcept |
template<typename GeneralVariantT , typename... SpecialTs> | |
constexpr bool | is_generalizable_to (const std::variant< SpecialTs... > &) noexcept |
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 > requires (std::is_unsigned<T>::value) | |
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) |
template<absorbing_object T, typename... Ts> requires (std::constructible_from<std::span<const uint8_t>, Ts> && ...) | |
size_t | keccak_absorb_padded_strings_encoding (T &sink, size_t padding_mod, Ts... byte_strings) |
size_t | keccak_int_encoding_size (size_t x) |
std::span< const uint8_t > | keccak_int_left_encode (std::span< uint8_t > out, size_t x) |
std::span< const uint8_t > | keccak_int_right_encode (std::span< uint8_t > out, size_t x) |
constexpr size_t | keccak_max_int_encoding_size () |
void | Keccak_Permutation_round (uint64_t T[25], const uint64_t A[25], uint64_t RC) |
std::string | key_constraints_to_string (Key_Constraints c) |
std::string | latin1_to_utf8 (const uint8_t chars[], size_t len) |
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 > | |
constexpr T | load_be (const uint8_t in[], size_t off) |
template<std::unsigned_integral... Ts> requires (sizeof...(Ts) > 0) && all_same_v<Ts...> | |
constexpr void | load_be (const uint8_t in[], Ts &... outs) |
template<ranges::contiguous_range< uint8_t > InR, std::unsigned_integral... Ts> requires (sizeof...(Ts) > 0) && all_same_v<Ts...> | |
constexpr void | load_be (InR &&in, Ts &... outs) |
template<std::unsigned_integral T, ranges::contiguous_range< uint8_t > InR> | |
constexpr T | load_be (InR &&in_range) |
template<ranges::contiguous_range< uint8_t > InR> | |
constexpr auto | load_be (InR &&in_range) |
template<typename T > | |
constexpr void | load_be (T out[], const uint8_t in[], size_t count) |
template<typename T > | |
constexpr T | load_le (const uint8_t in[], size_t off) |
template<std::unsigned_integral... Ts> requires (sizeof...(Ts) > 0) && all_same_v<Ts...> | |
constexpr void | load_le (const uint8_t in[], Ts &... outs) |
template<ranges::contiguous_range< uint8_t > InR, std::unsigned_integral... Ts> requires (sizeof...(Ts) > 0) && all_same_v<Ts...> | |
constexpr void | load_le (InR &&in, Ts &... outs) |
template<std::unsigned_integral T, ranges::contiguous_range< uint8_t > InR> | |
constexpr T | load_le (InR &&in_range) |
template<ranges::contiguous_range< uint8_t > InR> | |
constexpr auto | load_le (InR &&in_range) |
template<typename T > | |
constexpr void | load_le (T out[], const uint8_t in[], size_t count) |
std::unique_ptr< Private_Key > | load_private_key (const AlgorithmIdentifier &alg_id, std::span< const uint8_t > key_bits) |
std::unique_ptr< Public_Key > | load_public_key (const AlgorithmIdentifier &alg_id, std::span< const uint8_t > key_bits) |
template<typename T > | |
secure_vector< T > | lock (const std::vector< T > &in) |
size_t | low_zero_bits (const BigInt &n) |
template<typename T > | |
constexpr T | majority (T a, T b, T c) |
std::unique_ptr< BlockCipher > | make_commoncrypto_block_cipher (std::string_view name) |
std::unique_ptr< Cipher_Mode > | make_commoncrypto_cipher_mode (std::string_view name, Cipher_Dir direction) |
std::unique_ptr< HashFunction > | make_commoncrypto_hash (std::string_view name) |
Compression_Algorithm * | make_compressor (std::string_view type) |
Decompression_Algorithm * | make_decompressor (std::string_view type) |
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<typename K , typename V > | |
std::set< K > | map_keys_as_set (const std::map< K, V > &kv) |
template<typename K , typename V > | |
std::set< K > | map_keys_as_set (const std::multimap< K, V > &kv) |
template<typename T , typename Pred > | |
void | map_remove_if (Pred pred, T &assoc) |
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) |
BigInt | monty_exp (const std::shared_ptr< const Montgomery_Params > ¶ms_p, const BigInt &g, const BigInt &k, size_t max_k_bits) |
BigInt | monty_exp_vartime (const std::shared_ptr< const Montgomery_Params > ¶ms_p, const BigInt &g, const BigInt &k) |
word | monty_inverse (word a) |
BigInt | monty_multi_exp (const std::shared_ptr< const Montgomery_Params > ¶ms_p, const BigInt &x_bn, const BigInt &z1, const BigInt &y_bn, const BigInt &z2) |
std::shared_ptr< const Montgomery_Exponentation_State > | monty_precompute (const std::shared_ptr< const Montgomery_Params > ¶ms, 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) |
EC_Point | multi_exponentiate (const EC_Point &p1, const BigInt &z1, const EC_Point &p2, const BigInt &z2) |
template<typename K , typename V > | |
void | multimap_insert (std::multimap< K, V > &multimap, const K &key, const V &value) |
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) |
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 EC_Point &lhs, const EC_Point &rhs) |
bool | operator!= (const OctetString &s1, const OctetString &s2) |
bool | operator!= (const OID &a, const OID &b) |
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) |
template<std::integral T, typename... Tags> | |
constexpr decltype(auto) | operator& (Strong< T, Tags... > a, Strong< T, Tags... > b) |
template<std::integral T1, std::integral T2, typename... Tags> requires (detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>) | |
constexpr decltype(auto) | operator& (Strong< T1, Tags... > a, T2 b) |
template<std::integral T1, std::integral T2, typename... Tags> requires (detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>) | |
constexpr decltype(auto) | operator& (T1 a, Strong< T2, Tags... > b) |
template<std::integral T, typename... Tags> | |
constexpr auto | operator&= (Strong< T, Tags... > &a, Strong< T, Tags... > b) |
template<std::integral T1, std::integral T2, typename... Tags> requires (detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>) | |
constexpr auto | operator&= (Strong< T1, Tags... > &a, T2 b) |
EC_Point | operator* (const BigInt &scalar, const EC_Point &point) |
BigInt | operator* (const BigInt &x, const BigInt &y) |
BigInt | operator* (const BigInt &x, word y) |
donna128 | operator* (const donna128 &x, uint64_t y) |
EC_Point | operator* (const EC_Point &point, const BigInt &scalar) |
template<std::integral T, typename... Tags> | |
constexpr decltype(auto) | operator* (Strong< T, Tags... > a, Strong< T, Tags... > b) |
template<std::integral T1, std::integral T2, typename... Tags> requires (detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>) | |
constexpr decltype(auto) | operator* (Strong< T1, Tags... > a, T2 b) |
template<std::integral T1, std::integral T2, typename... Tags> requires (detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>) | |
constexpr decltype(auto) | operator* (T1 a, Strong< T2, Tags... > b) |
donna128 | operator* (uint64_t y, const donna128 &x) |
BigInt | operator* (word x, const BigInt &y) |
template<std::integral T, typename... Tags> | |
constexpr auto | operator*= (Strong< T, Tags... > &a, Strong< T, Tags... > b) |
template<std::integral T1, std::integral T2, typename... Tags> requires (detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>) | |
constexpr auto | operator*= (Strong< T1, Tags... > &a, T2 b) |
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) |
EC_Point | operator+ (const EC_Point &lhs, const EC_Point &rhs) |
OctetString | operator+ (const OctetString &k1, const OctetString &k2) |
template<std::integral T, typename... Tags> | |
constexpr decltype(auto) | operator+ (Strong< T, Tags... > a, Strong< T, Tags... > b) |
template<std::integral T1, std::integral T2, typename... Tags> requires (detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>) | |
constexpr decltype(auto) | operator+ (Strong< T1, Tags... > a, T2 b) |
template<std::integral T1, std::integral T2, typename... Tags> requires (detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>) | |
constexpr decltype(auto) | operator+ (T1 a, Strong< T2, Tags... > b) |
BigInt | operator+ (word x, const BigInt &y) |
template<std::integral T, typename... Tags> | |
constexpr auto | operator++ (Strong< T, Tags... > &a) |
template<std::integral T, typename... Tags> | |
constexpr auto | operator++ (Strong< T, Tags... > &a, int) |
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) |
template<std::integral T, typename... Tags> | |
constexpr auto | operator+= (Strong< T, Tags... > &a, Strong< T, Tags... > b) |
template<std::integral T1, std::integral T2, typename... Tags> requires (detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>) | |
constexpr auto | operator+= (Strong< T1, Tags... > &a, T2 b) |
BigInt | operator- (const BigInt &x, const BigInt &y) |
BigInt | operator- (const BigInt &x, word y) |
EC_Point | operator- (const EC_Point &lhs) |
EC_Point | operator- (const EC_Point &lhs, const EC_Point &rhs) |
template<std::integral T, typename... Tags> | |
constexpr decltype(auto) | operator- (Strong< T, Tags... > a, Strong< T, Tags... > b) |
template<std::integral T1, std::integral T2, typename... Tags> requires (detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>) | |
constexpr decltype(auto) | operator- (Strong< T1, Tags... > a, T2 b) |
template<std::integral T1, std::integral T2, typename... Tags> requires (detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>) | |
constexpr decltype(auto) | operator- (T1 a, Strong< T2, Tags... > b) |
template<std::integral T, typename... Tags> | |
constexpr auto | operator-- (Strong< T, Tags... > &a) |
template<std::integral T, typename... Tags> | |
constexpr auto | operator-- (Strong< T, Tags... > &a, int) |
template<std::integral T, typename... Tags> | |
constexpr auto | operator-= (Strong< T, Tags... > &a, Strong< T, Tags... > b) |
template<std::integral T1, std::integral T2, typename... Tags> requires (detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>) | |
constexpr auto | operator-= (Strong< T1, Tags... > &a, T2 b) |
BigInt | operator/ (const BigInt &x, const BigInt &y) |
BigInt | operator/ (const BigInt &x, word y) |
template<std::integral T, typename... Tags> | |
constexpr decltype(auto) | operator/ (Strong< T, Tags... > a, Strong< T, Tags... > b) |
template<std::integral T1, std::integral T2, typename... Tags> requires (detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>) | |
constexpr decltype(auto) | operator/ (Strong< T1, Tags... > a, T2 b) |
template<std::integral T1, std::integral T2, typename... Tags> requires (detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>) | |
constexpr decltype(auto) | operator/ (T1 a, Strong< T2, Tags... > b) |
template<std::integral T, typename... Tags> | |
constexpr auto | operator/= (Strong< T, Tags... > &a, Strong< T, Tags... > b) |
template<std::integral T1, std::integral T2, typename... Tags> requires (detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>) | |
constexpr auto | operator/= (Strong< T1, Tags... > &a, T2 b) |
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) |
template<typename T , typename... Tags> requires (concepts::streamable<T>) | |
decltype(auto) | operator<< (std::ostream &os, const Strong< T, Tags... > &v) |
std::ostream & | operator<< (std::ostream &out, const OID &oid) |
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) |
template<std::integral T, typename... Tags> | |
constexpr decltype(auto) | operator<< (Strong< T, Tags... > a, Strong< T, Tags... > b) |
template<std::integral T1, std::integral T2, typename... Tags> requires (detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>) | |
constexpr decltype(auto) | operator<< (Strong< T1, Tags... > a, T2 b) |
template<std::integral T1, std::integral T2, typename... Tags> requires (detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>) | |
constexpr decltype(auto) | operator<< (T1 a, Strong< T2, Tags... > b) |
template<std::integral T, typename... Tags> | |
constexpr auto | operator<<= (Strong< T, Tags... > &a, Strong< T, Tags... > b) |
template<std::integral T1, std::integral T2, typename... Tags> requires (detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>) | |
constexpr auto | operator<<= (Strong< T1, Tags... > &a, T2 b) |
bool | operator<= (const ASN1_Time &, const ASN1_Time &) |
bool | operator<= (const BigInt &a, const BigInt &b) |
bool | operator<= (const BigInt &a, word b) |
template<typename T , typename... Tags> requires (std::three_way_comparable<T>) | |
auto | operator<=> (const Strong< T, Tags... > &lhs, const Strong< T, Tags... > &rhs) |
template<std::integral T1, std::integral T2, typename... Tags> | |
auto | operator<=> (Strong< T1, Tags... > a, T2 b) |
template<std::integral T1, std::integral T2, typename... Tags> | |
auto | operator<=> (T1 a, Strong< T2, Tags... > 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 > &) |
template<typename T , typename... Tags> requires (std::equality_comparable<T>) | |
bool | operator== (const Strong< T, Tags... > &lhs, const Strong< T, Tags... > &rhs) |
bool | operator== (const X509_DN &dn1, const X509_DN &dn2) |
template<std::integral T1, std::integral T2, typename... Tags> | |
auto | operator== (Strong< T1, Tags... > a, T2 b) |
template<std::integral T1, std::integral T2, typename... Tags> | |
auto | operator== (T1 a, Strong< T2, Tags... > b) |
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) |
template<std::integral T, typename... Tags> | |
constexpr decltype(auto) | operator>> (Strong< T, Tags... > a, Strong< T, Tags... > b) |
template<std::integral T1, std::integral T2, typename... Tags> requires (detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>) | |
constexpr decltype(auto) | operator>> (Strong< T1, Tags... > a, T2 b) |
template<std::integral T1, std::integral T2, typename... Tags> requires (detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>) | |
constexpr decltype(auto) | operator>> (T1 a, Strong< T2, Tags... > b) |
template<std::integral T, typename... Tags> | |
constexpr auto | operator>>= (Strong< T, Tags... > &a, Strong< T, Tags... > b) |
template<std::integral T1, std::integral T2, typename... Tags> requires (detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>) | |
constexpr auto | operator>>= (Strong< T1, Tags... > &a, T2 b) |
OctetString | operator^ (const OctetString &k1, const OctetString &k2) |
template<std::integral T, typename... Tags> | |
constexpr decltype(auto) | operator^ (Strong< T, Tags... > a, Strong< T, Tags... > b) |
template<std::integral T1, std::integral T2, typename... Tags> requires (detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>) | |
constexpr decltype(auto) | operator^ (Strong< T1, Tags... > a, T2 b) |
template<std::integral T1, std::integral T2, typename... Tags> requires (detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>) | |
constexpr decltype(auto) | operator^ (T1 a, Strong< T2, Tags... > b) |
template<typename Alloc , typename Alloc2 > | |
std::vector< uint8_t, Alloc > & | operator^= (std::vector< uint8_t, Alloc > &out, const std::vector< uint8_t, Alloc2 > &in) |
template<std::integral T, typename... Tags> | |
constexpr auto | operator^= (Strong< T, Tags... > &a, Strong< T, Tags... > b) |
template<std::integral T1, std::integral T2, typename... Tags> requires (detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>) | |
constexpr auto | operator^= (Strong< T1, Tags... > &a, T2 b) |
ASN1_Class | operator| (ASN1_Class x, ASN1_Class y) |
uint32_t | operator| (ASN1_Class x, ASN1_Type y) |
uint32_t | operator| (ASN1_Type x, ASN1_Class y) |
ASN1_Type | operator| (ASN1_Type x, ASN1_Type y) |
donna128 | operator| (const donna128 &x, const donna128 &y) |
ECIES_Flags | operator| (ECIES_Flags a, ECIES_Flags b) |
template<std::integral T, typename... Tags> | |
constexpr decltype(auto) | operator| (Strong< T, Tags... > a, Strong< T, Tags... > b) |
template<std::integral T1, std::integral T2, typename... Tags> requires (detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>) | |
constexpr decltype(auto) | operator| (Strong< T1, Tags... > a, T2 b) |
template<std::integral T1, std::integral T2, typename... Tags> requires (detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>) | |
constexpr decltype(auto) | operator| (T1 a, Strong< T2, Tags... > b) |
template<std::integral T, typename... Tags> | |
constexpr auto | operator|= (Strong< T, Tags... > &a, Strong< T, Tags... > b) |
template<std::integral T1, std::integral T2, typename... Tags> requires (detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>) | |
constexpr auto | operator|= (Strong< T1, Tags... > &a, T2 b) |
template<typename Alloc > | |
EC_Point | 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) |
EC_Point | OS2ECP (const uint8_t data[], size_t data_len, const CurveGFp &curve) |
template<class... Ts> | |
overloaded (Ts...) -> overloaded< Ts... > | |
std::vector< std::string > | parse_algorithm_name (std::string_view namex) |
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 (std::span< const uint8_t > key_bits, std::string_view passphrase, const std::vector< uint8_t > ¶ms) |
std::pair< AlgorithmIdentifier, std::vector< uint8_t > > | pbes2_encrypt (std::span< const uint8_t > key_bits, std::string_view passphrase, std::chrono::milliseconds msec, std::string_view cipher, std::string_view digest, RandomNumberGenerator &rng) |
std::pair< AlgorithmIdentifier, std::vector< uint8_t > > | pbes2_encrypt_iter (std::span< const uint8_t > key_bits, std::string_view passphrase, size_t pbkdf_iter, std::string_view cipher, std::string_view digest, RandomNumberGenerator &rng) |
std::pair< AlgorithmIdentifier, std::vector< uint8_t > > | pbes2_encrypt_msec (std::span< const uint8_t > key_bits, std::string_view passphrase, std::chrono::milliseconds msec, size_t *out_iterations_if_nonnull, std::string_view cipher, std::string_view digest, RandomNumberGenerator &rng) |
void | pbkdf2 (MessageAuthenticationCode &prf, uint8_t out[], size_t out_len, const uint8_t salt[], size_t salt_len, size_t iterations) |
size_t | pbkdf2 (MessageAuthenticationCode &prf, uint8_t out[], size_t out_len, std::string_view password, const uint8_t salt[], size_t salt_len, size_t iterations, std::chrono::milliseconds msec) |
std::vector< uint8_t > | pkcs_hash_id (std::string_view 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) |
uint64_t | prefetch_array_raw (size_t bytes, const void *arrayv) noexcept |
template<typename T , size_t... Ns> requires std::is_integral<T>::value | |
T | prefetch_arrays (T(&... arr)[Ns]) noexcept |
BOTAN_TEST_API const BigInt & | prime_p192 () |
BOTAN_TEST_API const BigInt & | prime_p224 () |
BOTAN_TEST_API const BigInt & | prime_p256 () |
BOTAN_TEST_API const BigInt & | prime_p384 () |
BOTAN_TEST_API const BigInt & | prime_p521 () |
std::vector< std::string > | probe_provider_private_key (std::string_view alg_name, const std::vector< std::string > &possible) |
template<typename T > | |
std::vector< std::string > | probe_providers_of (std::string_view algo_spec, const std::vector< std::string > &possible={"base"}) |
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) |
BOTAN_TEST_API std::map< std::string, std::string > | read_kv (std::string_view 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) |
BOTAN_TEST_API void | redc_p192 (BigInt &x, secure_vector< word > &ws) |
BOTAN_TEST_API void | redc_p224 (BigInt &x, secure_vector< word > &ws) |
BOTAN_TEST_API void | redc_p256 (BigInt &x, secure_vector< word > &ws) |
BOTAN_TEST_API void | redc_p384 (BigInt &x, secure_vector< word > &ws) |
BOTAN_TEST_API void | redc_p521 (BigInt &x, secure_vector< word > &ws) |
template<typename RetT , typename KeyT , typename ReducerT > requires std::is_convertible_v<ReducerT, std::function<RetT(RetT, const KeyT&)>> | |
RetT | reduce (const std::vector< KeyT > &keys, RetT acc, ReducerT reducer) |
constexpr uint16_t | reverse_bytes (uint16_t x) |
constexpr uint32_t | reverse_bytes (uint32_t x) |
constexpr uint64_t | reverse_bytes (uint64_t x) |
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<size_t R1, size_t R2, size_t R3, typename T > | |
constexpr T | rho (T x) |
template<size_t R> | |
SIMD_16x32 | rotl (SIMD_16x32 input) |
template<size_t R> | |
SIMD_4x32 | rotl (SIMD_4x32 input) |
template<size_t R> | |
SIMD_8x32 | rotl (SIMD_8x32 input) |
template<size_t ROT, typename T > requires (ROT > 0 && ROT < 8 * sizeof(T)) | |
constexpr T | rotl (T input) |
template<typename T > | |
constexpr T | rotl_var (T input, size_t rot) |
template<size_t R> | |
SIMD_16x32 | rotr (SIMD_16x32 input) |
template<size_t R> | |
SIMD_4x32 | rotr (SIMD_4x32 input) |
template<size_t R> | |
SIMD_8x32 | rotr (SIMD_8x32 input) |
template<size_t ROT, typename T > requires (ROT > 0 && ROT < 8 * sizeof(T)) | |
constexpr T | rotr (T input) |
template<typename T > | |
constexpr 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) |
BOTAN_FORCE_INLINE void | SBoxD0 (SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d) |
BOTAN_FORCE_INLINE void | SBoxD1 (SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d) |
BOTAN_FORCE_INLINE void | SBoxD2 (SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d) |
BOTAN_FORCE_INLINE void | SBoxD3 (SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d) |
BOTAN_FORCE_INLINE void | SBoxD4 (SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d) |
BOTAN_FORCE_INLINE void | SBoxD5 (SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d) |
BOTAN_FORCE_INLINE void | SBoxD6 (SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d) |
BOTAN_FORCE_INLINE void | SBoxD7 (SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d) |
BOTAN_FORCE_INLINE void | SBoxE0 (SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d) |
BOTAN_FORCE_INLINE void | SBoxE1 (SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d) |
BOTAN_FORCE_INLINE void | SBoxE2 (SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d) |
BOTAN_FORCE_INLINE void | SBoxE3 (SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d) |
BOTAN_FORCE_INLINE void | SBoxE4 (SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d) |
BOTAN_FORCE_INLINE void | SBoxE5 (SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d) |
BOTAN_FORCE_INLINE void | SBoxE6 (SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d) |
BOTAN_FORCE_INLINE void | SBoxE7 (SIMD_16x32 &a, SIMD_16x32 &b, SIMD_16x32 &c, SIMD_16x32 &d) |
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, std::string_view password, const uint8_t salt[], size_t salt_len, 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 (ranges::contiguous_output_range auto &&data) |
void | secure_scrub_memory (void *ptr, size_t n) |
constexpr void | set_mem (uint8_t *ptr, size_t n, uint8_t val) |
BOTAN_FORCE_INLINE void | SHA2_32_F (uint32_t A, uint32_t B, uint32_t C, uint32_t &D, uint32_t E, uint32_t F, uint32_t G, uint32_t &H, uint32_t &M1, uint32_t M2, uint32_t M3, uint32_t M4, uint32_t magic) |
BOTAN_FORCE_INLINE void | SHA2_64_F (uint64_t A, uint64_t B, uint64_t C, uint64_t &D, uint64_t E, uint64_t F, uint64_t G, uint64_t &H, uint64_t &M1, uint64_t M2, uint64_t M3, uint64_t M4, uint64_t magic) |
template<size_t S> | |
SIMD_16x32 | shl (SIMD_16x32 input) |
template<size_t S> | |
SIMD_4x32 | shl (SIMD_4x32 input) |
template<size_t S> | |
SIMD_8x32 | shl (SIMD_8x32 input) |
const char * | short_version_cstr () |
std::string | short_version_string () |
template<size_t R1, size_t R2, size_t S, typename T > | |
constexpr T | sigma (T x) |
template<typename T > requires (std::is_integral<T>::value) | |
constexpr size_t | significant_bytes (T n) |
std::vector< uint8_t > | sm2_compute_za (HashFunction &hash, std::string_view user_id, const EC_Group &domain, const EC_Point &pubkey) |
std::vector< std::string > | split_on (std::string_view str, char delim) |
BigInt | sqrt_modulo_prime (const BigInt &a, const BigInt &p) |
BigInt | square (const BigInt &x) |
std::pair< BigInt, SymmetricKey > | srp6_client_agree (std::string_view identifier, std::string_view password, const DL_Group &group, std::string_view 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 (std::string_view identifier, std::string_view password, std::string_view group_id, std::string_view hash_id, const std::vector< uint8_t > &salt, const BigInt &B, RandomNumberGenerator &rng) |
BigInt | srp6_generate_verifier (std::string_view identifier, std::string_view password, const std::vector< uint8_t > &salt, const DL_Group &group, std::string_view hash_id) |
BigInt | srp6_generate_verifier (std::string_view identifier, std::string_view password, const std::vector< uint8_t > &salt, std::string_view group_id, std::string_view hash_id) |
std::string | srp6_group_identifier (const BigInt &N, const BigInt &g) |
template<ranges::contiguous_output_range< uint8_t > OutR, std::unsigned_integral... Ts> requires (sizeof...(Ts) > 0) && all_same_v<Ts...> | |
constexpr void | store_be (OutR &&out, Ts... ins) |
template<std::unsigned_integral T> | |
constexpr auto | store_be (T in) |
template<std::unsigned_integral T, ranges::contiguous_output_range< uint8_t > OutR> | |
constexpr void | store_be (T in, OutR &&out_range) |
template<std::unsigned_integral T> | |
constexpr void | store_be (T in, uint8_t out[sizeof(T)]) |
template<std::unsigned_integral... Ts> requires (sizeof...(Ts) > 0) && all_same_v<Ts...> | |
constexpr void | store_be (uint8_t out[], Ts... ins) |
template<ranges::contiguous_output_range< uint8_t > OutR, std::unsigned_integral... Ts> requires (sizeof...(Ts) > 0) && all_same_v<Ts...> | |
constexpr void | store_le (OutR &&out, Ts... ins) |
template<std::unsigned_integral T> | |
constexpr auto | store_le (T in) |
template<std::unsigned_integral T, ranges::contiguous_output_range< uint8_t > OutR> | |
constexpr void | store_le (T in, OutR &&out_range) |
template<std::unsigned_integral T> | |
constexpr void | store_le (T in, uint8_t out[sizeof(T)]) |
template<std::unsigned_integral... Ts> requires (sizeof...(Ts) > 0) && all_same_v<Ts...> | |
constexpr void | store_le (uint8_t out[], Ts... ins) |
std::string | string_join (const std::vector< std::string > &strs, char delim) |
uint32_t | string_to_ipv4 (std::string_view str) |
template<typename T > | |
constexpr void | swap_bits (T &x, T &y, T mask, size_t shift) |
std::vector< polyn_gf2m > | syndrome_init (const polyn_gf2m &generator, const std::vector< gf2m > &support, int n) |
RandomNumberGenerator & | system_rng () |
void | theta (SIMD_4x32 &A0, SIMD_4x32 &A1, SIMD_4x32 &A2, SIMD_4x32 &A3, const SIMD_4x32 &K0, const SIMD_4x32 &K1, const SIMD_4x32 &K2, const SIMD_4x32 &K3) |
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) |
template<concepts::contiguous_container T = std::vector<uint8_t>> | |
T | to_byte_vector (std::string_view s) |
const char * | to_string (Certificate_Status_Code code) |
std::string | to_string (ErrorType type) |
Convert an ErrorType to string. | |
std::string | to_string (std::span< const uint8_t > bytes) |
uint32_t | to_u32bit (std::string_view str_view) |
uint16_t | to_uint16 (std::string_view str) |
std::string | tolower_string (std::string_view in) |
void | treehash (StrongSpan< SphincsTreeNode > out_root, StrongSpan< SphincsAuthenticationPath > out_auth_path, const Sphincs_Parameters ¶ms, Sphincs_Hash_Functions &hashes, std::optional< TreeNodeIndex > leaf_idx, uint32_t idx_offset, uint32_t total_tree_height, const GenerateLeafFunction &gen_leaf, Sphincs_Address &tree_address) |
template<typename To > requires std::is_trivial<To>::value | |
constexpr To | typecast_copy (const uint8_t src[]) noexcept |
template<typename ToT , ranges::contiguous_range FromR> requires std::is_trivial_v<ToT> && std::is_trivially_copyable_v<std::ranges::range_value_t<FromR>> | |
constexpr ToT | typecast_copy (FromR &&src) noexcept |
template<typename T > requires std::is_trivial<typename std::decay<T>::type>::value | |
constexpr void | typecast_copy (T &out, const uint8_t in[]) |
template<typename T > requires std::is_trivial<T>::value | |
constexpr void | typecast_copy (T out[], const uint8_t in[], size_t N) |
template<ranges::contiguous_output_range ToR, typename FromT > requires std::is_trivially_copyable_v<FromT> && (!std::ranges::range<FromT>) && std::is_trivially_copyable_v<std::ranges::range_value_t<ToR>> | |
constexpr void | typecast_copy (ToR &&out, const FromT &in) |
template<ranges::contiguous_output_range ToR, ranges::contiguous_range FromR> requires std::is_trivially_copyable_v<std::ranges::range_value_t<FromR>> && std::is_trivially_copyable_v<std::ranges::range_value_t<ToR>> | |
constexpr void | typecast_copy (ToR &&out, FromR &&in) |
template<typename ToT , ranges::contiguous_range FromR> requires std::is_trivially_copyable_v<std::ranges::range_value_t<FromR>> && std::is_trivially_copyable_v<ToT> && (!std::ranges::range<ToT>) | |
constexpr void | typecast_copy (ToT &out, FromR &&in) noexcept |
template<typename T > | |
constexpr void | typecast_copy (uint8_t out[], const T &in) |
template<typename T > requires std::is_trivially_copyable<T>::value | |
constexpr 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) |
template<typename T , typename OT > | |
bool | value_exists (const std::vector< T > &vec, const OT &val) |
constexpr size_t | var_ctz32 (uint32_t n) |
void | vartime_divide (const BigInt &x, const BigInt &y_arg, BigInt &q_out, BigInt &r_out) |
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) |
WotsPublicKey | wots_public_key_from_signature (const SphincsTreeNode &hashed_message, StrongSpan< const WotsSignature > signature, Sphincs_Address &address, const Sphincs_Parameters ¶ms, Sphincs_Hash_Functions &hashes) |
void | wots_sign_and_pkgen (StrongSpan< WotsSignature > sig_out, StrongSpan< SphincsTreeNode > leaf_out, const SphincsSecretSeed &secret_seed, TreeNodeIndex leaf_idx, std::optional< TreeNodeIndex > sign_leaf_idx, const std::vector< WotsHashIndex > &wots_steps, Sphincs_Address &leaf_addr, Sphincs_Address &pk_addr, const Sphincs_Parameters ¶ms, Sphincs_Hash_Functions &hashes) |
Path_Validation_Result | x509_path_validate (const std::vector< X509_Certificate > &end_certs, const Path_Validation_Restrictions &restrictions, const Certificate_Store &store, std::string_view hostname, Usage_Type usage, std::chrono::system_clock::time_point when, std::chrono::milliseconds ocsp_timeout, const std::vector< std::optional< 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, std::string_view hostname, Usage_Type usage, std::chrono::system_clock::time_point ref_time, std::chrono::milliseconds ocsp_timeout, const std::vector< std::optional< OCSP::Response > > &ocsp_resp) |
Path_Validation_Result | x509_path_validate (const X509_Certificate &end_cert, const Path_Validation_Restrictions &restrictions, const Certificate_Store &store, std::string_view hostname, Usage_Type usage, std::chrono::system_clock::time_point when, std::chrono::milliseconds ocsp_timeout, const std::vector< std::optional< 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, std::string_view hostname, Usage_Type usage, std::chrono::system_clock::time_point when, std::chrono::milliseconds ocsp_timeout, const std::vector< std::optional< OCSP::Response > > &ocsp_resp) |
SphincsTreeNode | xmss_gen_root (const Sphincs_Parameters ¶ms, const SphincsSecretSeed &secret_seed, Sphincs_Hash_Functions &hashes) |
SphincsTreeNode | xmss_sign_and_pkgen (StrongSpan< SphincsXmssSignature > out_sig, const SphincsTreeNode &root, const SphincsSecretSeed &secret_seed, Sphincs_Address &wots_addr, Sphincs_Address &tree_addr, std::optional< TreeNodeIndex > idx_leaf, const Sphincs_Parameters ¶ms, Sphincs_Hash_Functions &hashes) |
constexpr void | xor_buf (ranges::contiguous_output_range< uint8_t > auto &&out, ranges::contiguous_range< uint8_t > auto &&in) |
constexpr void | xor_buf (ranges::contiguous_output_range< uint8_t > auto &&out, ranges::contiguous_range< uint8_t > auto &&in1, ranges::contiguous_range< uint8_t > auto &&in2) |
void | xor_buf (std::span< uint8_t > out, std::span< const uint8_t > in, size_t n) |
template<typename Alloc , typename Alloc2 > | |
void | xor_buf (std::vector< uint8_t, Alloc > &out, const uint8_t *in, const std::vector< uint8_t, Alloc2 > &in2, size_t n) |
template<typename 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 | |
constexpr size_t | BLAKE2B_BLOCKBYTES = 128 |
const size_t | HEX_CODEC_BUFFER_SIZE = 256 |
template<typename... Ts> | |
constexpr bool | is_strong_type_v = is_strong_type<std::remove_const_t<Ts>...>::value |
const size_t | MAX_EXT_DEG = 16 |
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] |
Wrapper for truncated hashes (C) 2023 Jack Lloyd 2023 René Meusel - Rohde & Schwarz Cybersecurity
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,2019,2021 Jack Lloyd
Botan is released under the Simplified BSD License (see license.txt)
(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) 2023 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) 2018 Jack Lloyd (C) 2018 Ribose Inc
Botan is released under the Simplified BSD License (see license.txt)
Asymmetric primitives for dilithium (C) 2022-2023 Jack Lloyd (C) 2022-2023 Michael Boric, René Meusel - Rohde & Schwarz Cybersecurity (C) 2022 Manuel Glaser - Rohde & Schwarz Cybersecurity
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.
Note: This header was accidentally pulled from the public API between Botan 3.0.0 and 3.2.0, and then restored in 3.3.0. If you are maintaining an application which used this header in Botan 2.x, you should make sure to use Botan 3.3.0 or later when migrating.
Hybrid Session Manager emitting both Tickets and storing sessions in Memory (C) 2023 Jack Lloyd (C) 2023 René Meusel - Rohde & Schwarz Cybersecurity
Botan is released under the Simplified BSD License (see license.txt)
TLS Session Manager in Memory (C) 2011 Jack Lloyd (C) 2023 René Meusel - Rohde & Schwarz Cybersecurity
Botan is released under the Simplified BSD License (see license.txt)
TLS Stateless Session Manager for stateless servers (C) 2023 Jack Lloyd 2023 René Meusel - Rohde & Schwarz Cybersecurity
Botan is released under the Simplified BSD License (see license.txt)
Useful concepts that are available throughout the library (C) 2023 Jack Lloyd 2023 René Meusel - Rohde & Schwarz Cybersecurity
Botan is released under the Simplified BSD License (see license.txt)
A wrapper class to implement strong types (C) 2022 Jack Lloyd 2022 René Meusel - Rohde & Schwarz Cybersecurity
Botan is released under the Simplified BSD License (see license.txt)
utilities for PKIX::build_all_certificate_paths
typedef __vector unsigned int Botan::Altivec32x4 |
Definition at line 23 of file aes_power8.cpp.
typedef __vector unsigned long long Botan::Altivec64x2 |
Definition at line 22 of file aes_power8.cpp.
typedef __vector unsigned char Botan::Altivec8x16 |
Definition at line 24 of file aes_power8.cpp.
using Botan::byte = std::uint8_t |
typedef int32_t Botan::CCCryptorStatus |
Definition at line 24 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.
Definition at line 140 of file ed25519_fe.h.
using Botan::ForsLeafSecret = Strong<secure_vector<uint8_t>, struct ForsLeafSecret_> |
Definition at line 57 of file sp_types.h.
using Botan::ForsSignature = Strong<std::vector<uint8_t>, struct ForsSignature_> |
Definition at line 58 of file sp_types.h.
using Botan::FrodoDomainSeparator = Strong<std::array<uint8_t, 1>, struct FrodoDoaminSeparator_> |
Definition at line 47 of file frodo_types.h.
using Botan::FrodoIntermediateSharedSecret = Strong<secure_vector<uint8_t>, struct FrodoIntermediateSharedSecret_> |
Definition at line 56 of file frodo_types.h.
using Botan::FrodoPackedMatrix = Strong<std::vector<uint8_t>, struct FrodoPackedMatrix_> |
Definition at line 41 of file frodo_types.h.
using Botan::FrodoPlaintext = Strong<secure_vector<uint8_t>, struct FrodoPlaintext_> |
Definition at line 50 of file frodo_types.h.
using Botan::FrodoPublicKeyHash = Strong<std::vector<uint8_t>, struct FrodoPublicKeyHash_> |
Definition at line 38 of file frodo_types.h.
using Botan::FrodoSalt = Strong<std::vector<uint8_t>, struct FrodoSalt_> |
Definition at line 53 of file frodo_types.h.
using Botan::FrodoSampleR = Strong<secure_vector<uint8_t>, struct FrodoSampleR_> |
Definition at line 35 of file frodo_types.h.
using Botan::FrodoSeedA = Strong<std::vector<uint8_t>, struct FrodoSeedA_> |
Definition at line 23 of file frodo_types.h.
using Botan::FrodoSeedS = Strong<secure_vector<uint8_t>, struct FrodoSeedS_> |
Definition at line 26 of file frodo_types.h.
using Botan::FrodoSeedSE = Strong<secure_vector<uint8_t>, struct FrodoSeedSE_> |
Definition at line 29 of file frodo_types.h.
using Botan::FrodoSeedZ = Strong<std::vector<uint8_t>, struct FrodoSeedZ_> |
Definition at line 32 of file frodo_types.h.
using Botan::FrodoSerializedMatrix = Strong<secure_vector<uint8_t>, struct FrodoSerializedMatrix_> |
Definition at line 44 of file frodo_types.h.
using Botan::GenerateLeafFunction = std::function<void(StrongSpan<SphincsTreeNode> , TreeNodeIndex)> |
Definition at line 25 of file sp_treehash.h.
typedef uint16_t Botan::gf2m |
Definition at line 20 of file gf2m_small_m.h.
using Botan::HypertreeLayerIndex = Strong<uint32_t, struct HypertreeLayerIndex_> |
Index of a layer in the XMSS hyper-tree.
Definition at line 72 of file sp_types.h.
using Botan::lock_guard_type = lock_guard<T> |
typedef MessageAuthenticationCode Botan::MAC |
using Botan::mutex_type = noop_mutex |
typedef EC_Point Botan::PointGFp |
Definition at line 402 of file ec_point.h.
typedef RandomNumberGenerator Botan::RNG |
typedef PBKDF Botan::S2K |
using Botan::s32bit = std::int32_t |
using Botan::secure_deque = std::deque<T, secure_allocator<T>> |
using Botan::secure_vector = std::vector<T, secure_allocator<T>> |
using Botan::SecureVector = secure_vector<T> |
using Botan::SphincsAuthenticationPath = Strong<std::vector<uint8_t>, struct SphincsAuthenticationPath_> |
Definition at line 53 of file sp_types.h.
using Botan::SphincsHashedMessage = Strong<std::vector<uint8_t>, struct SphincsHashedMessage_> |
Definition at line 45 of file sp_types.h.
using Botan::SphincsHypertreeSignature = Strong<std::vector<uint8_t>, struct SphincsXmssSignature_> |
Definition at line 52 of file sp_types.h.
using Botan::SphincsMessageRandomness = Strong<secure_vector<uint8_t>, struct SphincsMessageRandomness_> |
Definition at line 50 of file sp_types.h.
using Botan::SphincsOptionalRandomness = Strong<secure_vector<uint8_t>, struct SphincsOptionalRandomness_> |
Definition at line 49 of file sp_types.h.
using Botan::SphincsPublicSeed = Strong<std::vector<uint8_t>, struct SphincsPublicSeed_> |
Definition at line 46 of file sp_types.h.
using Botan::SphincsSecretPRF = Strong<secure_vector<uint8_t>, struct SphincsSecretPRF_> |
Definition at line 48 of file sp_types.h.
using Botan::SphincsSecretSeed = Strong<secure_vector<uint8_t>, struct SphincsSecretSeed_> |
Definition at line 47 of file sp_types.h.
using Botan::SphincsTreeNode = Strong<std::vector<uint8_t>, struct SphincsTreeNode_> |
Either an XMSS or FORS tree node or leaf.
Definition at line 56 of file sp_types.h.
using Botan::SphincsXmssSignature = Strong<std::vector<uint8_t>, struct SphincsXmssSignature_> |
Definition at line 51 of file sp_types.h.
using Botan::SymmetricKey = OctetString |
using Botan::TreeLayerIndex = Strong<uint32_t, struct TreeLayerIndex_, EnableArithmeticWithPlainNumber> |
Index of the layer within a FORS/XMSS tree.
Definition at line 69 of file sp_types.h.
using Botan::TreeNodeIndex = Strong<uint32_t, struct TreeNodeIndex_, EnableArithmeticWithPlainNumber> |
Index of an individual node inside an XMSS or FORS tree.
Definition at line 78 of file sp_types.h.
using Botan::u16bit = std::uint16_t |
using Botan::u32bit = std::uint32_t |
using Botan::u64bit = std::uint64_t |
typedef std::vector< secure_vector< uint8_t > > Botan::wots_keysig_t |
Definition at line 20 of file xmss_common_ops.h.
using Botan::WotsChainIndex = Strong<uint32_t, struct WotsChainIndex_> |
Index of a WOTS chain within a single usage of WOTS.
Definition at line 81 of file sp_types.h.
using Botan::WotsHashIndex = Strong<uint8_t, struct WotsHashIndex_, EnableArithmeticWithPlainNumber> |
Index of a hash application inside a single WOTS chain (integers in "base_w")
Definition at line 84 of file sp_types.h.
using Botan::WotsNode = Strong<secure_vector<uint8_t>, struct WotsNode_> |
Start (or intermediate) node of a WOTS+ chain.
Definition at line 65 of file sp_types.h.
using Botan::WotsPublicKey = Strong<std::vector<uint8_t>, struct WotsPublicKey_> |
Definition at line 59 of file sp_types.h.
using Botan::WotsPublicKeyNode = Strong<std::vector<uint8_t>, struct WotsPublicKeyNode_> |
End node of a WOTS+ chain (part of the WOTS+ public key)
Definition at line 62 of file sp_types.h.
using Botan::WotsSignature = Strong<secure_vector<uint8_t>, struct WotsSignature_> |
Definition at line 66 of file sp_types.h.
Definition at line 112 of file curve25519.h.
Definition at line 111 of file curve25519.h.
typedef ASN1_Time Botan::X509_Time |
Definition at line 402 of file asn1_obj.h.
using Botan::XmssTreeIndexInLayer = Strong<uint64_t, struct XmssTreeIndexInLayer_, EnableArithmeticWithPlainNumber> |
Index of an XMSS tree (unique for just the local hyper-tree layer)
Definition at line 75 of file sp_types.h.
|
strong |
Defines the strategy for handling the final block of input data in the handle_unaligned_data() method of the AlignmentBuffer<>.
The AlignmentBuffer<> assumes data to be "the final block" if no further input data is available in the BufferSlicer<>. This might result in some performance overhead when using the must_be_deferred strategy.
Enumerator | |
---|---|
is_not_special | |
must_be_deferred |
Definition at line 34 of file alignment_buffer.h.
|
strong |
ASN.1 Class Tags
Enumerator | |
---|---|
Universal | |
Application | |
ContextSpecific | |
Private | |
Constructed | |
ExplicitContextSpecific | |
NoObject |
Definition at line 28 of file asn1_obj.h.
|
strong |
ASN.1 Type Tags
Definition at line 43 of file asn1_obj.h.
|
strong |
Certificate validation status code
Definition at line 20 of file pkix_enums.h.
|
strong |
The two possible directions for cipher filters, determining whether they actually perform encryption or decryption.
Enumerator | |
---|---|
Encryption | |
Decryption | |
ENCRYPTION | |
DECRYPTION |
Definition at line 26 of file cipher_mode.h.
|
strong |
X.509v2 CRL Reason Code.
Enumerator | |
---|---|
Unspecified | |
KeyCompromise | |
CaCompromise | |
AffiliationChanged | |
Superseded | |
CessationOfOperation | |
CertificateHold | |
RemoveFromCrl | |
PrivilegeWithdrawn | |
AaCompromise |
Definition at line 185 of file pkix_enums.h.
enum Botan::DilithiumEta : uint32_t |
|
strong |
The DL group encoding format variants.
Enumerator | |
---|---|
ANSI_X9_42 | |
ANSI_X9_57 | |
PKCS_3 | |
DSA_PARAMETERS | |
DH_PARAMETERS | |
ANSI_X9_42_DH_PARAMETERS | |
PKCS3_DH_PARAMETERS |
Definition at line 28 of file dl_group.h.
|
strong |
Enumerator | |
---|---|
Builtin | |
RandomlyGenerated | |
ExternalSource |
Definition at line 19 of file dl_group.h.
|
strong |
This class represents elliptic curce domain parameters
Enumerator | |
---|---|
Explicit | |
ImplicitCA | |
NamedCurve | |
EC_DOMPAR_ENC_EXPLICIT | |
EC_DOMPAR_ENC_IMPLICITCA | |
EC_DOMPAR_ENC_OID |
Definition at line 24 of file ec_group.h.
|
strong |
Enumerator | |
---|---|
Builtin | |
ExternalSource |
Definition at line 34 of file ec_group.h.
|
strong |
Enumerator | |
---|---|
Uncompressed | |
Compressed | |
Hybrid | |
UNCOMPRESSED | |
COMPRESSED | |
HYBRID |
Definition at line 19 of file ec_point.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 |
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.
|
strong |
Enumerator | |
---|---|
Little | |
Big |
Definition at line 20 of file mdx_hash.h.
|
strong |
Enumeration of possible operations a public key could be used for.
It is possible to query if a key supports a particular operation type using Asymmetric_Key::supports_operation()
Enumerator | |
---|---|
Encryption | |
Signature | |
KeyEncapsulation | |
KeyAgreement |
Definition at line 45 of file pk_keys.h.
|
strong |
Enumeration specifying the signature format.
This is mostly used for requesting DER encoding of ECDSA signatures; most other algorithms only support "standard".
Enumerator | |
---|---|
Standard | |
DerSequence | |
IEEE_1363 | |
DER_SEQUENCE |
|
strong |
Enumerator | |
---|---|
WotsHash | |
WotsPublicKeyCompression | |
HashTree | |
ForsTree | |
ForsTreeRootsCompression | |
WotsKeyGeneration | |
ForsKeyGeneration |
Definition at line 20 of file sp_address.h.
|
strong |
Enumerator | |
---|---|
Shake256 | |
Sha256 | |
Haraka | Haraka is currently not supported. |
Definition at line 18 of file sp_parameters.h.
|
strong |
Enumerator | |
---|---|
Sphincs128Small | |
Sphincs128Fast | |
Sphincs192Small | |
Sphincs192Fast | |
Sphincs256Small | |
Sphincs256Fast |
Definition at line 24 of file sp_parameters.h.
|
strong |
|
strong |
Enumerator | |
---|---|
UNSPECIFIED | |
TLS_SERVER_AUTH | |
TLS_CLIENT_AUTH | |
CERTIFICATE_AUTHORITY | |
OCSP_RESPONDER | |
ENCRYPTION |
Definition at line 22 of file x509cert.h.
|
strong |
Determines how WOTS+ private keys are derived from the XMSS private key
Enumerator | |
---|---|
Botan2x | This roughly followed the suggestions in RFC 8391 but is vulnerable to a multi-target attack. For new private keys, we recommend using the derivation as suggested in NIST SP.800-208. Private keys generated with Botan 2.x will need to stay with this mode, otherwise they won't be able to generate valid signatures any longer. |
NIST_SP800_208 | Derivation as specified in NIST SP.800-208 to avoid a multi-target attack on the WOTS+ key derivation suggested in RFC 8391. New private keys should use this mode. |
Definition at line 136 of file xmss.h.
Return the absolute value
n | an integer |
Definition at line 22 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 20 of file allocator.cpp.
References BOTAN_CHECKED_MUL, and Botan::mlock_allocator::instance().
Referenced by Botan::secure_allocator< T >::allocate().
|
inline |
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 144 of file argon2.h.
bool Botan::argon2_check_pwhash | ( | const char * | password, |
size_t | password_len, | ||
std::string_view | 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 77 of file argon2fmt.cpp.
References base64_decode(), base64_decode_max_output(), Botan::PasswordHashFamily::create_or_throw(), Botan::CT::is_equal(), 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, | ||
size_t | salt_len, | ||
size_t | output_len ) |
Definition at line 42 of file argon2fmt.cpp.
References base64_encode(), Botan::PasswordHashFamily::create_or_throw(), fmt(), and Botan::RandomNumberGenerator::randomize().
std::string BOTAN_UNSTABLE_API Botan::asn1_class_to_string | ( | ASN1_Class | type | ) |
Definition at line 74 of file asn1_obj.cpp.
References Application, Constructed, ContextSpecific, NoObject, Private, and Universal.
Referenced by Botan::BER_Object::assert_is_a().
std::string BOTAN_UNSTABLE_API Botan::asn1_tag_to_string | ( | ASN1_Type | type | ) |
Definition at line 93 of file asn1_obj.cpp.
References BitString, BmpString, Boolean, Enumerated, GeneralizedTime, Ia5String, Integer, NoObject, Null, NumericString, ObjectId, OctetString, PrintableString, Sequence, Set, TeletexString, UniversalString, UtcTime, Utf8String, and VisibleString.
Referenced by Botan::BER_Object::assert_is_a().
void BOTAN_UNSTABLE_API Botan::assert_unreachable | ( | const char * | file, |
int | line ) |
Definition at line 54 of file assert.cpp.
References fmt().
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 29 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 164 of file base32.cpp.
secure_vector< uint8_t > Botan::base32_decode | ( | std::string_view | 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 168 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 151 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 156 of file base32.cpp.
References base_decode_full().
size_t Botan::base32_decode | ( | uint8_t | output[], |
std::string_view | 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 160 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 143 of file base32.cpp.
References base_encode().
Referenced by 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 147 of file base32.cpp.
References base_encode_to_string().
|
inline |
Perform base32 encoding
input | some input |
Definition at line 47 of file base32.h.
References base32_encode().
std::vector< uint8_t > Botan::base58_check_decode | ( | const char | input[], |
size_t | input_length ) |
Perform base58 decoding with checksum
Definition at line 166 of file base58.cpp.
References base58_decode().
Referenced by base58_check_decode().
|
inline |
Definition at line 58 of file base58.h.
References base58_check_decode().
std::string Botan::base58_check_encode | ( | const uint8_t | input[], |
size_t | input_length ) |
Perform base58 encoding with checksum
Definition at line 132 of file base58.cpp.
References base58_encode().
Referenced by base58_check_encode().
|
inline |
Definition at line 50 of file base58.h.
References 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 139 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 54 of file base58.h.
References base58_decode().
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 127 of file base58.cpp.
References base58_encode().
Referenced by base58_check_encode(), base58_encode(), and base58_encode().
|
inline |
Definition at line 46 of file base58.h.
References 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 174 of file base64.cpp.
size_t Botan::base64_decode | ( | std::span< uint8_t > | output, |
std::string_view | input, | ||
bool | ignore_ws = true ) |
Perform base64 decoding
output | a contiguous byte buffer 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 167 of file base64.cpp.
References base64_decode(), and base64_decode_max_output().
secure_vector< uint8_t > Botan::base64_decode | ( | std::string_view | 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 178 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 154 of file base64.cpp.
References base_decode().
Referenced by argon2_check_pwhash(), base64_decode(), 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 159 of file base64.cpp.
References base_decode_full().
size_t Botan::base64_decode | ( | uint8_t | output[], |
std::string_view | 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 163 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 186 of file base64.cpp.
Referenced by argon2_check_pwhash(), base64_decode(), 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 146 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 uint8_t | input[], |
size_t | input_length ) |
Perform base64 encoding
input | some input |
input_length | length of input in bytes |
Definition at line 150 of file base64.cpp.
References base_encode_to_string().
|
inline |
Perform base64 encoding
input | some input |
Definition at line 47 of file base64.h.
References base64_encode().
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 182 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 112 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 171 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 183 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 78 of file codec_base.h.
References base_encode(), and BOTAN_ASSERT_EQUAL.
Referenced by base32_encode(), and base64_encode().
void Botan::basecase_mul | ( | word | z[], |
size_t | z_size, | ||
const word | x[], | ||
size_t | x_size, | ||
const word | y[], | ||
size_t | y_size ) |
Basecase O(N^2) multiplication
Definition at line 20 of file mp_karat.cpp.
References carry(), clear_mem(), word8_madd3(), and word_madd3().
Referenced by bigint_mul().
void Botan::basecase_sqr | ( | word | z[], |
size_t | z_size, | ||
const word | x[], | ||
size_t | x_size ) |
Basecase O(N^2) squaring
Definition at line 46 of file mp_karat.cpp.
References carry(), clear_mem(), word8_madd3(), and word_madd3().
Referenced by bigint_sqr().
|
inline |
Bcrypt PBKDF compatible with OpenBSD bcrypt_pbkdf
Definition at line 74 of file bcrypt_pbkdf.h.
|
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 259 of file mp_core.h.
References bigint_add2_nc().
Referenced by Botan::BigInt::add().
|
inline |
Two operand addition with carry out
Definition at line 203 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 266 of file mp_core.h.
References bigint_add3_nc().
Referenced by Botan::BigInt::add2().
|
inline |
Three operand addition with carry out
Definition at line 228 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 490 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(), Botan::BigInt::cmp_word(), and gcd().
|
inline |
Definition at line 190 of file mp_core.h.
References carry(), Botan::CT::Mask< T >::expand(), and word_add().
|
inline |
Definition at line 72 of file mp_core.h.
References bigint_cnd_add().
|
inline |
Definition at line 40 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 123 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 158 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 112 of file mp_core.h.
References bigint_cnd_sub().
|
inline |
Definition at line 80 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().
BOTAN_FUZZER_API void Botan::bigint_comba_mul16 | ( | word | z[32], |
const word | x[16], | ||
const word | y[16] ) |
Definition at line 917 of file mp_comba.cpp.
References word3_muladd().
Referenced by bigint_mul().
BOTAN_FUZZER_API void Botan::bigint_comba_mul24 | ( | word | z[48], |
const word | x[24], | ||
const word | y[24] ) |
Definition at line 1721 of file mp_comba.cpp.
References word3_muladd().
Referenced by bigint_mul().
BOTAN_FUZZER_API void Botan::bigint_comba_mul4 | ( | word | z[8], |
const word | x[4], | ||
const word | y[4] ) |
Definition at line 54 of file mp_comba.cpp.
References word3_muladd().
Referenced by bigint_mul().
BOTAN_FUZZER_API void Botan::bigint_comba_mul6 | ( | word | z[12], |
const word | x[6], | ||
const word | y[6] ) |
Definition at line 159 of file mp_comba.cpp.
References word3_muladd().
Referenced by bigint_mul().
BOTAN_FUZZER_API void Botan::bigint_comba_mul8 | ( | word | z[16], |
const word | x[8], | ||
const word | y[8] ) |
Definition at line 323 of file mp_comba.cpp.
References word3_muladd().
Referenced by bigint_mul().
BOTAN_FUZZER_API void Botan::bigint_comba_mul9 | ( | word | z[18], |
const word | x[9], | ||
const word | y[9] ) |
Definition at line 542 of file mp_comba.cpp.
References word3_muladd().
Referenced by bigint_mul().
BOTAN_FUZZER_API void Botan::bigint_comba_sqr16 | ( | word | z[32], |
const word | x[16] ) |
Definition at line 681 of file mp_comba.cpp.
References word3_muladd(), and word3_muladd_2().
Referenced by bigint_sqr().
BOTAN_FUZZER_API void Botan::bigint_comba_sqr24 | ( | word | z[48], |
const word | x[24] ) |
Definition at line 1273 of file mp_comba.cpp.
References word3_muladd(), and word3_muladd_2().
Referenced by bigint_sqr().
BOTAN_FUZZER_API void Botan::bigint_comba_sqr4 | ( | word | z[8], |
const word | x[4] ) |
Definition at line 16 of file mp_comba.cpp.
References word3_muladd(), and word3_muladd_2().
Referenced by bigint_sqr().
BOTAN_FUZZER_API void Botan::bigint_comba_sqr6 | ( | word | z[12], |
const word | x[6] ) |
Definition at line 98 of file mp_comba.cpp.
References word3_muladd(), and word3_muladd_2().
Referenced by bigint_sqr().
BOTAN_FUZZER_API void Botan::bigint_comba_sqr8 | ( | word | z[16], |
const word | x[8] ) |
Definition at line 235 of file mp_comba.cpp.
References word3_muladd(), and word3_muladd_2().
Referenced by bigint_sqr().
BOTAN_FUZZER_API void Botan::bigint_comba_sqr9 | ( | word | z[18], |
const word | x[9] ) |
Definition at line 439 of file mp_comba.cpp.
References word3_muladd(), and word3_muladd_2().
Referenced by bigint_sqr().
|
inline |
Definition at line 568 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 536 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 665 of file mp_core.h.
References BOTAN_MP_WORD_BITS.
Referenced by bigint_modop_vartime(), and vartime_divide().
|
inline |
Definition at line 452 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 468 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 633 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 648 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 697 of file mp_core.h.
References bigint_divop_vartime(), BOTAN_MP_WORD_BITS, and word_madd2().
Referenced by operator%(), and Botan::BigInt::operator%=().
|
inline |
Montgomery Reduction
z | integer to reduce, of size exactly 2*p_size. 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 |
ws | array of at least p_size+1 words |
ws_size | size of ws in words |
Definition at line 757 of file mp_core.h.
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(), bigint_monty_redc_generic(), 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[32], |
const word | p[16], | ||
word | p_dash, | ||
word | ws[] ) |
Definition at line 325 of file mp_monty_n.cpp.
References bigint_sub3(), clear_mem(), Botan::CT::conditional_assign_mem(), word3_add(), and word3_muladd().
Referenced by bigint_monty_redc().
void Botan::bigint_monty_redc_24 | ( | word | z[48], |
const word | p[24], | ||
word | p_dash, | ||
word | ws[] ) |
Definition at line 746 of file mp_monty_n.cpp.
References bigint_sub3(), clear_mem(), Botan::CT::conditional_assign_mem(), word3_add(), and word3_muladd().
Referenced by bigint_monty_redc().
void Botan::bigint_monty_redc_32 | ( | word | z[64], |
const word | p[32], | ||
word | p_dash, | ||
word | ws[] ) |
Definition at line 1567 of file mp_monty_n.cpp.
References bigint_sub3(), clear_mem(), Botan::CT::conditional_assign_mem(), word3_add(), and word3_muladd().
Referenced by bigint_monty_redc().
void Botan::bigint_monty_redc_4 | ( | word | z[8], |
const word | p[4], | ||
word | p_dash, | ||
word | ws[] ) |
Definition at line 14 of file mp_monty_n.cpp.
References bigint_sub3(), clear_mem(), Botan::CT::conditional_assign_mem(), word3_add(), and word3_muladd().
Referenced by bigint_monty_redc().
void Botan::bigint_monty_redc_6 | ( | word | z[12], |
const word | p[6], | ||
word | p_dash, | ||
word | ws[] ) |
Definition at line 75 of file mp_monty_n.cpp.
References bigint_sub3(), clear_mem(), Botan::CT::conditional_assign_mem(), word3_add(), and word3_muladd().
Referenced by bigint_monty_redc().
void Botan::bigint_monty_redc_8 | ( | word | z[16], |
const word | p[8], | ||
word | p_dash, | ||
word | ws[] ) |
Definition at line 176 of file mp_monty_n.cpp.
References bigint_sub3(), clear_mem(), Botan::CT::conditional_assign_mem(), word3_add(), and word3_muladd().
Referenced by bigint_monty_redc().
void Botan::bigint_monty_redc_generic | ( | word | z[], |
size_t | z_size, | ||
const word | p[], | ||
size_t | p_size, | ||
word | p_dash, | ||
word | ws[] ) |
Definition at line 31 of file mp_monty.cpp.
References bigint_sub3(), BOTAN_ARG_CHECK, BOTAN_DEBUG_ASSERT, clear_mem(), Botan::CT::conditional_assign_mem(), word3_add(), and word3_muladd().
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 282 of file mp_karat.cpp.
References basecase_mul(), 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(), Botan::Montgomery_Params::mul_by(), Botan::Montgomery_Params::mul_by(), and operator*().
|
inline |
Definition at line 382 of file mp_core.h.
References BOTAN_MP_WORD_BITS, carry(), carry_shift(), clear_mem(), copy_mem(), and Botan::CT::Mask< T >::expand().
Referenced by Botan::BigInt::operator<<=().
|
inline |
Definition at line 417 of file mp_core.h.
References BOTAN_MP_WORD_BITS, carry(), carry_shift(), copy_mem(), and Botan::CT::Mask< T >::expand().
Referenced by Botan::BigInt::ct_shift_left(), and operator<<().
|
inline |
Definition at line 397 of file mp_core.h.
References BOTAN_MP_WORD_BITS, carry(), carry_shift(), clear_mem(), copy_mem(), and Botan::CT::Mask< T >::expand().
Referenced by Botan::BigInt::operator>>=().
|
inline |
Definition at line 431 of file mp_core.h.
References BOTAN_MP_WORD_BITS, carry(), carry_shift(), copy_mem(), and Botan::CT::Mask< T >::expand().
Referenced by gcd(), 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 326 of file mp_karat.cpp.
References basecase_sqr(), 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 273 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 298 of file mp_core.h.
References BOTAN_ASSERT, word8_sub2_rev(), and word_sub().
Referenced by Botan::BigInt::add().
|
inline |
Three operand subtraction
Expects that x_size >= y_size
Writes to z[0:x_size] and returns borrow
Definition at line 321 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_monty_redc_4(), bigint_monty_redc_6(), bigint_monty_redc_8(), bigint_monty_redc_generic(), 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 355 of file mp_core.h.
References Botan::CT::conditional_copy_mem(), word8_sub3(), and word_sub().
Referenced by Botan::BigInt::add2(), gcd(), 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 604 of file mp_core.h.
References bigint_cmp(), bigint_sub3(), Botan::CT::conditional_swap(), and Botan::CT::conditional_swap_ptr().
|
inlineconstexpr |
|
inline |
Definition at line 46 of file code_based_util.h.
Referenced by generate_mceliece_key(), mceliece_decrypt(), and Botan::McEliece_PrivateKey::McEliece_PrivateKey().
|
inline |
Definition at line 42 of file code_based_util.h.
Referenced by mceliece_decrypt().
Botan::BOTAN_FUNC_ISA | ( | "avx2" | ) |
Definition at line 160 of file argon2_avx2.cpp.
References T.
Botan::BOTAN_FUNC_ISA | ( | "sse2" | ) |
Definition at line 126 of file idea_sse2.cpp.
References Botan::CT::poison(), and Botan::CT::unpoison().
Botan::BOTAN_FUNC_ISA | ( | " | ssse3, |
aes" | ) |
Definition at line 125 of file aes_ni.cpp.
References Botan::SIMD_4x32::load_le(), and Botan::SIMD_4x32::store_le().
Botan::BOTAN_FUNC_ISA | ( | BOTAN_VPERM_ISA | ) |
Definition at line 483 of file zfec_vperm.cpp.
References Botan::SIMD_4x32::load_le(), and Botan::SIMD_4x32::splat_u8().
size_t Botan::buffer_insert | ( | std::vector< T, Alloc > & | buf, |
size_t | buf_offset, | ||
const std::vector< T, Alloc2 > & | input ) |
Definition at line 324 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 313 of file mem_ops.h.
References BOTAN_ASSERT_NOMSG, and copy_mem().
|
inline |
Definition at line 28 of file ed25519_internal.h.
Referenced by basecase_mul(), basecase_sqr(), 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 49 of file ed25519_internal.h.
|
inline |
Definition at line 39 of file ed25519_internal.h.
|
inline |
Definition at line 105 of file donna128.h.
Referenced by bigint_shl1(), bigint_shl2(), bigint_shr1(), and bigint_shr2().
|
inline |
|
inline |
Definition at line 272 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(), check_bcrypt(), Botan::cSHAKE_XOF::cSHAKE_XOF(), Botan::CryptoBox::decrypt(), Botan::CryptoBox::decrypt_bin(), Botan::PK_Key_Agreement::derive_key(), Botan::PK_Key_Agreement::derive_key(), Botan::KDF::derive_key(), Botan::KDF::derive_key(), Botan::KDF::derive_key(), Botan::Scrypt::derive_key(), Botan::Encrypted_PSK_Database::get(), hkdf_expand_label(), Botan::Pipe::process_msg(), Botan::Encrypted_PSK_Database::remove(), 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 276 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 |
|
constexpr |
Definition at line 122 of file bit_ops.h.
References T.
Referenced by Botan::BigInt::ct_shift_left(), Botan::McEliece_PublicKey::get_message_word_bit_length(), Botan::McEliece_PrivateKey::McEliece_PrivateKey(), Botan::McEliece_PrivateKey::McEliece_PrivateKey(), and mceliece_work_factor().
Return the number of bytes necessary to contain bits
bits.
Definition at line 144 of file bit_ops.h.
Referenced by Botan::FrodoMatrix::unpack().
BOTAN_TEST_API std::vector< WotsHashIndex > Botan::chain_lengths | ( | const SphincsTreeNode & | msg, |
const Sphincs_Parameters & | params ) |
Given a msg
construct the lengths (amount of hashes for signature) for each WOTS+ chain, including the checksum.
Definition at line 85 of file sp_wots.cpp.
References Botan::detail::Strong_Base< T >::get(), Botan::Sphincs_Parameters::wots_len_1(), and Botan::Sphincs_Parameters::wots_len_2().
Referenced by wots_public_key_from_signature(), and xmss_sign_and_pkgen().
bool Botan::check_bcrypt | ( | std::string_view | password, |
std::string_view | hash ) |
Check a previously created password hash
password | the password to check against |
hash | the stored hash to check against |
Definition at line 159 of file bcrypt.cpp.
References cast_char_ptr_to_uint8(), Botan::CT::is_equal(), and to_uint16().
Referenced by botan_bcrypt_is_valid().
bool Botan::check_passhash9 | ( | std::string_view | password, |
std::string_view | hash ) |
Check a previously created password hash
password | the password to check against |
hash | the stored hash to check against |
Definition at line 75 of file passhash9.cpp.
References base64_decode(), Botan::OctetString::bits_of(), Botan::PBKDF::derive_key(), and Botan::CT::is_equal().
|
inline |
Definition at line 30 of file safeint.h.
RT Botan::checked_cast_to | ( | AT | i | ) |
|
inline |
Definition at line 47 of file safeint.h.
Definition at line 180 of file bit_ops.h.
Referenced by majority(), Botan::CT::Mask< T >::select(), SHA2_32_F(), and SHA2_64_F().
|
inlineconstexpr |
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 103 of file mem_ops.h.
Referenced by clear_mem(), clear_mem(), and Botan::Memory_Pool::Memory_Pool().
|
inlineconstexpr |
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.
mem | a contiguous range of Ts to zero |
Definition at line 132 of file mem_ops.h.
References clear_bytes(), and Botan::ranges::size_bytes().
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 120 of file mem_ops.h.
References clear_bytes(), and T.
Referenced by base_decode(), basecase_mul(), basecase_sqr(), 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_monty_redc_generic(), bigint_mul(), bigint_shl1(), bigint_shr1(), bigint_sqr(), Botan_FFI::botan_view_bin_bounce_fn(), Botan::AlignmentBuffer< T, BLOCK_SIZE, FINAL_BLOCK_STRATEGY >::clear(), Botan::Sodium::crypto_secretbox_xsalsa20poly1305(), Botan::Sodium::crypto_secretbox_xsalsa20poly1305_open(), Botan::BigInt::ct_reduce_below(), Botan::BigInt::ct_shift_left(), Botan::Bcrypt_PBKDF::derive_key(), Botan::ZFEC::encode_shares(), Botan::BigInt::encode_words(), Botan::FE_25519::FE_25519(), Botan::AlignmentBuffer< T, BLOCK_SIZE, FINAL_BLOCK_STRATEGY >::fill_up_with_zeros(), Botan::StreamCipher::generate_keystream(), hex_decode(), Botan::BLAKE2b::key_schedule(), Botan::PKCS11::MechanismWrapper::MechanismParameters::MechanismParameters(), Botan::EC_Point_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_FFI::write_output(), Botan::Zlib_Style_Stream< Stream, ByteType, StreamLenType >::Zlib_Style_Stream(), and Botan::Zlib_Style_Stream< Stream, ByteType, StreamLenType >::~Zlib_Style_Stream().
|
inline |
Definition at line 109 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 134 of file commoncrypto_utils.cpp.
References Botan::CommonCryptor_Opts::algo, and copy_mem().
CommonCryptor_Opts Botan::commoncrypto_opts_from_algo | ( | std::string_view | algo | ) |
Definition at line 96 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 | ( | std::string_view | algo_name | ) |
Definition at line 56 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().
BOTAN_TEST_API void Botan::compute_root | ( | StrongSpan< SphincsTreeNode > | out, |
const Sphincs_Parameters & | params, | ||
Sphincs_Hash_Functions & | hashes, | ||
const SphincsTreeNode & | leaf, | ||
TreeNodeIndex | leaf_idx, | ||
uint32_t | idx_offset, | ||
StrongSpan< const SphincsAuthenticationPath > | authentication_path, | ||
uint32_t | tree_height, | ||
Sphincs_Address & | tree_address ) |
Using a leaf node and the authentication path (neighbor nodes on the way from leaf to root), computes the the root node of the respective tree. This function is generic and used by FORS and XMSS in the SPHINCS+ verification logic.
Definition at line 111 of file sp_treehash.cpp.
References BOTAN_ASSERT_NOMSG, Botan::BufferSlicer::empty(), Botan::Sphincs_Parameters::n(), Botan::Sphincs_Address::set_tree_height(), Botan::Sphincs_Address::set_tree_index(), Botan::StrongSpan< T >::size(), Botan::Sphincs_Hash_Functions::T(), and Botan::BufferSlicer::take().
Referenced by fors_public_key_from_signature(), and ht_verify().
decltype(auto) Botan::concat | ( | Ts &&... | buffers | ) |
Concatenate an arbitrary number of buffers.
buffers
as the container type of the first buffer Definition at line 257 of file stl_util.h.
Referenced by Botan::PKIX::check_ocsp(), concat_as(), Botan::Kyber_PrivateKey::private_key_bits(), Botan::SphincsPlus_PrivateKey::private_key_bits(), and Botan::TLS::Hybrid_KEM_PublicKey::public_value().
ResultT Botan::concat_as | ( | Ts &&... | buffers | ) |
Concatenate an arbitrary number of buffers and define the output buffer type as a mandatory template parameter.
buffers
as the user-defined container type Definition at line 273 of file stl_util.h.
References concat().
|
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 90 of file mem_ops.h.
References constant_time_compare().
bool Botan::constant_time_compare | ( | std::span< const uint8_t > | x, |
std::span< const uint8_t > | y ) |
Memory comparison, input insensitive
x | a range of bytes |
y | another range of bytes |
Definition at line 17 of file mem_ops.cpp.
References Botan::CT::Mask< T >::expand(), Botan::CT::is_equal(), Botan::CT::Mask< T >::is_equal(), and Botan::CT::Mask< T >::is_lte().
Referenced by constant_time_compare().
|
inlineconstexpr |
Copy memory
out | the destination array |
in | the source array |
Definition at line 162 of file mem_ops.h.
References Botan::ranges::assert_equal_byte_lengths(), and Botan::ranges::size_bytes().
Copy memory
out | the destination array |
in | the source array |
n | the number of elements of in/out |
Definition at line 146 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(), bigint_shl1(), bigint_shl2(), bigint_shr1(), bigint_shr2(), Botan::Argon2::blamka(), botan_privkey_ed25519_get_privkey(), botan_privkey_x25519_get_privkey(), botan_pubkey_ed25519_get_pubkey(), botan_pubkey_x25519_get_pubkey(), Botan_FFI::botan_view_bin_bounce_fn(), buffer_insert(), buffer_insert(), Botan::Ed25519_PublicKey::check_key(), 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_words(), Botan::CryptoBox::encrypt(), expand_message_xmd(), Botan::FE_25519::FE_25519(), Botan::RawHashFunction::final_result(), 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(), Botan::BLAKE2b::key_schedule(), mceliece_decrypt(), Botan::Montgomery_Params::mul_by(), Botan::Montgomery_Params::mul_by(), nist_key_unwrap(), nist_key_unwrap_padded(), nist_key_wrap(), nist_key_wrap_padded(), operator^(), Botan::DataSource_Memory::peek(), 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(), and Botan_FFI::write_output().
Definition at line 507 of file loadstor.h.
References get_byte_var(), store_be(), and T.
Referenced by copy_out_vec_be().
Definition at line 526 of file loadstor.h.
References get_byte_var(), store_le(), and T.
Referenced by 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 521 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 540 of file loadstor.h.
References copy_out_le().
Referenced by Botan::BLAKE2b::final_result().
|
inline |
Definition at line 25 of file frodo_aes_generator.h.
References BOTAN_ASSERT_NOMSG, Botan::FrodoKEMMode::is_aes(), Botan::FrodoKEMConstants::mode(), Botan::FrodoKEMConstants::n(), Botan::BufferStuffer::next(), Botan::SymmetricAlgorithm::set_key(), and store_le().
std::unique_ptr< Private_Key > Botan::create_ec_private_key | ( | std::string_view | algo_name, |
const EC_Group & | group, | ||
RandomNumberGenerator & | rng ) |
Create a new ECC key
Definition at line 329 of file pk_algs.cpp.
References BOTAN_UNUSED.
Referenced by create_private_key().
std::string Botan::create_hex_fingerprint | ( | const uint8_t | bits[], |
size_t | bits_len, | ||
std::string_view | hash_name ) |
Definition at line 30 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().
|
inline |
Definition at line 386 of file pk_keys.h.
References create_hex_fingerprint().
std::unique_ptr< Private_Key > Botan::create_private_key | ( | std::string_view | algo_name, |
RandomNumberGenerator & | rng, | ||
std::string_view | algo_params = "", | ||
std::string_view | 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 374 of file pk_algs.cpp.
References BOTAN_UNUSED, Botan::Sphincs_Parameters::create(), create_ec_private_key(), Botan::DilithiumMode::Dilithium6x5, fmt(), Botan::FrodoKEMMode::FrodoKEM976_SHAKE, Botan::KyberMode::Kyber1024_R3, Botan::XMSS_Parameters::oid(), split_on(), to_u32bit(), and Botan::XMSS_Parameters::XMSS_SHA2_10_512.
Referenced by botan_privkey_create(), and Botan::TLS::Hybrid_KEM_PrivateKey::generate_from_group().
|
inline |
Definition at line 23 of file frodo_shake_generator.h.
References BOTAN_ASSERT_NOMSG, Botan::FrodoKEMMode::is_shake(), Botan::FrodoKEMConstants::mode(), and store_le().
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 13 of file mem_ops.cpp.
References Botan::CT::is_equal().
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 49 of file divide.h.
References ct_divide().
BOTAN_TEST_API void Botan::ct_divide | ( | const BigInt & | x, |
const BigInt & | y, | ||
BigInt & | q, | ||
BigInt & | r ) |
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 48 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_zero(), Botan::BigInt::mutable_data(), Botan::BigInt::sig_words(), Botan::BigInt::size(), and Botan::BigInt::with_capacity().
Referenced by ct_divide(), Botan::FPE_FE1::decrypt(), Botan::FPE_FE1::encrypt(), lcm(), and Botan::Modular_Reducer::Modular_Reducer().
BOTAN_TEST_API void Botan::ct_divide_word | ( | const BigInt & | x, |
word | y, | ||
BigInt & | q, | ||
word & | r ) |
BigInt division, const time variant
This runs with control flow independent of the values of x/y. Warning: the loop bounds still leaks the size of x.
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 80 of file divide.cpp.
References Botan::BigInt::bits(), BOTAN_MP_WORD_BITS, Botan::BigInt::conditionally_set_bit(), Botan::CT::Mask< T >::expand(), Botan::BigInt::flip_sign(), Botan::BigInt::get_bit(), Botan::CT::Mask< T >::is_gte(), Botan::BigInt::is_negative(), Botan::BigInt::sig_words(), and Botan::BigInt::with_capacity().
Referenced by operator/(), and Botan::BigInt::to_dec_string().
If arg is zero, return ~0. Otherwise return 0
Definition at line 33 of file bit_ops.h.
Referenced by ctz(), and prefetch_array_raw().
BOTAN_TEST_API BigInt Botan::ct_modulo | ( | const BigInt & | x, |
const BigInt & | modulo ) |
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 117 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::sig_words(), Botan::BigInt::size(), and Botan::BigInt::with_capacity().
Referenced by Botan::RSA_PrivateKey::check_key(), inverse_mod(), Botan::Modular_Reducer::reduce(), Botan::RSA_PrivateKey::RSA_PrivateKey(), and Botan::RSA_PrivateKey::RSA_PrivateKey().
|
inlineconstexpr |
Count the trailing zero bits in n
n | an integer value |
Definition at line 102 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 18 of file curve25519.cpp.
References curve25519_donna().
Referenced by 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 452 of file donna.cpp.
References copy_mem(), Botan::CT::poison(), and Botan::CT::unpoison().
Referenced by 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 48 of file allocator.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 101 of file gf2m_small_m.cpp.
Referenced by Botan::polyn_gf2m::polyn_gf2m().
size_t BOTAN_TEST_API 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_TEST_API 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 47 of file workfactor.cpp.
References if_work_factor().
|
inline |
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 20 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 37 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 73 of file ed25519.cpp.
References Botan::Buffered_Computation::final(), ge_double_scalarmult_vartime(), ge_frombytes_negate_vartime(), Botan::CT::is_equal(), 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 95 of file gf2m_small_m.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().
void BOTAN_TEST_API Botan::expand_message_xmd | ( | std::string_view | hash_fn, |
uint8_t | output[], | ||
size_t | output_len, | ||
const uint8_t | input[], | ||
size_t | input_len, | ||
const uint8_t | domain_sep[], | ||
size_t | domain_sep_len ) |
expand_message_xmd
Definition at line 17 of file ec_h2c.cpp.
References copy_mem(), Botan::HashFunction::create_or_throw(), and fmt().
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 174 of file ed25519_fe.h.
Referenced by ge_frombytes_negate_vartime().
Definition at line 178 of file ed25519_fe.h.
References Botan::FE_25519::add().
Referenced by ge_frombytes_negate_vartime().
Definition at line 158 of file ed25519_fe.h.
|
inline |
Definition at line 150 of file ed25519_fe.h.
References Botan::FE_25519::from_bytes().
Referenced by ge_frombytes_negate_vartime().
Definition at line 206 of file ed25519_fe.h.
References Botan::FE_25519::invert().
|
inline |
Definition at line 166 of file ed25519_fe.h.
References Botan::FE_25519::is_negative().
Referenced by ge_frombytes_negate_vartime().
|
inline |
Definition at line 162 of file ed25519_fe.h.
References Botan::FE_25519::is_zero().
Referenced by ge_frombytes_negate_vartime().
Definition at line 190 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 186 of file ed25519_fe.h.
References Botan::FE_25519::negate().
Referenced by ge_frombytes_negate_vartime().
Definition at line 210 of file ed25519_fe.h.
References Botan::FE_25519::pow_22523().
Referenced by ge_frombytes_negate_vartime().
Definition at line 194 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 202 of file ed25519_fe.h.
References Botan::FE_25519::sqr2().
Definition at line 198 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 182 of file ed25519_fe.h.
References Botan::FE_25519::sub().
Referenced by ge_frombytes_negate_vartime().
|
inline |
Definition at line 154 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 254 of file gf2m_rootfind_dcmp.cpp.
References find_roots_gf2m_decomp().
Referenced by find_roots_gf2m_decomp().
std::string Botan::fmt | ( | std::string_view | format, |
const T &... | args ) |
Simple formatter utility.
Should be replaced with std::format once that's available on all our supported compilers.
'{}' markers in the format string are replaced by the arguments. Unlike std::format, there is no support for escaping or for any kind of conversion flags.
Definition at line 53 of file fmt.h.
References Botan::fmt_detail::do_fmt().
Referenced by Botan::GOST_3410_PublicKey::algo_name(), Botan::TLS::KEX_to_KEM_Adapter_PublicKey::algo_name(), argon2_generate_pwhash(), assert_unreachable(), Botan::TLS::auth_method_from_string(), Botan::CBC_Mode::CBC_Mode(), Botan::CCM_Mode::CCM_Mode(), Botan::CFB_Mode::CFB_Mode(), Botan::CMAC::CMAC(), Botan::Comb4P::Comb4P(), Botan::AES_256_CTR_XOF::copy_state(), Botan::KDF::create(), Botan::Private_Key::create_decryption_op(), Botan::PKCS11::MechanismWrapper::create_ecdh_mechanism(), Botan::PKCS11::MechanismWrapper::create_ecdsa_mechanism(), Botan::Public_Key::create_encryption_op(), Botan::Private_Key::create_kem_decryption_op(), Botan::Public_Key::create_kem_encryption_op(), Botan::Private_Key::create_key_agreement_op(), create_private_key(), Botan::Private_Key::create_signature_op(), Botan::Public_Key::create_verification_op(), Botan::Public_Key::create_x509_verification_op(), Botan::PEM_Code::decode(), Botan::PEM_Code::decode_check_label(), Botan::ASN1_String::decode_from(), Botan::DL_Group::DL_Group(), Botan::DL_Group::DL_Group(), Botan::EAX_Mode::EAX_Mode(), Botan::EC_Group::EC_Group(), Botan::PEM_Code::encode(), expand_message_xmd(), Botan::Stream_Decompression::finish(), Botan::PSS_Params::from_emsa_name(), Botan::OID::from_string(), Botan::GCM_Mode::GCM_Mode(), generate_dsa_primes(), Botan::GOST_28147_89_Params::GOST_28147_89_Params(), Botan::GOST_3410_PrivateKey::GOST_3410_PrivateKey(), Botan::GOST_3410_PublicKey::GOST_3410_PublicKey(), Botan::Sphincs_Parameters::hash_name(), hex_decode(), hkdf_expand_label(), Botan::HTTP::http_sync(), Botan::Keccak_1600::Keccak_1600(), Botan::TLS::kex_method_from_string(), Botan::Lion::Lion(), load_private_key(), load_public_key(), Botan::PEM_Code::matches(), Botan::CCM_Mode::name(), Botan::CBC_Mode::name(), Botan::CFB_Mode::name(), Botan::Cascade_Cipher::name(), Botan::Lion::name(), Botan::BLAKE2b::name(), Botan::BLAKE2s::name(), Botan::Comb4P::name(), Botan::Keccak_1600::name(), Botan::SHA_3::name(), Botan::SHAKE_128::name(), Botan::SHAKE_256::name(), Botan::Skein_512::name(), Botan::Streebog::name(), Botan::Truncated_Hash::name(), Botan::HKDF::name(), Botan::HKDF_Extract::name(), Botan::HKDF_Expand::name(), Botan::KDF1::name(), Botan::KDF1_18033::name(), Botan::KDF2::name(), Botan::TLS_12_PRF::name(), Botan::SP800_108_Counter::name(), Botan::SP800_108_Feedback::name(), Botan::SP800_108_Pipeline::name(), Botan::SP800_56A_Hash::name(), Botan::SP800_56A_HMAC::name(), Botan::SP800_56C::name(), Botan::CMAC::name(), Botan::GMAC::name(), Botan::HMAC::name(), Botan::KMAC128::name(), Botan::KMAC256::name(), Botan::SipHash::name(), Botan::FPE_FE1::name(), Botan::PBKDF2_Family::name(), Botan::PKCS5_PBKDF2::name(), Botan::RFC4880_S2K_Family::name(), Botan::HMAC_DRBG::name(), Botan::ChaCha::name(), Botan::CTR_BE::name(), Botan::OFB::name(), Botan::GCM_Mode::name(), Botan::Asymmetric_Key::object_identifier(), Botan::OID::OID(), pbes2_decrypt(), Botan::PK_Decryptor_EME::PK_Decryptor_EME(), Botan::PK_Encryptor_EME::PK_Encryptor_EME(), Botan::PK_KEM_Decryptor::PK_KEM_Decryptor(), Botan::PK_KEM_Encryptor::PK_KEM_Encryptor(), Botan::PK_Key_Agreement::PK_Key_Agreement(), Botan::PK_Signer::PK_Signer(), Botan::PK_Verifier::PK_Verifier(), Botan::PK_Verifier::PK_Verifier(), Botan::Credentials_Manager::psk(), Botan::Dynamically_Loaded_Library::resolve_symbol(), Botan::RFC6979_Nonce_Generator::RFC6979_Nonce_Generator(), Botan::Sqlite3_Database::row_count(), Botan::RSA_PrivateKey::RSA_PrivateKey(), runtime_version_check(), Botan::SHA_3::SHA_3(), Botan::SHAKE_128::SHAKE_128(), Botan::SHAKE_256::SHAKE_256(), split_on(), srp6_client_agree(), srp6_generate_verifier(), Botan::XOF::start(), Botan::SRP6_Server_Session::step1(), Botan::SRP6_Server_Session::step2(), Botan::Streebog::Streebog(), string_to_ipv4(), throw_invalid_argument(), throw_invalid_state(), Botan::ASN1_Time::to_string(), Botan::Sphincs_Parameters::to_string(), Botan::Argon2::to_string(), Botan::Bcrypt_PBKDF::to_string(), Botan::PBKDF2::to_string(), Botan::RFC4880_S2K::to_string(), Botan::Scrypt::to_string(), Botan::UUID::UUID(), Botan::TLS::Certificate_Type_Base::validate_selection(), Botan::PK_Ops::Verification_with_Hash::Verification_with_Hash(), Botan::XMSS_Hash::XMSS_Hash(), Botan::XMSS_Parameters::xmss_id_from_string(), Botan::XMSS_WOTS_Parameters::xmss_wots_id_from_string(), and Botan::XTS_Mode::XTS_Mode().
std::string Botan::format_char_for_display | ( | char | c | ) |
Return a string containing 'c', quoted and possibly escaped
This is used when creating an error message nothing an invalid character in some codex (for example during hex decoding)
Currently this function escapes tab, newlines and carriage return as "\t", "\n", and "\r", and also escapes characters > 0x7F as "\xHH" where HH is the hex code.
Definition at line 98 of file charset.cpp.
Referenced by hex_decode().
BOTAN_TEST_API SphincsTreeNode Botan::fors_public_key_from_signature | ( | const SphincsHashedMessage & | hashed_message, |
StrongSpan< const ForsSignature > | signature, | ||
const Sphincs_Address & | address, | ||
const Sphincs_Parameters & | params, | ||
Sphincs_Hash_Functions & | hash ) |
Reconstructs the FORS public key from a given FORS signature
and message
. This is tailored for the use case in the SPHINCS+ implementation and is not meant for general usability.
Definition at line 112 of file sp_fors.cpp.
References Botan::Sphincs_Parameters::a(), Botan::Sphincs_Address::as_keypair_from(), BOTAN_ASSERT_NOMSG, compute_root(), Botan::BufferStuffer::full(), Botan::Sphincs_Parameters::k(), Botan::Sphincs_Parameters::n(), Botan::BufferStuffer::next(), Botan::Sphincs_Address::set_type(), Botan::Sphincs_Hash_Functions::T(), and Botan::BufferSlicer::take().
BOTAN_TEST_API SphincsTreeNode Botan::fors_sign_and_pkgen | ( | StrongSpan< ForsSignature > | sig_out, |
const SphincsHashedMessage & | hashed_message, | ||
const SphincsSecretSeed & | secret_seed, | ||
const Sphincs_Address & | address, | ||
const Sphincs_Parameters & | params, | ||
Sphincs_Hash_Functions & | hashes ) |
Implements a domain specific wrapper for the few-times signature scheme FORS (Forest of Random Subsets). It is meant to be used inside SPHINCS+ and does not aim to be applicable for other use cases.
Definition at line 46 of file sp_fors.cpp.
References Botan::Sphincs_Parameters::a(), Botan::Sphincs_Address::as_keypair_from(), BOTAN_ASSERT_NOMSG, Botan::Sphincs_Parameters::fors_signature_bytes(), ForsKeyGeneration, ForsTree, Botan::BufferStuffer::full(), Botan::Sphincs_Parameters::k(), Botan::Sphincs_Parameters::n(), Botan::BufferStuffer::next(), Botan::Sphincs_Hash_Functions::PRF(), Botan::Sphincs_Address::set_type(), Botan::StrongSpan< T >::size(), Botan::Sphincs_Hash_Functions::T(), and treehash().
Definition at line 44 of file noekeon_simd.cpp.
References T.
Referenced by Botan::Noekeon::decrypt_n(), and Botan::Noekeon::encrypt_n().
Compute the greatest common divisor
x | a positive integer |
y | a positive integer |
Definition at line 193 of file numthry.cpp.
References abs(), bigint_cmp(), bigint_shr2(), bigint_sub_abs(), BOTAN_DEBUG_ASSERT, Botan::BigInt::const_time_poison(), Botan::BigInt::is_zero(), Botan::BigInt::Positive, Botan::BigInt::sig_words(), and Botan::BigInt::with_capacity().
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 480 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 Botan::Ed25519_PublicKey::check_key(), and ed25519_verify().
int Botan::ge_frombytes_negate_vartime | ( | ge_p3 * | v, |
const uint8_t * | s ) |
Definition at line 425 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 Botan::Ed25519_PublicKey::check_key(), and ed25519_verify().
void Botan::ge_scalarmult_base | ( | uint8_t | out[32], |
const uint8_t | in[32] ) |
Definition at line 2043 of file ge.cpp.
References carry().
Referenced by ed25519_gen_keypair(), and ed25519_sign().
|
constexprnoexcept |
Converts a given variant into another variant-ish whose type states are a super set of the given variant.
This is useful to convert restricted variant types into more general variants types.
Definition at line 300 of file stl_util.h.
|
constexprnoexcept |
Converts a given variant into another variant-ish whose type states are a super set of the given variant.
This is useful to convert restricted variant types into more general variants types.
Definition at line 314 of file stl_util.h.
std::string Botan::generate_bcrypt | ( | std::string_view | 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 144 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 134 of file dsa_gen.cpp.
References generate_dsa_primes(), and Botan::RandomNumberGenerator::randomize().
bool BOTAN_TEST_API 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 53 of file dsa_gen.cpp.
References Botan::BigInt::binary_decode(), Botan::BigInt::bits(), Botan::HashFunction::create_or_throw(), final, fmt(), is_prime(), operator++(), 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 184 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 | ( | std::string_view | 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 46 of file passhash9.cpp.
References base64_encode(), Botan::OctetString::bits_of(), BOTAN_ARG_CHECK, Botan::PBKDF::derive_key(), and Botan::RandomNumberGenerator::randomize().
BOTAN_TEST_API BigInt Botan::generate_rfc6979_nonce | ( | const BigInt & | x, |
const BigInt & | q, | ||
const BigInt & | h, | ||
std::string_view | 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 43 of file rfc6979.cpp.
References 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 211 of file make_prm.cpp.
References Botan::BigInt::bits(), BOTAN_DEBUG_ASSERT, 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().
|
inline |
Get an AEAD mode by name (eg "AES-128/GCM" or "Serpent/EAX")
name | AEAD name |
direction | Cipher_Dir::Encryption or Cipher_Dir::Decryption |
Definition at line 144 of file aead.h.
References Botan::AEAD_Mode::create(), and name.
|
inlineconstexpr |
Byte extraction
input | the value to extract from |
Definition at line 37 of file loadstor.h.
References T.
Referenced by store_le().
|
inlineconstexpr |
Byte extraction
byte_num | which byte to extract, 0 == highest byte |
input | the value to extract from |
Definition at line 27 of file loadstor.h.
References T.
Referenced by Botan::TLS::append_tls_length_value(), Botan::BigInt::binary_encode(), Botan::BigInt::byte_at(), copy_out_be(), copy_out_le(), Botan::CCM_Mode::encode_length(), Botan::TLS::Certificate_12::serialize(), and Botan::TLS::Certificate_Status::serialize().
|
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 201 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 215 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 231 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 | Cipher_Dir::Encryption or Cipher_Dir::Decryption |
provider | provider implementation to choose |
Definition at line 245 of file cipher_mode.h.
References Botan::Cipher_Mode::create().
BOTAN_TEST_API std::vector< std::string > Botan::get_files_recursive | ( | std::string_view | dir | ) |
Definition at line 121 of file filesystem.cpp.
References BOTAN_UNUSED.
|
inline |
Factory method for KDF (key derivation function)
algo_spec | the name of the KDF to create |
Prefer KDF::create
Definition at line 215 of file kdf.h.
References Botan::KDF::create().
|
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 242 of file pbkdf.h.
|
inline |
Definition at line 30 of file code_based_util.h.
BOTAN_TEST_API bool Botan::has_filesystem_impl | ( | ) |
Definition at line 111 of file filesystem.cpp.
EC_Point Botan::hash_to_curve_sswu | ( | const EC_Group & | group, |
std::string_view | hash_fn, | ||
const uint8_t | input[], | ||
size_t | input_len, | ||
const uint8_t | domain_sep[], | ||
size_t | domain_sep_len, | ||
bool | random_oracle ) |
Hash an input onto an elliptic curve point using the methods from RFC 9380
This method requires that the ECC group have (a*b) != 0 which excludes certain groups including secp256k1
Definition at line 184 of file ec_h2c.cpp.
References Botan::EC_Group::get_p().
Referenced by Botan::EC_Group::hash_to_curve().
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 157 of file hex.cpp.
References hex_decode().
size_t Botan::hex_decode | ( | std::span< uint8_t > | output, |
std::string_view | input, | ||
bool | ignore_ws = true ) |
Perform hex decoding
output | a contiguous byte buffer 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 140 of file hex.cpp.
References hex_decode().
std::vector< uint8_t > Botan::hex_decode | ( | std::string_view | 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 166 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 125 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 81 of file hex.cpp.
References clear_mem(), fmt(), and format_char_for_display().
Referenced by botan_hex_decode(), Botan::Hex_Decoder::end_msg(), Botan::TLS::Session_Manager_SQL::find_some(), hex_decode(), 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[], |
std::string_view | 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 136 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 144 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 | ( | std::string_view | 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 153 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 33 of file hex.cpp.
Referenced by botan_hex_encode(), create_hex_fingerprint(), hex_encode(), hex_encode(), Botan::TLS::Session_Manager_SQL::remove(), Botan::TLS::Session_Manager_SQL::retrieve_one(), Botan::TLS::Session_Manager_SQL::store(), 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 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 43 of file hex.cpp.
References hex_encode().
|
inline |
Perform hex encoding
input | some input |
uppercase | should output be upper or lower case? |
Definition at line 43 of file hex.h.
References hex_encode().
|
inlineconstexpr |
Return the index of the highest set bit T is an unsigned integer type
n | an integer value |
Definition at line 58 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_TEST_API Botan::hkdf_expand_label | ( | std::string_view | hash_fn, |
const uint8_t | secret[], | ||
size_t | secret_len, | ||
std::string_view | 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 131 of file hkdf.cpp.
References BOTAN_ARG_CHECK, cast_char_ptr_to_uint8(), copy_mem(), Botan::MessageAuthenticationCode::create_or_throw(), fmt(), and Botan::HKDF_Expand::kdf().
|
constexprnoexcept |
Definition at line 278 of file stl_util.h.
Referenced by Botan::TLS::Channel_Impl_13::from_peer().
BOTAN_TEST_API bool Botan::host_wildcard_match | ( | std::string_view | wildcard, |
std::string_view | host ) |
Check if the given hostname is a match for the specified wildcard
Definition at line 207 of file parsing.cpp.
References tolower_string().
Referenced by Botan::X509_Certificate::matches_dns_name().
void Botan::ht_sign | ( | StrongSpan< SphincsHypertreeSignature > | out_sig, |
const SphincsTreeNode & | message_to_sign, | ||
const SphincsSecretSeed & | secret_seed, | ||
XmssTreeIndexInLayer | tree_index_in_layer, | ||
TreeNodeIndex | idx_leaf, | ||
const Sphincs_Parameters & | params, | ||
Sphincs_Hash_Functions & | hashes ) |
Creates a SPHINCS+ XMSS hypertree signature of message_to_sign
. The signature is written into the buffer defined by out_sig
. tree_index_in_layer
and idx_leaf
define which XMSS tree of the hypertree and which leaf of this XMSS tree is used for signing.
Definition at line 21 of file sp_hypertree.cpp.
References BOTAN_ASSERT_NOMSG, Botan::Sphincs_Address::copy_subtree_from(), Botan::Sphincs_Parameters::d(), Botan::BufferStuffer::full(), Botan::detail::Strong_Base< T >::get(), HashTree, Botan::Sphincs_Parameters::ht_signature_bytes(), Botan::BufferStuffer::next(), Botan::Sphincs_Address::set_keypair(), Botan::Sphincs_Address::set_layer(), Botan::Sphincs_Address::set_tree(), Botan::StrongSpan< T >::size(), WotsHash, xmss_sign_and_pkgen(), Botan::Sphincs_Parameters::xmss_signature_bytes(), and Botan::Sphincs_Parameters::xmss_tree_height().
bool Botan::ht_verify | ( | const SphincsTreeNode & | signed_msg, |
StrongSpan< const SphincsHypertreeSignature > | ht_sig, | ||
const SphincsTreeNode & | pk_root, | ||
XmssTreeIndexInLayer | tree_index_in_layer, | ||
TreeNodeIndex | idx_leaf, | ||
const Sphincs_Parameters & | params, | ||
Sphincs_Hash_Functions & | hashes ) |
Given a message signed_msg
the SPHINCS+ XMSS hypertree is reconstructed using a hypertree signature ht_sig
. tree_index_in_layer
and idx_leaf
define which XMSS tree of the hypertree and which leaf of this XMSS tree was used for signing.
pk_root
Definition at line 61 of file sp_hypertree.cpp.
References BOTAN_ASSERT_NOMSG, compute_root(), Botan::Sphincs_Address::copy_keypair_from(), Botan::Sphincs_Address::copy_subtree_from(), Botan::Sphincs_Parameters::d(), Botan::BufferSlicer::empty(), Botan::detail::Strong_Base< T >::get(), HashTree, Botan::Sphincs_Parameters::ht_signature_bytes(), Botan::Sphincs_Parameters::n(), Botan::Sphincs_Address::set_keypair(), Botan::Sphincs_Address::set_layer(), Botan::Sphincs_Address::set_tree(), Botan::StrongSpan< T >::size(), Botan::Sphincs_Hash_Functions::T(), Botan::BufferSlicer::take(), Botan::Sphincs_Parameters::wots_bytes(), wots_public_key_from_signature(), WotsHash, WotsPublicKeyCompression, and Botan::Sphincs_Parameters::xmss_tree_height().
uint8_t Botan::ieee1363_hash_id | ( | std::string_view | hash_name | ) |
Return the IEEE 1363 hash identifier
hash_name | the name of the hash function |
Definition at line 144 of file hash_id.cpp.
References name.
Referenced by Botan::EMSA_X931::EMSA_X931().
size_t BOTAN_TEST_API Botan::if_work_factor | ( | size_t | n_bits | ) |
Estimate work factor for integer factorization
n_bits | size of modulus in bits |
Definition at line 36 of file workfactor.cpp.
Referenced by dl_work_factor(), Botan::TPM_PrivateKey::estimated_strength(), and Botan::RSA_PublicKey::estimated_strength().
Mark variable as unused.
Takes any number of arguments and marks all as unused, for instance BOTAN_UNUSED(a); or BOTAN_UNUSED(x, y, z);
Definition at line 111 of file assert.h.
Referenced by ignore_params().
void Botan::ignore_params | ( | T &&... | args | ) |
Definition at line 114 of file assert.h.
References ignore_param().
void BOTAN_UNSTABLE_API Botan::initialize_allocator | ( | ) |
Ensure the allocator is initialized
Definition at line 64 of file allocator.cpp.
References Botan::mlock_allocator::instance().
Referenced by Botan::Allocator_Initializer::Allocator_Initializer().
|
inline |
Definition at line 70 of file asn1_obj.h.
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 178 of file mod_inv.cpp.
References Botan::BigInt::bits(), BOTAN_ASSERT_NOMSG, BOTAN_DEBUG_ASSERT, Botan::BigInt::ct_cond_add(), Botan::BigInt::ct_cond_assign(), ct_modulo(), Botan::BigInt::get_bit(), 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(), Botan::BigInt::set_sign(), and Botan::BigInt::zero().
Referenced by botan_mp_mod_inverse(), Botan::RSA_PrivateKey::check_key(), Botan::Montgomery_Params::inv_mod_p(), 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 181 of file parsing.cpp.
References store_be().
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 101 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 89 of file primality.cpp.
References Botan::BigInt::from_word(), Botan::BigInt::is_even(), is_lucas_probable_prime(), and passes_miller_rabin_test().
Referenced by is_bailie_psw_probable_prime(), and is_prime().
|
constexprnoexcept |
Definition at line 283 of file stl_util.h.
|
constexprnoexcept |
Definition at line 288 of file stl_util.h.
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 18 of file primality.cpp.
References Botan::BigInt::ct_cond_add(), Botan::BigInt::ct_cond_assign(), Botan::BigInt::flip_sign(), Botan::BigInt::from_word(), Botan::BigInt::is_even(), Botan::BigInt::is_negative(), Botan::BigInt::is_odd(), is_perfect_square(), jacobi(), Botan::Modular_Reducer::multiply(), Botan::BigInt::one(), 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 150 of file primality.cpp.
References Botan::BigInt::from_word(), Botan::BigInt::is_even(), 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 128 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 323 of file numthry.cpp.
References Botan::BigInt::bits(), Botan::BigInt::one(), Botan::BigInt::power_of_2(), X, and Botan::BigInt::zero().
Referenced by is_lucas_probable_prime().
|
inlineconstexpr |
Power of 2 test. T should be an unsigned integer type
arg | an integer value |
Definition at line 45 of file bit_ops.h.
References T.
Referenced by 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 357 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(), Botan::DL_Group::DL_Group(), generate_dsa_primes(), random_safe_prime(), Botan::EC_Group::verify_group(), and Botan::DL_Group::verify_group().
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 116 of file numthry.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 sqrt_modulo_prime().
size_t Botan::keccak_absorb_padded_strings_encoding | ( | T & | sink, |
size_t | padding_mod, | ||
Ts... | byte_strings ) |
This is a combination of the functions encode_string() and bytepad() defined in NIST SP.800-185 Section 2.3. Additionally, the result is directly streamed into the provided XOF to avoid unneccessary memory allocation or a byte vector.
sink | the XOF or byte vector to absorb the byte_strings into |
padding_mod | the modulus value to create a padding for (NIST calls this 'w') |
byte_strings | a variable-length list of byte strings to be encoded and absorbed into the given xof |
xof
Definition at line 91 of file keccak_helpers.h.
References BOTAN_ASSERT_NOMSG, keccak_int_left_encode(), and keccak_max_int_encoding_size().
BOTAN_TEST_API size_t Botan::keccak_int_encoding_size | ( | size_t | x | ) |
x
Definition at line 54 of file keccak_helpers.cpp.
BOTAN_TEST_API std::span< const uint8_t > Botan::keccak_int_left_encode | ( | std::span< uint8_t > | buffer, |
size_t | x ) |
Integer encoding defined in NIST SP.800-185 that can be unambiguously parsed from the beginning of the string.
This function does not allocate any memory and requires the caller to provide a sufficiently large buffer
. For a given x
, this will need exactly keccak_int_encoding_size() bytes. For an arbitrary x
it will generate keccak_max_int_encoding_size() bytes at most.
buffer | buffer to write the left-encoding of x to. It is assumed that the buffer will hold at least keccak_int_encoding_size() bytes. |
x | the integer to be left-encoded |
buffer
. Definition at line 41 of file keccak_helpers.cpp.
References BOTAN_ASSERT_NOMSG.
Referenced by keccak_absorb_padded_strings_encoding().
BOTAN_TEST_API std::span< const uint8_t > Botan::keccak_int_right_encode | ( | std::span< uint8_t > | out, |
size_t | x ) |
Integer encoding defined in NIST SP.800-185 that can be unambiguously parsed from the end of the string.
This function does not allocate any memory and requires the caller to provide a sufficiently large buffer
. For a given x
, this will need exactly keccak_int_encoding_size() bytes. For an arbitrary x
it will generate keccak_max_int_encoding_size() bytes at most.
out | buffer to write the right-encoding of x to. It is assumed that the buffer will hold at least keccak_int_encoding_size() bytes. |
x | the integer to be right-encoded |
buffer
. Definition at line 47 of file keccak_helpers.cpp.
References BOTAN_ASSERT_NOMSG.
|
constexpr |
Definition at line 65 of file keccak_helpers.h.
Referenced by keccak_absorb_padded_strings_encoding().
|
inline |
Definition at line 15 of file keccak_perm_round.h.
References T.
|
inline |
Definition at line 30 of file pkix_types.h.
BOTAN_TEST_API std::string Botan::latin1_to_utf8 | ( | const uint8_t | chars[], |
size_t | len ) |
Definition at line 89 of file charset.cpp.
Referenced by Botan::ASN1_String::decode_from().
Least common multiple
x | a positive integer |
y | a positive integer |
Definition at line 272 of file numthry.cpp.
References ct_divide(), gcd(), Botan::BigInt::Positive, and Botan::BigInt::set_sign().
Referenced by Botan::RSA_PrivateKey::check_key(), Botan::RSA_PrivateKey::RSA_PrivateKey(), and Botan::RSA_PrivateKey::RSA_PrivateKey().
Definition at line 38 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 23 of file ed25519_internal.h.
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 |
Load a big-endian unsigned integer
in | a pointer to some bytes |
off | an offset into the array |
Definition at line 194 of file loadstor.h.
References T.
|
inlineconstexpr |
Load many big-endian unsigned integers
in | a pointer to some bytes |
outs | a arbitrary-length parameter list of unsigned integers to be loaded |
Definition at line 284 of file loadstor.h.
References load_be().
|
inlineconstexpr |
Load many big-endian unsigned integers
in | a fixed-length span to some bytes |
outs | a arbitrary-length parameter list of unsigned integers to be loaded |
Definition at line 250 of file loadstor.h.
References Botan::ranges::assert_exact_byte_length(), and T.
|
inlineconstexpr |
Load a big-endian unsigned integer
in_range | a fixed-length span with some bytes |
Definition at line 92 of file loadstor.h.
References reverse_bytes(), and T.
Referenced by Botan::SHA_1::compress_n(), Botan::Whirlpool::compress_n(), Botan::Blowfish::decrypt_n(), Botan::CAST_128::decrypt_n(), Botan::Blowfish::encrypt_n(), Botan::CAST_128::encrypt_n(), load_be(), and Botan::SIMD_4x32::load_be().
|
inlineconstexpr |
Load a big-endian unsigned integer, auto-detect the output type
in_range | a statically-sized range with some bytes |
Definition at line 183 of file loadstor.h.
|
inlineconstexpr |
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 334 of file loadstor.h.
References reverse_bytes(), and typecast_copy().
Load a little-endian word
in | a pointer to some bytes |
off | an offset into the array |
Load a little-endian unsigned integer
in | a pointer to some bytes |
off | an offset into the array |
Definition at line 210 of file loadstor.h.
References T.
|
inlineconstexpr |
Load many little-endian unsigned integers
in | a pointer to some bytes |
outs | a arbitrary-length parameter list of unsigned integers to be loaded |
Definition at line 297 of file loadstor.h.
References load_le().
|
inlineconstexpr |
Load many little-endian unsigned integers
in | a fixed-length span to some bytes |
outs | a arbitrary-length parameter list of unsigned integers to be loaded |
Definition at line 267 of file loadstor.h.
References Botan::ranges::assert_exact_byte_length(), and T.
|
inlineconstexpr |
Load a little-endian unsigned integer
in_range | a fixed-length span with some bytes |
Definition at line 117 of file loadstor.h.
References reverse_bytes(), and T.
Referenced by Botan::SIMD_8x32::BOTAN_FUNC_ISA(), Botan::SIMD_16x32::BOTAN_FUNC_ISA(), Botan::MD5::compress_n(), Botan::RIPEMD_160::compress_n(), 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(), load_le(), and Botan::SIMD_4x32::load_le().
|
inlineconstexpr |
Load a little-endian unsigned integer, auto-detect the output type
in_range | a statically-sized range with some bytes |
Definition at line 173 of file loadstor.h.
|
inlineconstexpr |
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 310 of file loadstor.h.
References reverse_bytes(), and typecast_copy().
std::unique_ptr< Private_Key > Botan::load_private_key | ( | const AlgorithmIdentifier & | alg_id, |
std::span< const uint8_t > | key_bits ) |
Definition at line 212 of file pk_algs.cpp.
References fmt(), Botan::AlgorithmIdentifier::oid(), split_on(), and Botan::OID::to_formatted_string().
std::unique_ptr< Public_Key > Botan::load_public_key | ( | const AlgorithmIdentifier & | alg_id, |
std::span< const uint8_t > | key_bits ) |
Definition at line 95 of file pk_algs.cpp.
References fmt(), Botan::AlgorithmIdentifier::oid(), split_on(), and Botan::OID::to_formatted_string().
Referenced by Botan::TLS::Hybrid_KEM_PublicKey::load_for_group(), and Botan::X509::load_key().
secure_vector< T > Botan::lock | ( | const std::vector< T > & | in | ) |
Definition at line 70 of file secmem.h.
Referenced by Botan::Semaphore::acquire(), Botan::OID_Map::add_oid(), Botan::OID_Map::add_oid2str(), Botan::OID_Map::add_str2oid(), Botan::Memory_Pool::allocate(), Botan::Stateful_RNG::clear(), Botan::Memory_Pool::deallocate(), Botan::Stateful_RNG::force_reseed(), Botan::Stateful_RNG::initialize_with(), Botan::Stateful_RNG::is_seeded(), Botan::OID_Map::oid2str(), Botan::Thread_Pool::queue_thunk(), Botan::Semaphore::release(), Botan::Stateful_RNG::reseed(), Botan::Stateful_RNG::reseed_from_rng(), Botan::Thread_Pool::shutdown(), Botan::OID_Map::str2oid(), Botan::Barrier::sync(), and Botan::Barrier::wait().
size_t Botan::low_zero_bits | ( | const BigInt & | x | ) |
x | an integer |
Definition at line 167 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 inverse_mod(), jacobi(), passes_miller_rabin_test(), Botan::RSA_PrivateKey::RSA_PrivateKey(), and sqrt_modulo_prime().
Definition at line 186 of file bit_ops.h.
References choose().
Referenced by SHA2_32_F(), and SHA2_64_F().
std::unique_ptr< BlockCipher > Botan::make_commoncrypto_block_cipher | ( | std::string_view | name | ) |
Definition at line 133 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().
std::unique_ptr< Cipher_Mode > Botan::make_commoncrypto_cipher_mode | ( | std::string_view | name, |
Cipher_Dir | direction ) |
Definition at line 212 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 | ( | std::string_view | name | ) |
Definition at line 80 of file commoncrypto_hash.cpp.
References MAKE_COMMONCRYPTO_HASH_2, MAKE_COMMONCRYPTO_HASH_3, and name.
Referenced by Botan::HashFunction::create().
|
inline |
Definition at line 130 of file compression.h.
References Botan::Compression_Algorithm::create().
|
inline |
Definition at line 136 of file compression.h.
References Botan::Decompression_Algorithm::create().
|
inlineconstexpr |
Make a uint16_t from two bytes
i0 | the first byte |
i1 | the second byte |
Definition at line 50 of file loadstor.h.
Referenced by Botan::TLS::Certificate_Request_12::Certificate_Request_12(), Botan::TLS::TLS_Data_Reader::get_uint16_t(), Botan::TLS::TLS_Data_Reader::peek_uint16_t(), random_gf2m(), Botan::RTSS_Share::reconstruct(), and Botan::TLS::TLS_CBC_HMAC_AEAD_Encryption::set_associated_data_n().
|
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 62 of file loadstor.h.
Referenced by Botan::TLS::Certificate_12::Certificate_12(), Botan::TLS::Certificate_Status::Certificate_Status(), Botan::TLS::Stream_Handshake_IO::get_next_record(), Botan::TLS::TLS_Data_Reader::get_uint24_t(), Botan::TLS::TLS_Data_Reader::get_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 79 of file loadstor.h.
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 60 of file stl_util.h.
std::set< K > Botan::map_keys_as_set | ( | const std::multimap< K, V > & | kv | ) |
Return the keys of a multimap as a std::set
Definition at line 72 of file stl_util.h.
Definition at line 127 of file stl_util.h.
Referenced by Botan::TLS::Channel_Impl_12::activate_session().
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 148 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 124 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 117 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 109 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 89 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. The buffer is XORed with the output of MGF1. |
out_len | size of the output buffer in bytes |
Definition at line 15 of file mgf1.cpp.
References Botan::Buffered_Computation::final(), Botan::Buffered_Computation::output_length(), Botan::Buffered_Computation::update(), Botan::Buffered_Computation::update_be(), and xor_buf().
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 172 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 150 of file monty_exp.cpp.
References monty_execute().
Referenced by monty_execute(), monty_exp(), and passes_miller_rabin_test().
BigInt Botan::monty_execute_vartime | ( | const Montgomery_Exponentation_State & | precomputed_state, |
const BigInt & | k ) |
Definition at line 154 of file monty_exp.cpp.
References monty_execute_vartime().
Referenced by monty_execute_vartime(), and monty_exp_vartime().
|
inline |
Definition at line 41 of file monty_exp.h.
References monty_execute(), and monty_precompute().
Referenced by power_mod().
|
inline |
Definition at line 49 of file monty_exp.h.
References monty_execute_vartime(), and monty_precompute().
Referenced by sqrt_modulo_prime().
word Botan::monty_inverse | ( | word | a | ) |
Definition at line 16 of file monty.cpp.
References BOTAN_MP_WORD_BITS, and MP_WORD_MAX.
Referenced by Botan::Montgomery_Params::Montgomery_Params(), and Botan::Montgomery_Params::Montgomery_Params().
BigInt Botan::monty_multi_exp | ( | const 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 158 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 | ( | const std::shared_ptr< const Montgomery_Params > & | params, |
const BigInt & | g, | ||
size_t | window_bits, | ||
bool | const_time ) |
Definition at line 145 of file monty_exp.cpp.
References monty_precompute().
Referenced by monty_exp(), monty_exp_vartime(), monty_precompute(), and passes_miller_rabin_test().
|
inline |
Perform a 64x64->128 bit multiplication
Definition at line 29 of file mul128.h.
Referenced by operator*(), word_madd2(), and word_madd3().
EC_Point Botan::multi_exponentiate | ( | const EC_Point & | p1, |
const BigInt & | z1, | ||
const EC_Point & | 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 24 of file point_mul.cpp.
References Botan::EC_Point_Multi_Point_Precompute::multi_exp().
void Botan::multimap_insert | ( | std::multimap< K, V > & | multimap, |
const K & | key, | ||
const V & | value ) |
Definition at line 109 of file stl_util.h.
Referenced by Botan::AlternativeName::add_othername(), Botan::X509_DN::contents(), Botan::AlternativeName::contents(), and Botan::X509_DN::get_attributes().
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 116 of file nist_keywrap.cpp.
References Botan::BlockCipher::block_size(), copy_mem(), and Botan::BlockCipher::decrypt().
Referenced by botan_nist_kw_dec(), and 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 169 of file nist_keywrap.cpp.
References Botan::BlockCipher::block_size(), copy_mem(), and Botan::BlockCipher::decrypt().
Referenced by botan_nist_kw_dec(), 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 90 of file nist_keywrap.cpp.
References Botan::BlockCipher::block_size(), copy_mem(), Botan::BlockCipher::encrypt(), and store_be().
Referenced by botan_nist_kw_enc(), and 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 148 of file nist_keywrap.cpp.
References Botan::BlockCipher::block_size(), copy_mem(), Botan::BlockCipher::encrypt(), and store_be().
Referenced by botan_nist_kw_enc(), Botan::Encrypted_PSK_Database::get(), Botan::Encrypted_PSK_Database::remove(), and Botan::Encrypted_PSK_Database::set().
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 88 of file oaep.cpp.
References Botan::CT::Mask< T >::cleared(), Botan::CT::copy_output(), Botan::CT::Mask< T >::is_equal(), Botan::CT::is_not_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 69 of file alg_id.cpp.
Definition at line 264 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 203 of file curve_gfp.h.
Definition at line 402 of file ec_group.h.
Definition at line 352 of file ec_point.h.
bool Botan::operator!= | ( | const OctetString & | x, |
const OctetString & | y ) |
Compare two strings
x | an octet string |
y | an octet string |
Definition at line 92 of file symkey.cpp.
Compare two OIDs.
Definition at line 326 of file asn1_obj.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 633 of file x509cert.cpp.
Definition at line 256 of file x509_dn.cpp.
Definition at line 122 of file big_ops3.cpp.
References Botan::BigInt::from_word(), 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 145 of file big_ops3.cpp.
References bigint_modop_vartime(), is_power_of_2(), Botan::BigInt::Negative, Botan::BigInt::sig_words(), Botan::BigInt::sign(), and Botan::BigInt::word_at().
|
inline |
|
constexpr |
Definition at line 306 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get(), and T.
|
constexpr |
Definition at line 301 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 295 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 434 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 428 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
Point multiplication operator
scalar | the scalar value |
point | the point value |
Definition at line 363 of file ec_point.cpp.
References Botan::EC_Point::add(), Botan::BigInt::bits(), BOTAN_DEBUG_ASSERT, Botan::BigInt::get_bit(), Botan::BigInt::is_negative(), Botan::EC_Point::mult2(), Botan::EC_Point::negate(), Botan::EC_Point::on_the_curve(), Botan::EC_Point::WORKSPACE_SIZE, and Botan::EC_Point::zero().
Definition at line 46 of file big_ops3.cpp.
References bigint_linmul3(), bigint_mul(), Botan::BigInt::cond_flip_sign(), Botan::BigInt::data(), Botan::BigInt::mutable_data(), Botan::BigInt::sig_words(), Botan::BigInt::sign(), Botan::BigInt::size(), Botan::BigInt::with_capacity(), and Botan::BigInt::word_at().
Definition at line 79 of file big_ops3.cpp.
References bigint_linmul3(), Botan::BigInt::data(), Botan::BigInt::mutable_data(), Botan::BigInt::set_sign(), Botan::BigInt::sig_words(), Botan::BigInt::sign(), and Botan::BigInt::with_capacity().
Definition at line 77 of file donna128.h.
References BOTAN_ARG_CHECK, Botan::donna128::hi(), Botan::donna128::lo(), and mul64x64_128().
Definition at line 371 of file ec_point.h.
|
constexpr |
Definition at line 255 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get(), and T.
|
constexpr |
Definition at line 250 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 244 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
Definition at line 85 of file donna128.h.
|
constexpr |
Definition at line 395 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 389 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
Definition at line 954 of file bigint.h.
References Botan::BigInt::add2(), Botan::BigInt::data(), Botan::BigInt::sig_words(), and Botan::BigInt::sign().
Definition at line 958 of file bigint.h.
References Botan::BigInt::add2(), and Botan::BigInt::Positive.
Definition at line 89 of file donna128.h.
Definition at line 95 of file donna128.h.
Definition at line 361 of file ec_point.h.
OctetString Botan::operator+ | ( | const OctetString & | x, |
const OctetString & | y ) |
Concatenate two strings
x | an octet string |
y | an octet string |
Definition at line 99 of file symkey.cpp.
References Botan::OctetString::bits_of(), and OctetString.
|
constexpr |
Definition at line 221 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get(), and T.
|
constexpr |
Definition at line 216 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 210 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 486 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 479 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
Referenced by generate_dsa_primes().
|
constexpr |
Definition at line 369 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 363 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
Definition at line 966 of file bigint.h.
References Botan::BigInt::add2(), Botan::BigInt::data(), Botan::BigInt::reverse_sign(), and Botan::BigInt::sig_words().
Definition at line 970 of file bigint.h.
References Botan::BigInt::add2(), and Botan::BigInt::Negative.
Definition at line 357 of file ec_point.h.
References Botan::EC_Point::negate().
Definition at line 366 of file ec_point.h.
|
constexpr |
Definition at line 238 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get(), and T.
|
constexpr |
Definition at line 233 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 227 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 499 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 492 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 382 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 376 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
Definition at line 95 of file big_ops3.cpp.
References Botan::BigInt::sig_words(), vartime_divide(), and Botan::BigInt::word_at().
Definition at line 108 of file big_ops3.cpp.
References ct_divide_word().
|
constexpr |
Definition at line 272 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get(), and T.
|
constexpr |
Definition at line 267 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 261 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 408 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 402 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
Definition at line 276 of file asn1_time.cpp.
References Botan::ASN1_Time::cmp().
|
inline |
Definition at line 1031 of file bigint.h.
References Botan::BigInt::cmp_word().
Compare two OIDs.
Definition at line 133 of file asn1_oid.cpp.
References Botan::OID::get_components().
Definition at line 263 of file x509_dn.cpp.
References BOTAN_ASSERT_NOMSG, BOTAN_DEBUG_ASSERT, and Botan::X509_DN::get_attributes().
Definition at line 174 of file big_ops3.cpp.
References bigint_shl2(), BOTAN_MP_WORD_BITS, Botan::BigInt::data(), Botan::BigInt::mutable_data(), Botan::BigInt::set_sign(), Botan::BigInt::sig_words(), Botan::BigInt::sign(), and Botan::BigInt::with_capacity().
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 18 of file fd_unix.cpp.
References BOTAN_DEFAULT_BUFFER_SIZE, Botan::Pipe::read(), and Botan::Pipe::remaining().
std::ostream & Botan::operator<< | ( | std::ostream & | os, |
const GeneralName & | gn ) |
Definition at line 180 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 217 of file name_constraint.cpp.
References Botan::GeneralSubtree::base(), Botan::GeneralSubtree::maximum(), and Botan::GeneralSubtree::minimum().
Definition at line 171 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
std::ostream & Botan::operator<< | ( | std::ostream & | out, |
const OID & | oid ) |
Definition at line 140 of file asn1_oid.cpp.
References Botan::OID::get_components().
std::ostream & Botan::operator<< | ( | std::ostream & | out, |
const X509_DN & | dn ) |
Definition at line 408 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 19 of file pipe_io.cpp.
References BOTAN_DEFAULT_BUFFER_SIZE, 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().
|
constexpr |
Definition at line 357 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get(), and T.
|
constexpr |
Definition at line 352 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 346 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 473 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 467 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
Definition at line 268 of file asn1_time.cpp.
References Botan::ASN1_Time::cmp().
Definition at line 999 of file bigint.h.
References Botan::BigInt::cmp().
|
inline |
Definition at line 1023 of file bigint.h.
References Botan::BigInt::cmp_word().
Definition at line 184 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
auto Botan::operator<=> | ( | Strong< T1, Tags... > | a, |
T2 | b ) |
Definition at line 194 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
auto Botan::operator<=> | ( | T1 | a, |
Strong< T2, Tags... > | b ) |
Definition at line 189 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
bool Botan::operator== | ( | const AlgorithmIdentifier & | a1, |
const AlgorithmIdentifier & | a2 ) |
Definition at line 54 of file alg_id.cpp.
References Botan::AlgorithmIdentifier::oid(), Botan::AlgorithmIdentifier::parameters(), and Botan::AlgorithmIdentifier::parameters_are_null_or_empty().
Definition at line 260 of file asn1_time.cpp.
References Botan::ASN1_Time::cmp().
Definition at line 991 of file bigint.h.
References Botan::BigInt::is_equal().
|
inline |
Definition at line 1015 of file bigint.h.
References Botan::BigInt::cmp_word().
Test two CRL entries for equality in all fields.
Definition at line 42 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 85 of file symkey.cpp.
References Botan::OctetString::bits_of().
|
inline |
Definition at line 178 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
Definition at line 220 of file x509_dn.cpp.
References Botan::X509_DN::get_attributes().
auto Botan::operator== | ( | Strong< T1, Tags... > | a, |
T2 | b ) |
Definition at line 204 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
auto Botan::operator== | ( | T1 | a, |
Strong< T2, Tags... > | b ) |
Definition at line 199 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
Definition at line 280 of file asn1_time.cpp.
References Botan::ASN1_Time::cmp().
Definition at line 1011 of file bigint.h.
References Botan::BigInt::is_less_than().
|
inline |
Definition at line 1035 of file bigint.h.
References Botan::BigInt::cmp_word().
Definition at line 272 of file asn1_time.cpp.
References Botan::ASN1_Time::cmp().
Definition at line 1003 of file bigint.h.
References Botan::BigInt::cmp().
|
inline |
Definition at line 1027 of file bigint.h.
References Botan::BigInt::cmp_word().
Definition at line 188 of file big_ops3.cpp.
References bigint_shr2(), BOTAN_MP_WORD_BITS, 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(), Botan::BigInt::sign(), Botan::BigInt::with_capacity(), and Botan::BigInt::zero().
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 39 of file fd_unix.cpp.
References BOTAN_DEFAULT_BUFFER_SIZE, and 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 34 of file pipe_io.cpp.
References BOTAN_DEFAULT_BUFFER_SIZE, cast_uint8_ptr_to_char(), and Botan::Pipe::write().
std::istream & Botan::operator>> | ( | std::istream & | in, |
X509_DN & | dn ) |
Definition at line 428 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 44 of file big_io.cpp.
|
constexpr |
Definition at line 340 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get(), and T.
|
constexpr |
Definition at line 335 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 329 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 460 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 454 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
OctetString Botan::operator^ | ( | const OctetString & | x, |
const OctetString & | y ) |
XOR two strings
x | an octet string |
y | an octet string |
Definition at line 109 of file symkey.cpp.
References Botan::OctetString::begin(), copy_mem(), Botan::OctetString::length(), OctetString, and xor_buf().
|
constexpr |
Definition at line 289 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get(), and T.
|
constexpr |
Definition at line 284 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 278 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
std::vector< uint8_t, Alloc > & Botan::operator^= | ( | std::vector< uint8_t, Alloc > & | out, |
const std::vector< uint8_t, Alloc2 > & | in ) |
|
constexpr |
Definition at line 421 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 415 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
inline |
Definition at line 78 of file asn1_obj.h.
|
inline |
Definition at line 86 of file asn1_obj.h.
|
inline |
Definition at line 82 of file asn1_obj.h.
Definition at line 74 of file asn1_obj.h.
Definition at line 101 of file donna128.h.
References Botan::donna128::hi(), and Botan::donna128::lo().
|
inline |
|
constexpr |
Definition at line 323 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get(), and T.
|
constexpr |
Definition at line 318 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 312 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 447 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 441 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
EC_Point Botan::OS2ECP | ( | const std::vector< uint8_t, Alloc > & | data, |
const CurveGFp & | curve ) |
Definition at line 395 of file ec_point.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 644 of file ec_point.cpp.
References Botan::BigInt::decode().
Perform point decoding Use EC_Group::OS2ECP instead
Definition at line 627 of file ec_point.cpp.
References Botan::CurveGFp::get_a(), Botan::CurveGFp::get_b(), Botan::CurveGFp::get_p(), Botan::EC_Point::on_the_curve(), and OS2ECP().
Referenced by OS2ECP(), Botan::EC_Group::OS2ECP(), OS2ECP(), and Botan::EC_Group::OS2ECP().
Botan::overloaded | ( | Ts... | ) | -> overloaded< Ts... > |
std::vector< std::string > Botan::parse_algorithm_name | ( | std::string_view | scan_name | ) |
Parse a SCAN-style algorithm name
scan_name | the name |
Definition at line 57 of file parsing.cpp.
References name.
Referenced by Botan::AEAD_Mode::create(), Botan::Cipher_Mode::create(), and Botan::EME::create().
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 106 of file primality.cpp.
References Botan::BigInt::bits(), BOTAN_ASSERT_NOMSG, Botan::BigInt::is_even(), 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 | ( | std::span< const uint8_t > | key_bits, |
std::string_view | 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 270 of file pbes2.cpp.
References Botan::Cipher_Mode::create(), Botan::BER_Decoder::decode(), Decryption, Botan::BER_Decoder::end_cons(), fmt(), Botan::OID::human_name_or_empty(), OctetString, Botan::AlgorithmIdentifier::oid(), Botan::AlgorithmIdentifier::parameters(), split_on(), Botan::BER_Decoder::start_sequence(), and Botan::BER_Decoder::verify_end().
std::pair< AlgorithmIdentifier, std::vector< uint8_t > > Botan::pbes2_encrypt | ( | std::span< const uint8_t > | key_bits, |
std::string_view | passphrase, | ||
std::chrono::milliseconds | msec, | ||
std::string_view | cipher, | ||
std::string_view | 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 232 of file pbes2.cpp.
std::pair< AlgorithmIdentifier, std::vector< uint8_t > > Botan::pbes2_encrypt_iter | ( | std::span< const uint8_t > | key_bits, |
std::string_view | passphrase, | ||
size_t | iterations, | ||
std::string_view | cipher, | ||
std::string_view | 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 261 of file pbes2.cpp.
Referenced by Botan::PKCS8::BER_encode_encrypted_pbkdf_iter().
std::pair< AlgorithmIdentifier, std::vector< uint8_t > > Botan::pbes2_encrypt_msec | ( | std::span< const uint8_t > | key_bits, |
std::string_view | passphrase, | ||
std::chrono::milliseconds | msec, | ||
size_t * | out_iterations_if_nonnull, | ||
std::string_view | cipher, | ||
std::string_view | 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 243 of file pbes2.cpp.
Referenced by Botan::PKCS8::BER_encode(), and Botan::PKCS8::BER_encode_encrypted_pbkdf_msec().
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 97 of file pbkdf2.cpp.
References BOTAN_ASSERT_NOMSG, clear_mem(), Botan::Buffered_Computation::final(), Botan::Buffered_Computation::output_length(), Botan::Buffered_Computation::update(), Botan::Buffered_Computation::update_be(), and xor_buf().
size_t Botan::pbkdf2 | ( | MessageAuthenticationCode & | prf, |
uint8_t | out[], | ||
size_t | out_len, | ||
std::string_view | password, | ||
const uint8_t | salt[], | ||
size_t | salt_len, | ||
size_t | iterations, | ||
std::chrono::milliseconds | msec ) |
Definition at line 78 of file pbkdf2.cpp.
References pbkdf2().
Referenced by Botan::PBKDF2::derive_key(), Botan::Scrypt::derive_key(), Botan::PKCS5_PBKDF2::pbkdf(), and pbkdf2().
std::vector< uint8_t > BOTAN_TEST_API Botan::pkcs_hash_id | ( | std::string_view | 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 78 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 26 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 74 of file poly_dbl.cpp.
Referenced by 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 93 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 286 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_exp(), Botan::Modular_Reducer::multiply(), Botan::BigInt::one(), Botan::Modular_Reducer::reduce(), Botan::Modular_Reducer::square(), and Botan::BigInt::zero().
Referenced by botan_mp_powmod().
|
noexcept |
Prefetch an array
This function returns a uint64_t which is accumulated from values read from the array. This may help confuse the compiler sufficiently to not elide otherwise "useless" reads. The return value will always be zero.
Definition at line 14 of file prefetch.cpp.
References ct_is_zero().
Referenced by prefetch_arrays().
Prefetch several arrays
This function returns a uint64_t which is accumulated from values read from the array. This may help confuse the compiler sufficiently to not elide otherwise "useless" reads. The return value will always be zero.
Definition at line 34 of file prefetch.h.
References prefetch_array_raw(), and T.
Referenced by Botan::SEED::decrypt_n(), and Botan::SEED::encrypt_n().
const BigInt & Botan::prime_p192 | ( | ) |
const BigInt & Botan::prime_p224 | ( | ) |
const BigInt & Botan::prime_p256 | ( | ) |
const BigInt & Botan::prime_p384 | ( | ) |
Return the P-384 prime
Definition at line 447 of file nistp_redc.cpp.
const BigInt & Botan::prime_p521 | ( | ) |
Return the P-521 prime
Definition at line 15 of file nistp_redc.cpp.
std::vector< std::string > Botan::probe_provider_private_key | ( | std::string_view | alg_name, |
const std::vector< std::string > & | possible ) |
Definition at line 547 of file pk_algs.cpp.
References BOTAN_UNUSED.
std::vector< std::string > Botan::probe_providers_of | ( | std::string_view | algo_spec, |
const std::vector< std::string > & | possible = {"base"} ) |
Definition at line 105 of file scan_name.h.
gf2m Botan::random_code_element | ( | uint16_t | code_length, |
RandomNumberGenerator & | rng ) |
Definition at line 80 of file polyn_gf2m.cpp.
References random_gf2m().
Referenced by Botan::polyn_gf2m::polyn_gf2m().
gf2m Botan::random_gf2m | ( | RandomNumberGenerator & | rng | ) |
Definition at line 74 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 = BigInt::from_u64(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 97 of file make_prm.cpp.
References Botan::BigInt::bits(), BOTAN_DEBUG_ASSERT, Botan::BigInt::from_word(), gcd(), high_bit(), Botan::BigInt::is_even(), is_lucas_probable_prime(), is_miller_rabin_probable_prime(), Botan::BigInt::is_negative(), Botan::BigInt::is_zero(), 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 294 of file make_prm.cpp.
References is_prime(), random_prime(), and Botan::BigInt::zero().
Referenced by Botan::DL_Group::DL_Group().
std::map< std::string, std::string > Botan::read_cfg | ( | std::istream & | is | ) |
Definition at line 34 of file read_cfg.cpp.
Referenced by Botan::TLS::Text_Policy::Text_Policy().
std::map< std::string, std::string > Botan::read_kv | ( | std::string_view | 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 13 of file read_kv.cpp.
References split_on().
|
inline |
Definition at line 58 of file ed25519_internal.h.
References X.
Referenced by sc_muladd(), and sc_reduce().
void Botan::redc_p192 | ( | BigInt & | x, |
secure_vector< word > & | ws ) |
Reduce an input modulo P-192
Input value x must be between 0 and p**2
Definition at line 127 of file nistp_redc.cpp.
References bigint_cnd_add(), bigint_sub2(), BOTAN_ASSERT, BOTAN_ASSERT_NOMSG, BOTAN_DEBUG_ASSERT, BOTAN_MP_WORD_BITS, BOTAN_UNUSED, Botan::BigInt::grow_to(), Botan::BigInt::is_positive(), 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 ) |
Reduce an input modulo P-224
Input value x must be between 0 and p**2
Definition at line 222 of file nistp_redc.cpp.
References bigint_cnd_add(), bigint_sub2(), BOTAN_ASSERT, BOTAN_ASSERT_NOMSG, BOTAN_DEBUG_ASSERT, BOTAN_MP_WORD_BITS, BOTAN_UNUSED, Botan::BigInt::grow_to(), Botan::BigInt::is_positive(), 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 ) |
Reduce an input modulo P-256
Input value x must be between 0 and p**2
Definition at line 324 of file nistp_redc.cpp.
References bigint_cnd_add(), bigint_sub2(), BOTAN_ASSERT, BOTAN_ASSERT_NOMSG, BOTAN_DEBUG_ASSERT, BOTAN_MP_WORD_BITS, BOTAN_UNUSED, Botan::BigInt::grow_to(), Botan::BigInt::is_positive(), 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 ) |
Reduce an input modulo P-384
Input value x must be between 0 and p**2
Definition at line 453 of file nistp_redc.cpp.
References bigint_cnd_add(), bigint_sub2(), BOTAN_ASSERT, BOTAN_ASSERT_NOMSG, BOTAN_DEBUG_ASSERT, BOTAN_MP_WORD_BITS, BOTAN_UNUSED, Botan::BigInt::grow_to(), Botan::BigInt::is_positive(), 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 ) |
Reduce an input modulo P-521
Input value x must be between 0 and p**2
Definition at line 23 of file nistp_redc.cpp.
References bigint_add3_nc(), bigint_cnd_sub(), bigint_shr2(), BOTAN_ASSERT_EQUAL, BOTAN_DEBUG_ASSERT, BOTAN_MP_WORD_BITS, carry(), clear_mem(), Botan::BigInt::data(), Botan::CT::Mask< T >::expand(), Botan::BigInt::grow_to(), Botan::CT::Mask< T >::is_equal(), Botan::BigInt::is_positive(), Botan::BigInt::mask_bits(), MP_WORD_MAX, Botan::BigInt::mutable_data(), Botan::BigInt::size(), and Botan::BigInt::word_at().
RetT Botan::reduce | ( | const std::vector< KeyT > & | keys, |
RetT | acc, | ||
ReducerT | reducer ) |
Reduce the values of keys
into an accumulator initialized with acc
using the reducer function reducer
.
The reducer
is a function taking the accumulator and a single key to return the new accumulator. Keys are consecutively reduced into the accumulator.
keys
Definition at line 47 of file stl_util.h.
Referenced by Botan::TLS::Hybrid_KEM_PublicKey::check_key(), Botan::TLS::Hybrid_KEM_PrivateKey::check_key(), Botan::TLS::Hybrid_KEM_PublicKey::load_for_group(), Botan::Modular_Reducer::multiply(), Botan::TLS::Hybrid_KEM_PublicKey::public_value(), and Botan::Modular_Reducer::square().
|
inlineconstexpr |
Swap a 16 bit integer
Definition at line 19 of file bswap.h.
Referenced by load_be(), load_be(), load_le(), load_le(), reverse_bytes(), store_be(), and store_le().
|
inlineconstexpr |
Swap a 32 bit integer
We cannot use MSVC's _byteswap_ulong because it does not consider the builtin to be constexpr.
Definition at line 33 of file bswap.h.
|
inlineconstexpr |
Swap a 64 bit integer
We cannot use MSVC's _byteswap_uint64 because it does not consider the builtin to be constexpr.
Definition at line 48 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 26 of file rfc3394.cpp.
References BOTAN_ARG_CHECK, Botan::BlockCipher::create_or_throw(), nist_key_unwrap(), and Botan::OctetString::size().
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 15 of file rfc3394.cpp.
References BOTAN_ARG_CHECK, Botan::BlockCipher::create_or_throw(), nist_key_wrap(), and Botan::OctetString::size().
size_t Botan::RFC4880_decode_count | ( | uint8_t | encoded_iter | ) |
Decode the iteration count from RFC 4880 encoding
Definition at line 61 of file rfc4880.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 47 of file rfc4880.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 32 of file rfc4880.h.
References RFC4880_decode_count(), and RFC4880_encode_count().
Referenced by Botan::RFC4880_S2K_Family::tune().
|
inlineconstexpr |
SHA-2 Sigma style function
Definition at line 51 of file rotate.h.
Referenced by Botan::Dilithium_PrivateKey::Dilithium_PrivateKey(), and Botan::Dilithium::PolynomialMatrix::generate_matrix().
|
inline |
Definition at line 310 of file simd_avx512.h.
Definition at line 266 of file simd_avx2.h.
Bit rotation left by a compile-time constant amount
input | the input word |
Definition at line 21 of file rotate.h.
References T.
Referenced by Botan::SIMD_8x32::BOTAN_FUNC_ISA(), and Botan::SIMD_16x32::BOTAN_FUNC_ISA().
|
inline |
Definition at line 315 of file simd_avx512.h.
Definition at line 271 of file simd_avx2.h.
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::EC_Point_Base_Point_Precompute::EC_Point_Base_Point_Precompute(), monty_multi_exp(), Botan::EC_Point_Base_Point_Precompute::mul(), Botan::EC_Point_Var_Point_Precompute::mul(), Botan::EC_Point_Multi_Point_Precompute::multi_exp(), Botan::CBC_Encryption::output_length(), Botan::TLS::TLS_CBC_HMAC_AEAD_Encryption::output_length(), Botan::BigInt::randomize(), and Botan::TLS::TLS_CBC_HMAC_AEAD_Encryption::set_associated_data_n().
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 94 of file version.cpp.
References fmt(), short_version_cstr(), 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 298 of file mem_ops.h.
References T.
BOTAN_FORCE_INLINE void Botan::SBoxD0 | ( | SIMD_16x32 & | a, |
SIMD_16x32 & | b, | ||
SIMD_16x32 & | c, | ||
SIMD_16x32 & | d ) |
Definition at line 139 of file serpent_avx512.cpp.
Referenced by Botan::Serpent::decrypt_n().
BOTAN_FORCE_INLINE void Botan::SBoxD1 | ( | SIMD_16x32 & | a, |
SIMD_16x32 & | b, | ||
SIMD_16x32 & | c, | ||
SIMD_16x32 & | d ) |
Definition at line 154 of file serpent_avx512.cpp.
Referenced by Botan::Serpent::decrypt_n().
BOTAN_FORCE_INLINE void Botan::SBoxD2 | ( | SIMD_16x32 & | a, |
SIMD_16x32 & | b, | ||
SIMD_16x32 & | c, | ||
SIMD_16x32 & | d ) |
Definition at line 169 of file serpent_avx512.cpp.
Referenced by Botan::Serpent::decrypt_n().
BOTAN_FORCE_INLINE void Botan::SBoxD3 | ( | SIMD_16x32 & | a, |
SIMD_16x32 & | b, | ||
SIMD_16x32 & | c, | ||
SIMD_16x32 & | d ) |
Definition at line 184 of file serpent_avx512.cpp.
Referenced by Botan::Serpent::decrypt_n().
BOTAN_FORCE_INLINE void Botan::SBoxD4 | ( | SIMD_16x32 & | a, |
SIMD_16x32 & | b, | ||
SIMD_16x32 & | c, | ||
SIMD_16x32 & | d ) |
Definition at line 200 of file serpent_avx512.cpp.
Referenced by Botan::Serpent::decrypt_n().
BOTAN_FORCE_INLINE void Botan::SBoxD5 | ( | SIMD_16x32 & | a, |
SIMD_16x32 & | b, | ||
SIMD_16x32 & | c, | ||
SIMD_16x32 & | d ) |
Definition at line 216 of file serpent_avx512.cpp.
Referenced by Botan::Serpent::decrypt_n().
BOTAN_FORCE_INLINE void Botan::SBoxD6 | ( | SIMD_16x32 & | a, |
SIMD_16x32 & | b, | ||
SIMD_16x32 & | c, | ||
SIMD_16x32 & | d ) |
Definition at line 232 of file serpent_avx512.cpp.
Referenced by Botan::Serpent::decrypt_n().
BOTAN_FORCE_INLINE void Botan::SBoxD7 | ( | SIMD_16x32 & | a, |
SIMD_16x32 & | b, | ||
SIMD_16x32 & | c, | ||
SIMD_16x32 & | d ) |
Definition at line 248 of file serpent_avx512.cpp.
Referenced by Botan::Serpent::decrypt_n().
BOTAN_FORCE_INLINE void Botan::SBoxE0 | ( | SIMD_16x32 & | a, |
SIMD_16x32 & | b, | ||
SIMD_16x32 & | c, | ||
SIMD_16x32 & | d ) |
Definition at line 13 of file serpent_avx512.cpp.
Referenced by Botan::Serpent::encrypt_n().
BOTAN_FORCE_INLINE void Botan::SBoxE1 | ( | SIMD_16x32 & | a, |
SIMD_16x32 & | b, | ||
SIMD_16x32 & | c, | ||
SIMD_16x32 & | d ) |
Definition at line 28 of file serpent_avx512.cpp.
Referenced by Botan::Serpent::encrypt_n().
BOTAN_FORCE_INLINE void Botan::SBoxE2 | ( | SIMD_16x32 & | a, |
SIMD_16x32 & | b, | ||
SIMD_16x32 & | c, | ||
SIMD_16x32 & | d ) |
Definition at line 43 of file serpent_avx512.cpp.
Referenced by Botan::Serpent::encrypt_n().
BOTAN_FORCE_INLINE void Botan::SBoxE3 | ( | SIMD_16x32 & | a, |
SIMD_16x32 & | b, | ||
SIMD_16x32 & | c, | ||
SIMD_16x32 & | d ) |
Definition at line 59 of file serpent_avx512.cpp.
Referenced by Botan::Serpent::encrypt_n().
BOTAN_FORCE_INLINE void Botan::SBoxE4 | ( | SIMD_16x32 & | a, |
SIMD_16x32 & | b, | ||
SIMD_16x32 & | c, | ||
SIMD_16x32 & | d ) |
Definition at line 75 of file serpent_avx512.cpp.
Referenced by Botan::Serpent::encrypt_n().
BOTAN_FORCE_INLINE void Botan::SBoxE5 | ( | SIMD_16x32 & | a, |
SIMD_16x32 & | b, | ||
SIMD_16x32 & | c, | ||
SIMD_16x32 & | d ) |
Definition at line 91 of file serpent_avx512.cpp.
Referenced by Botan::Serpent::encrypt_n().
BOTAN_FORCE_INLINE void Botan::SBoxE6 | ( | SIMD_16x32 & | a, |
SIMD_16x32 & | b, | ||
SIMD_16x32 & | c, | ||
SIMD_16x32 & | d ) |
Definition at line 107 of file serpent_avx512.cpp.
Referenced by Botan::Serpent::encrypt_n().
BOTAN_FORCE_INLINE void Botan::SBoxE7 | ( | SIMD_16x32 & | a, |
SIMD_16x32 & | b, | ||
SIMD_16x32 & | c, | ||
SIMD_16x32 & | d ) |
Definition at line 123 of file serpent_avx512.cpp.
Referenced by Botan::Serpent::encrypt_n().
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().
|
inline |
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 87 of file scrypt.h.
|
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 120 of file scrypt.h.
|
inline |
Definition at line 97 of file stl_util.h.
|
inline |
Definition at line 88 of file stl_util.h.
Referenced by Botan::HTTP::http_sync().
void Botan::secure_scrub_memory | ( | ranges::contiguous_output_range auto && | data | ) |
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.
data | the data region to be scrubbed |
Definition at line 57 of file mem_ops.h.
References secure_scrub_memory(), and Botan::ranges::size_bytes().
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 87 of file os_utils.cpp.
Referenced by botan_scrub_mem(), Botan::Kuznyechik::clear(), deallocate_memory(), Botan::OS::free_locked_pages(), Botan::GHASH::ghash_update(), secure_scrub_memory(), Botan::Sodium::sodium_free(), Botan::Sodium::sodium_memzero(), Botan::AlignmentBuffer< T, BLOCK_SIZE, FINAL_BLOCK_STRATEGY >::~AlignmentBuffer(), Botan::BLAKE2s::~BLAKE2s(), and Botan::FE_25519::~FE_25519().
|
inlineconstexpr |
BOTAN_FORCE_INLINE void Botan::SHA2_32_F | ( | uint32_t | A, |
uint32_t | B, | ||
uint32_t | C, | ||
uint32_t & | D, | ||
uint32_t | E, | ||
uint32_t | F, | ||
uint32_t | G, | ||
uint32_t & | H, | ||
uint32_t & | M1, | ||
uint32_t | M2, | ||
uint32_t | M3, | ||
uint32_t | M4, | ||
uint32_t | magic ) |
Definition at line 19 of file sha2_32_f.h.
References choose(), and majority().
Referenced by Botan::SHA_256::compress_digest(), and Botan::SHA_256::compress_digest_x86_bmi2().
BOTAN_FORCE_INLINE void Botan::SHA2_64_F | ( | uint64_t | A, |
uint64_t | B, | ||
uint64_t | C, | ||
uint64_t & | D, | ||
uint64_t | E, | ||
uint64_t | F, | ||
uint64_t | G, | ||
uint64_t & | H, | ||
uint64_t & | M1, | ||
uint64_t | M2, | ||
uint64_t | M3, | ||
uint64_t | M4, | ||
uint64_t | magic ) |
Definition at line 19 of file sha2_64_f.h.
References choose(), and majority().
Referenced by Botan::SHA_512::compress_digest(), and Botan::SHA_512::compress_digest_bmi2().
|
inline |
Definition at line 321 of file simd_avx512.h.
Definition at line 277 of file simd_avx2.h.
const char * Botan::short_version_cstr | ( | ) |
Same as version_short_string except returning a pointer to the string.
Definition at line 25 of file version.cpp.
References BOTAN_VERSION_MAJOR, BOTAN_VERSION_MINOR, BOTAN_VERSION_PATCH, and STR.
Referenced by runtime_version_check(), and 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 71 of file version.cpp.
References short_version_cstr().
|
inlineconstexpr |
Return the number of significant bytes in n
n | an integer value |
Definition at line 80 of file bit_ops.h.
std::vector< uint8_t > Botan::sm2_compute_za | ( | HashFunction & | hash, |
std::string_view | user_id, | ||
const EC_Group & | domain, | ||
const EC_Point & | pubkey ) |
Definition at line 58 of file sm2.cpp.
References Botan::BigInt::encode_1363(), Botan::Buffered_Computation::final(), Botan::EC_Group::get_a(), Botan::EC_Point::get_affine_x(), Botan::EC_Point::get_affine_y(), Botan::EC_Group::get_b(), Botan::EC_Group::get_g_x(), Botan::EC_Group::get_g_y(), Botan::EC_Group::get_p_bytes(), Botan::Buffered_Computation::output_length(), and Botan::Buffered_Computation::update().
Referenced by botan_pubkey_sm2_compute_za().
BOTAN_TEST_API std::vector< std::string > Botan::split_on | ( | std::string_view | str, |
char | delim ) |
Split a string
str | the input string |
delim | the delimitor |
Definition at line 111 of file parsing.cpp.
References fmt().
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(), load_private_key(), load_public_key(), pbes2_decrypt(), Botan::TLS::Text_Policy::read_cert_type_list(), Botan::TLS::Text_Policy::read_group_list(), read_kv(), string_to_ipv4(), Botan::PK_Ops::Verification_with_Hash::Verification_with_Hash(), and Botan::X509_Cert_Options::X509_Cert_Options().
Compute the square root of x modulo a prime using the Tonelli-Shanks algorithm. This algorithm is primarily used for EC point decompression which takes only public inputs, as a consequence it is not written to be constant-time and may leak side-channel information about its arguments.
x | the input |
p | the prime modulus |
Definition at line 26 of file numthry.cpp.
References BOTAN_ARG_CHECK, BOTAN_ASSERT_NOMSG, Botan::BigInt::from_s32(), Botan::BigInt::from_word(), Botan::BigInt::is_odd(), jacobi(), low_zero_bits(), monty_exp_vartime(), Botan::Modular_Reducer::multiply(), Botan::BigInt::power_of_2(), and Botan::Modular_Reducer::square().
x | an integer |
Definition at line 157 of file numthry.cpp.
References Botan::BigInt::square().
Referenced by Botan::Modular_Reducer::cube(), and Botan::Modular_Reducer::square().
std::pair< BigInt, SymmetricKey > Botan::srp6_client_agree | ( | std::string_view | username, |
std::string_view | password, | ||
const DL_Group & | group, | ||
std::string_view | 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 78 of file srp6.cpp.
References Botan::BigInt::bits(), BOTAN_ARG_CHECK, BOTAN_ASSERT_NOMSG, Botan::HashFunction::create_or_throw(), Botan::BigInt::encode_1363(), fmt(), Botan::DL_Group::get_g(), Botan::DL_Group::get_p(), Botan::DL_Group::mod_p(), Botan::DL_Group::multiply_mod_p(), Botan::DL_Group::p_bits(), Botan::DL_Group::p_bytes(), Botan::DL_Group::power_b_p(), and Botan::DL_Group::power_g_p().
std::pair< BigInt, SymmetricKey > Botan::srp6_client_agree | ( | std::string_view | username, |
std::string_view | password, | ||
std::string_view | group_id, | ||
std::string_view | 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 65 of file srp6.cpp.
References Botan::DL_Group::exponent_bits(), and srp6_client_agree().
Referenced by botan_srp6_client_agree(), and srp6_client_agree().
BigInt Botan::srp6_generate_verifier | ( | std::string_view | identifier, |
std::string_view | password, | ||
const std::vector< uint8_t > & | salt, | ||
const DL_Group & | group, | ||
std::string_view | 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::HashFunction::create_or_throw(), fmt(), Botan::DL_Group::p_bits(), and Botan::DL_Group::power_g_p().
BigInt Botan::srp6_generate_verifier | ( | std::string_view | identifier, |
std::string_view | password, | ||
const std::vector< uint8_t > & | salt, | ||
std::string_view | group_id, | ||
std::string_view | 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 128 of file srp6.cpp.
References srp6_generate_verifier().
Referenced by botan_srp6_generate_verifier(), and srp6_generate_verifier().
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 46 of file srp6.cpp.
References Botan::BigInt::bits(), Botan::DL_Group::get_g(), and Botan::DL_Group::get_p().
|
inlineconstexpr |
Store many big-endian unsigned integers
out | a fixed-length span to some bytes |
ins | a arbitrary-length parameter list of unsigned integers to be stored |
Definition at line 429 of file loadstor.h.
References Botan::ranges::assert_exact_byte_length(), and T.
|
inlineconstexpr |
Store a big-endian unsigned integer
in | the input unsigned integer |
Definition at line 488 of file loadstor.h.
References store_be(), and T.
|
inlineconstexpr |
Store a big-endian unsigned integer
in | the input unsigned integer |
out_range | the fixed-length span to write to |
Definition at line 358 of file loadstor.h.
References reverse_bytes(), T, and typecast_copy().
Referenced by Botan::GHASH::add_final_block(), 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::DES::decrypt_n(), Botan::TripleDES::decrypt_n(), Botan::Noekeon::decrypt_n(), Botan::SEED::decrypt_n(), Botan::SHACAL2::decrypt_n(), Botan::SM4::decrypt_n(), Botan::FPE_FE1::encrypt(), Botan::TLS::Session::encrypt(), Botan::CryptoBox::encrypt(), Botan::Blowfish::encrypt_n(), Botan::CAST_128::encrypt_n(), Botan::DES::encrypt_n(), Botan::TripleDES::encrypt_n(), Botan::Noekeon::encrypt_n(), Botan::SEED::encrypt_n(), Botan::SHACAL2::encrypt_n(), Botan::SM4::encrypt_n(), Botan::TLS::Connection_Cipher_State::format_ad(), ipv4_to_string(), Botan::SP800_108_Counter::kdf(), Botan::SP800_108_Feedback::kdf(), Botan::SP800_108_Pipeline::kdf(), Botan::TLS::make_hello_random(), Botan::TLS::Cipher_State::next_ticket_nonce(), nist_key_wrap(), nist_key_wrap_padded(), Botan::CTR_BE::seek(), Botan::TLS::New_Session_Ticket_12::serialize(), Botan::TLS::New_Session_Ticket_13::serialize(), store_be(), store_be(), Botan::SIMD_4x32::store_be(), store_be(), Botan::Sphincs_Address::to_bytes(), Botan::Sphincs_Address::to_bytes_compressed(), Botan::Buffered_Computation::update_be(), Botan::Buffered_Computation::update_be(), and Botan::Buffered_Computation::update_be().
|
inlineconstexpr |
Store a big-endian unsigned integer
in | the input unsigned integer |
out | the byte array to write to |
Definition at line 408 of file loadstor.h.
References store_be(), and T.
|
inlineconstexpr |
Store many big-endian unsigned integers
ins | a pointer to some bytes to be written |
out | a arbitrary-length parameter list of unsigned integers to be stored |
Definition at line 463 of file loadstor.h.
References store_be().
|
inlineconstexpr |
Store many little-endian unsigned integers
out | a fixed-length span to some bytes |
ins | a arbitrary-length parameter list of unsigned integers to be stored |
Definition at line 446 of file loadstor.h.
References Botan::ranges::assert_exact_byte_length(), and T.
|
inlineconstexpr |
Store a little-endian unsigned integer
in | the input unsigned integer |
Definition at line 500 of file loadstor.h.
References store_le(), and T.
|
inlineconstexpr |
Store a little-endian unsigned integer
in | the input unsigned integer |
out_range | the fixed-length span to write to |
Definition at line 383 of file loadstor.h.
References get_byte(), reverse_bytes(), T, and typecast_copy().
Referenced by copy_out_le(), create_aes_row_generator(), create_shake_row_generator(), Botan::GOST_28147_89::decrypt_n(), Botan::Kuznyechik::decrypt_n(), Botan::Serpent::decrypt_n(), Botan::Threefish_512::decrypt_n(), Botan::Twofish::decrypt_n(), Botan::GOST_28147_89::encrypt_n(), Botan::Kuznyechik::encrypt_n(), Botan::Serpent::encrypt_n(), Botan::Threefish_512::encrypt_n(), Botan::Twofish::encrypt_n(), Botan::Streebog::final_result(), generate_mceliece_key(), Botan::RandomNumberGenerator::randomize_with_ts_input(), Botan::Salsa20::salsa_core(), Botan::ChaCha::seek(), Botan::Salsa20::seek(), Botan::FrodoMatrix::serialize(), Botan::Sodium::sodium_malloc(), Botan::Keccak_Permutation::squeeze(), store_le(), store_le(), Botan::SIMD_4x32::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::Dilithium_Common_Symmetric_Primitives::XOF().
|
inlineconstexpr |
Store a little-endian unsigned integer
in | the input unsigned integer |
out | the byte array to write to |
Definition at line 418 of file loadstor.h.
References store_le(), and T.
|
inlineconstexpr |
Store many little-endian unsigned integers
ins | a pointer to some bytes to be written |
out | a arbitrary-length parameter list of unsigned integers to be stored |
Definition at line 476 of file loadstor.h.
References store_le().
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 140 of file parsing.cpp.
Referenced by Botan::CPUID::to_string(), and Botan::Key_Constraints::to_string().
uint32_t Botan::string_to_ipv4 | ( | std::string_view | ip_str | ) |
Convert a string representation of an IPv4 address to a number
ip_str | the string representation |
Definition at line 156 of file parsing.cpp.
References fmt(), split_on(), and to_u32bit().
std::vector< polyn_gf2m > Botan::syndrome_init | ( | const polyn_gf2m & | generator, |
const std::vector< gf2m > & | support, | ||
int | n ) |
Definition at line 608 of file polyn_gf2m.cpp.
References Botan::polyn_gf2m::get_degree(), Botan::polyn_gf2m::get_sp_field(), and lex_to_gray().
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 368 of file system_rng.cpp.
Referenced by Botan::System_RNG::accepts_input(), botan_pk_op_decrypt_create(), botan_pk_op_encrypt_create(), botan_pk_op_kem_decrypt_create(), botan_pk_op_key_agreement_create(), botan_pk_op_sign_create(), botan_rng_reseed(), botan_system_rng_get(), Botan::System_RNG::clear(), Botan::System_RNG::fill_bytes_with_input(), Botan::System_RNG::is_seeded(), Botan::System_RNG::name(), Botan::Sodium::randombytes_buf(), and Botan::RandomNumberGenerator::randomize_with_ts_input().
|
inline |
Definition at line 17 of file noekeon_simd.cpp.
References T.
Referenced by Botan::Noekeon::decrypt_n(), and Botan::Noekeon::encrypt_n().
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 21 of file assert.cpp.
References fmt().
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 25 of file assert.cpp.
References fmt().
|
inline |
Definition at line 29 of file stl_util.h.
References T.
Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), and Botan::TLS::Channel_Impl_12::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_ISSUER_NOT_TRUSTED, 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.
std::string Botan::to_string | ( | ErrorType | type | ) |
Convert an ErrorType to string.
Definition at line 13 of file exceptn.cpp.
References Bzip2Error, CommonCryptoError, DatabaseError, DecodingFailure, EncodingFailure, HttpError, InternalError, InvalidArgument, InvalidKeyLength, InvalidNonceLength, InvalidObjectState, InvalidTag, IoError, KeyNotSet, LookupError, LzmaError, NotImplemented, OutOfMemory, Pkcs11Error, RoughtimeError, SystemError, TLSError, TPMError, Unknown, and ZlibError.
Referenced by Botan::TLS::Server_Hello_13::basic_validation(), botan_x509_cert_validation_status(), Botan::TLS::PskIdentity::identity_as_string(), and Botan::Path_Validation_Result::status_string().
|
inline |
Definition at line 33 of file stl_util.h.
BOTAN_TEST_API uint32_t Botan::to_u32bit | ( | std::string_view | str | ) |
Convert a decimal string to a number
str | the string to convert |
Definition at line 32 of file parsing.cpp.
Referenced by Botan::SCAN_Name::arg_as_integer(), Botan::SCAN_Name::arg_as_integer(), argon2_check_pwhash(), create_private_key(), Botan::TLS::Text_Policy::get_len(), Botan::HTTP::http_sync(), string_to_ipv4(), and to_uint16().
uint16_t Botan::to_uint16 | ( | std::string_view | str | ) |
Convert a decimal string to a number
str | the string to convert |
Definition at line 22 of file parsing.cpp.
References to_u32bit().
Referenced by check_bcrypt(), and Botan::TLS::Text_Policy::srtp_profiles().
std::string Botan::tolower_string | ( | std::string_view | in | ) |
Definition at line 196 of file parsing.cpp.
Referenced by host_wildcard_match().
BOTAN_TEST_API void Botan::treehash | ( | StrongSpan< SphincsTreeNode > | out_root, |
StrongSpan< SphincsAuthenticationPath > | out_auth_path, | ||
const Sphincs_Parameters & | params, | ||
Sphincs_Hash_Functions & | hashes, | ||
std::optional< TreeNodeIndex > | leaf_idx, | ||
uint32_t | idx_offset, | ||
uint32_t | tree_height, | ||
const GenerateLeafFunction & | gen_leaf, | ||
Sphincs_Address & | tree_address ) |
Implements a generic Merkle tree hash. Will be used for both FORS and XMSS signatures. gen_leaf
is used to create leaf nodes in the respective trees. Additionally XMSS uses the gen_leaf logic to store the WOTS Signature in the main Sphincs+ signature. The leaf_idx
is the index of leaf to sign. If only the root node must be computed (without a signature), the leaf_idx
is set to std::nullopt.
Definition at line 26 of file sp_treehash.cpp.
References BOTAN_ASSERT_NOMSG, Botan::StrongSpan< T >::get(), Botan::Sphincs_Parameters::n(), Botan::Sphincs_Address::set_tree_height(), Botan::Sphincs_Address::set_tree_index(), Botan::StrongSpan< T >::size(), and Botan::Sphincs_Hash_Functions::T().
Referenced by fors_sign_and_pkgen(), and xmss_sign_and_pkgen().
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
Create a trivial type by bit-casting a range of trivially copyable type with matching length into it.
Definition at line 209 of file mem_ops.h.
References typecast_copy().
|
inlineconstexpr |
Definition at line 243 of file mem_ops.h.
References T, and typecast_copy().
|
inlineconstexpr |
Definition at line 226 of file mem_ops.h.
References T, and typecast_copy().
|
inlineconstexpr |
Copy an instance of trivially copyable type into a range of trivially copyable type with matching length.
Definition at line 199 of file mem_ops.h.
References typecast_copy().
|
inlineconstexpr |
Copy a range of a trivially copyable type into another range of trivially copyable type of matching byte length.
Definition at line 176 of file mem_ops.h.
References Botan::ranges::assert_equal_byte_lengths(), and Botan::ranges::size_bytes().
Referenced by Botan::Roughtime::Response::from_bits(), load_be(), load_le(), store_be(), store_le(), typecast_copy(), typecast_copy(), typecast_copy(), typecast_copy(), typecast_copy(), typecast_copy(), typecast_copy(), xor_buf(), and xor_buf().
|
inlineconstexprnoexcept |
Copy a range of trivially copyable type into an instance of trivially copyable type with matching length.
Definition at line 188 of file mem_ops.h.
References typecast_copy().
|
inlineconstexpr |
Definition at line 235 of file mem_ops.h.
References T, and typecast_copy().
|
inlineconstexpr |
Definition at line 217 of file mem_ops.h.
References T, and typecast_copy().
BOTAN_TEST_API std::string 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 54 of file charset.cpp.
Referenced by Botan::ASN1_String::decode_from().
BOTAN_TEST_API std::string 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 70 of file charset.cpp.
Referenced by Botan::ASN1_String::decode_from().
std::vector< T > Botan::unlock | ( | const secure_vector< T > & | in | ) |
Definition at line 75 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::KeyPair::encryption_consistency_check(), Botan::OCSP::CertID::is_id_for(), Botan::Cipher_Mode_Filter::set_iv(), and Botan::PK_Signer::signature().
bool Botan::value_exists | ( | const std::vector< T > & | vec, |
const OT & | val ) |
Existence check for values
Definition at line 117 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::Certificate_Type_Base::Certificate_Type_Base(), Botan::TLS::Policy::choose_key_exchange_group(), Botan::TLS::Policy::ciphersuite_list(), Botan::TLS::Client_Hello_12::Client_Hello_12(), Botan::TLS::Server_Hello_13::create(), Botan::TLS::Hello_Retry_Request::Hello_Retry_Request(), Botan::TLS::Signature_Scheme::is_available(), Botan::TLS::Server_Impl_13::new_session_ticket_supported(), Botan::TLS::Key_Share::retry_offer(), Botan::TLS::Server_Hello_13::Server_Hello_13(), Botan::TLS::Supported_Groups::Supported_Groups(), and Botan::TLS::Certificate_Type_Base::validate_selection().
|
inlineconstexpr |
BOTAN_TEST_API void 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 155 of file divide.cpp.
References bigint_divop_vartime(), BOTAN_ASSERT_NOMSG, BOTAN_DEBUG_ASSERT, BOTAN_MP_WORD_BITS, 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(), Botan::BigInt::word_at(), and Botan::BigInt::zero().
Referenced by botan_mp_div(), operator%(), and operator/().
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 BOTAN_DISTRIBUTION_INFO, BOTAN_VERSION_DATESTAMP, BOTAN_VERSION_MAJOR, BOTAN_VERSION_MINOR, BOTAN_VERSION_PATCH, BOTAN_VERSION_RELEASE_TYPE, BOTAN_VERSION_VC_REVISION, and 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.
References BOTAN_VERSION_DATESTAMP.
Referenced by botan_version_datestamp().
uint32_t Botan::version_major | ( | ) |
Get the major version number.
Definition at line 82 of file version.cpp.
References BOTAN_VERSION_MAJOR.
Referenced by botan_version_major(), and runtime_version_check().
uint32_t Botan::version_minor | ( | ) |
Get the minor version number.
Definition at line 86 of file version.cpp.
References BOTAN_VERSION_MINOR.
Referenced by botan_version_minor(), and runtime_version_check().
uint32_t Botan::version_patch | ( | ) |
Get the patch number.
Definition at line 90 of file version.cpp.
References BOTAN_VERSION_PATCH.
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 67 of file version.cpp.
References version_cstr().
|
inline |
Definition at line 569 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(), bigint_monty_redc_8(), and bigint_monty_redc_generic().
|
inline |
Definition at line 528 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(), bigint_monty_redc_8(), and bigint_monty_redc_generic().
|
inline |
Definition at line 603 of file mp_asmi.h.
References BOTAN_MP_WORD_BITS, 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 265 of file mp_asmi.h.
References carry(), and word_add().
Referenced by bigint_add2_nc().
|
inline |
Definition at line 296 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 443 of file mp_asmi.h.
References carry(), and word_madd2().
Referenced by bigint_linmul2().
|
inline |
Definition at line 467 of file mp_asmi.h.
References carry(), and word_madd2().
Referenced by bigint_linmul3().
|
inline |
Definition at line 497 of file mp_asmi.h.
References carry(), and word_madd3().
Referenced by basecase_mul(), and basecase_sqr().
|
inline |
Definition at line 353 of file mp_asmi.h.
References carry(), and word_sub().
Referenced by bigint_sub2().
|
inline |
Definition at line 383 of file mp_asmi.h.
References carry(), and word_sub().
Referenced by bigint_sub2_rev().
|
inline |
Definition at line 413 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 237 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 44 of file mp_asmi.h.
References BOTAN_MP_WORD_BITS, carry(), and mul64x64_128().
Referenced by bigint_linmul2(), bigint_linmul3(), bigint_modop_vartime(), word3_muladd(), word3_muladd_2(), word8_linmul2(), and word8_linmul3().
|
inline |
Definition at line 91 of file mp_asmi.h.
References BOTAN_MP_WORD_BITS, carry(), and mul64x64_128().
Referenced by basecase_mul(), basecase_sqr(), and word8_madd3().
|
inline |
Definition at line 326 of file mp_asmi.h.
References carry().
Referenced by bigint_cnd_add_or_sub(), bigint_cnd_addsub(), bigint_cnd_sub(), bigint_sub2(), bigint_sub2_rev(), bigint_sub3(), bigint_sub_abs(), word8_sub2(), word8_sub2_rev(), and word8_sub3().
BOTAN_TEST_API WotsPublicKey Botan::wots_public_key_from_signature | ( | const SphincsTreeNode & | hashed_message, |
StrongSpan< const WotsSignature > | signature, | ||
Sphincs_Address & | address, | ||
const Sphincs_Parameters & | params, | ||
Sphincs_Hash_Functions & | hashes ) |
Reconstructs the WOTS public key from a given WOTS signature
and message
. This is tailored for the use case in the SPHINCS+ implementation and is not meant for general usability.
Definition at line 97 of file sp_wots.cpp.
References chain_lengths(), Botan::detail::Strong_Base< T >::get(), Botan::Sphincs_Parameters::n(), Botan::BufferStuffer::next(), Botan::Sphincs_Address::set_chain(), Botan::BufferSlicer::take(), Botan::Sphincs_Parameters::w(), and Botan::Sphincs_Parameters::wots_len().
Referenced by ht_verify().
BOTAN_TEST_API void Botan::wots_sign_and_pkgen | ( | StrongSpan< WotsSignature > | sig_out, |
StrongSpan< SphincsTreeNode > | leaf_out, | ||
const SphincsSecretSeed & | secret_seed, | ||
TreeNodeIndex | leaf_idx, | ||
std::optional< TreeNodeIndex > | sign_leaf_idx, | ||
const std::vector< WotsHashIndex > & | wots_steps, | ||
Sphincs_Address & | leaf_addr, | ||
Sphincs_Address & | pk_addr, | ||
const Sphincs_Parameters & | params, | ||
Sphincs_Hash_Functions & | hashes ) |
Implements a domain specific wrapper for the one-time signature scheme WOTS+ (Winternitz OTS). It is meant to be used inside SPHINCS+ and does not aim to be applicable for other use cases. If this function is not used in a signing operation (i.e. sign_leaf_idx
is not set), wots_steps
may be empty.
Definition at line 126 of file sp_wots.cpp.
References Botan::detail::Strong_Adapter< T >::begin(), BOTAN_ASSERT_NOMSG, Botan::Sphincs_Address::get_type(), Botan::Sphincs_Parameters::n(), Botan::BufferStuffer::next(), Botan::Sphincs_Hash_Functions::PRF(), Botan::Sphincs_Address::set_chain(), Botan::Sphincs_Address::set_hash(), Botan::Sphincs_Address::set_keypair(), Botan::Sphincs_Address::set_type(), Botan::Sphincs_Hash_Functions::T(), Botan::Sphincs_Parameters::w(), Botan::Sphincs_Parameters::wots_bytes(), Botan::Sphincs_Parameters::wots_len(), WotsHash, WotsKeyGeneration, and WotsPublicKeyCompression.
Referenced by xmss_sign_and_pkgen().
Path_Validation_Result Botan::x509_path_validate | ( | const std::vector< X509_Certificate > & | end_certs, |
const Path_Validation_Restrictions & | restrictions, | ||
const Certificate_Store & | store, | ||
std::string_view | 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::optional< 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 913 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, | ||
std::string_view | 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::optional< 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 839 of file x509path.cpp.
References Botan::PKIX::build_all_certificate_paths(), Botan::PKIX::check_chain(), Botan::PKIX::check_crl(), Botan::PKIX::check_ocsp(), Botan::PKIX::merge_revocation_status(), OCSP_NO_HTTP, OK, and Botan::Path_Validation_Result::successful_validation().
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, | ||
std::string_view | 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::optional< 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 927 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, | ||
std::string_view | 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::optional< 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 900 of file x509path.cpp.
References x509_path_validate().
SphincsTreeNode Botan::xmss_gen_root | ( | const Sphincs_Parameters & | params, |
const SphincsSecretSeed & | secret_seed, | ||
Sphincs_Hash_Functions & | hashes ) |
Definition at line 58 of file sp_xmss.cpp.
References Botan::Sphincs_Parameters::d(), HashTree, Botan::Sphincs_Parameters::n(), Botan::Sphincs_Address::set_layer(), Botan::Sphincs_Parameters::wots_bytes(), WotsPublicKeyCompression, xmss_sign_and_pkgen(), and Botan::Sphincs_Parameters::xmss_tree_height().
Referenced by Botan::SphincsPlus_PrivateKey::SphincsPlus_PrivateKey().
SphincsTreeNode Botan::xmss_sign_and_pkgen | ( | StrongSpan< SphincsXmssSignature > | out_sig, |
const SphincsTreeNode & | root, | ||
const SphincsSecretSeed & | secret_seed, | ||
Sphincs_Address & | wots_addr, | ||
Sphincs_Address & | tree_addr, | ||
std::optional< TreeNodeIndex > | idx_leaf, | ||
const Sphincs_Parameters & | params, | ||
Sphincs_Hash_Functions & | hashes ) |
This generates a Merkle signature of root
. The Merkle authentication path logic is mostly hidden in treehash_spec. The WOTS signature followed by the Merkle authentication path are stored in out_sig
, the new root of the Merkle tree is stored in out_root
. Set idx_leaf
to std::nullopt
if no signature is desired.
Definition at line 19 of file sp_xmss.cpp.
References Botan::Sphincs_Address::as_subtree_from(), BOTAN_ASSERT_NOMSG, chain_lengths(), Botan::Sphincs_Address::get_type(), HashTree, Botan::Sphincs_Parameters::n(), Botan::BufferStuffer::next(), Botan::BufferStuffer::remaining_capacity(), Botan::Sphincs_Address::set_type(), treehash(), Botan::Sphincs_Parameters::wots_bytes(), wots_sign_and_pkgen(), WotsPublicKeyCompression, and Botan::Sphincs_Parameters::xmss_tree_height().
Referenced by ht_sign(), and xmss_gen_root().
|
inlineconstexpr |
XOR arrays. Postcondition out[i] = in[i] ^ out[i] forall i = 0...length
out | the input/output range |
in | the read-only input range |
Definition at line 340 of file mem_ops.h.
References Botan::ranges::assert_equal_byte_lengths(), and typecast_copy().
Referenced by Botan::TLS::Connection_Cipher_State::aead_nonce(), Botan::TLS::Connection_Cipher_State::aead_nonce(), Botan::Salsa20::cipher_bytes(), Botan::Lion::decrypt_n(), Botan::BlockCipher::decrypt_n_xex(), Botan::Block_Cipher_Fixed_Params< BS, KMIN, KMAX, KMOD, BaseClass >::decrypt_n_xex(), Botan::Lion::encrypt_n(), Botan::BlockCipher::encrypt_n_xex(), Botan::Block_Cipher_Fixed_Params< BS, KMIN, KMAX, KMOD, BaseClass >::encrypt_n_xex(), mgf1_mask(), operator^(), Botan::OctetString::operator^=(), operator^=(), pbkdf2(), Botan::SIV_Mode::S2V(), xor_buf(), xor_buf(), xor_buf(), xor_buf(), and xor_buf().
|
inlineconstexpr |
XOR arrays. Postcondition out[i] = in1[i] ^ in2[i] forall i = 0...length
out | the output range |
in1 | the first input range |
in2 | the second input range |
Definition at line 370 of file mem_ops.h.
References Botan::ranges::assert_equal_byte_lengths(), and typecast_copy().
|
inline |
Definition at line 420 of file mem_ops.h.
References BOTAN_ARG_CHECK, and xor_buf().
void Botan::xor_buf | ( | std::vector< uint8_t, Alloc > & | out, |
const uint8_t * | in, | ||
const std::vector< uint8_t, Alloc2 > & | in2, | ||
size_t | n ) |
Definition at line 436 of file mem_ops.h.
References BOTAN_ARG_CHECK, and xor_buf().
void Botan::xor_buf | ( | std::vector< uint8_t, Alloc > & | out, |
const uint8_t * | in, | ||
size_t | n ) |
Definition at line 428 of file mem_ops.h.
References BOTAN_ARG_CHECK, and xor_buf().
|
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 input buffer |
length | the length of the three buffers |
Definition at line 414 of file mem_ops.h.
References xor_buf().
|
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 402 of file mem_ops.h.
References xor_buf().
Zeroise the values then free the memory
vec | the vector to zeroise and free |
Definition at line 117 of file secmem.h.
References zeroise().
Referenced by Botan::TLS::Cipher_State::advance_with_client_finished(), Botan::TLS::Cipher_State::advance_with_client_hello(), Botan::KMAC::clear(), 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::DES::clear(), Botan::TripleDES::clear(), Botan::GOST_28147_89::clear(), Botan::IDEA::clear(), Botan::Lion::clear(), Botan::Noekeon::clear(), Botan::SEED::clear(), Botan::Serpent::clear(), Botan::SHACAL2::clear(), Botan::SM4::clear(), Botan::Threefish_512::clear(), Botan::Twofish::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::GHASH::clear(), Botan::TLS::Record_Layer::clear_read_buffer(), Botan::TLS::Cipher_State::clear_read_keys(), and Botan::TLS::Cipher_State::clear_write_keys().
Zeroise the values; length remains unchanged
vec | the vector to zeroise |
Definition at line 108 of file secmem.h.
References T.
Referenced by Botan::Keccak_Permutation::clear(), Botan::SHAKE_Cipher::clear(), Botan::BLAKE2b::clear(), Botan::GOST_34_11::clear(), Botan::Streebog::clear(), Botan::CMAC::clear(), Botan::GMAC::clear(), Botan::CTR_BE::clear(), Botan::OFB::clear(), Botan::Whirlpool::init(), Botan::OctetString::operator^=(), Botan::GHASH::reset(), Botan::CFB_Mode::reset(), Botan::CBC_Decryption::reset(), Botan::OCB_Mode::reset(), Botan::CTR_BE::seek(), Botan::GHASH::set_associated_data(), and zap().
|
constexpr |
Definition at line 21 of file blake2b.h.
Referenced by Botan::BLAKE2b::add_data().
const size_t Botan::HEX_CODEC_BUFFER_SIZE = 256 |
Size used for internal buffer in hex encoder/decoder
Definition at line 19 of file hex_filt.cpp.
Referenced by Botan::Hex_Decoder::Hex_Decoder(), Botan::Hex_Encoder::Hex_Encoder(), and Botan::Hex_Encoder::Hex_Encoder().
|
constexpr |
Definition at line 34 of file concepts.h.
const size_t Botan::MAX_EXT_DEG = 16 |
Definition at line 18 of file gf2m_small_m.cpp.
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 167 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 452 of file streebog_precalc.cpp.
Referenced by Botan::Streebog::compress_64().