Botan 3.6.1
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 | CRYSTALS |
namespace | CT |
namespace | detail |
namespace | Dilithium_Algos |
namespace | fmt_detail |
namespace | FPE |
namespace | HTTP |
namespace | KeyPair |
namespace | Kuznyechik_F |
namespace | Kyber_Algos |
namespace | OCSP |
namespace | OIDS |
namespace | OS |
namespace | PCurve |
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 | TPM2 |
namespace | X509 |
Concepts | |
concept | md_hash_implementation |
concept | WordType |
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 |
template<size_t bound> | |
using | Bounded_XOF = detail::Bounded_XOF<XOF&, bound> |
using | byte = std::uint8_t |
typedef int32_t | CCCryptorStatus |
typedef std::vector< std::set< Certificate_Status_Code > > | CertificatePathStatusCodes |
typedef X25519_PrivateKey | Curve25519_PrivateKey |
typedef X25519_PublicKey | Curve25519_PublicKey |
using | DilithiumCommitmentHash = Strong<std::vector<uint8_t>, struct DilithiumCommitmentHash_> |
Hash of the message representative and the signer's commitment. | |
using | DilithiumHashedPublicKey = Strong<std::vector<uint8_t>, struct DilithiumHashedPublicKey_> |
using | DilithiumInternalKeypair |
Internal representation of a Dilithium key pair. | |
using | DilithiumMessageRepresentative = Strong<std::vector<uint8_t>, struct DilithiumMessageRepresentative_> |
Representation of the message to be signed. | |
using | DilithiumOptionalRandomness = Strong<secure_vector<uint8_t>, struct DilithiumOptionalRandomness_> |
Optional randomness 'rnd' used for rho prime computation in ML-DSA. | |
using | DilithiumPoly = Botan::CRYSTALS::Polynomial<DilithiumPolyTraits, Botan::CRYSTALS::Domain::Normal> |
using | DilithiumPolyMatNTT = Botan::CRYSTALS::PolynomialMatrix<DilithiumPolyTraits> |
using | DilithiumPolyNTT = Botan::CRYSTALS::Polynomial<DilithiumPolyTraits, Botan::CRYSTALS::Domain::NTT> |
using | DilithiumPolyVec = Botan::CRYSTALS::PolynomialVector<DilithiumPolyTraits, Botan::CRYSTALS::Domain::Normal> |
using | DilithiumPolyVecNTT = Botan::CRYSTALS::PolynomialVector<DilithiumPolyTraits, Botan::CRYSTALS::Domain::NTT> |
using | DilithiumSeedRandomness = Strong<secure_vector<uint8_t>, struct DilithiumSeedRandomness_> |
Principal seed used to generate Dilithium key pairs. | |
using | DilithiumSeedRho = Strong<std::vector<uint8_t>, struct DilithiumPublicSeed_> |
Public seed to sample the polynomial matrix A from. | |
using | DilithiumSeedRhoPrime = Strong<secure_vector<uint8_t>, struct DilithiumSeedRhoPrime_> |
Private seed to sample the polynomial vectors s1 and s2 from. | |
using | DilithiumSerializedCommitment = Strong<std::vector<uint8_t>, struct DilithiumSerializedCommitment_> |
Serialized representation of a commitment w1. | |
using | DilithiumSerializedPrivateKey = Strong<secure_vector<uint8_t>, struct DilithiumSerializedPrivateKey_> |
Serialized private key data. | |
using | DilithiumSerializedPublicKey = Strong<std::vector<uint8_t>, struct DilithiumSerializedPublicKey_> |
Serialized public key data (result of pkEncode(pk)) | |
using | DilithiumSerializedSignature = Strong<std::vector<uint8_t>, struct DilithiumSerializedSignature_> |
Serialized signature data. | |
using | DilithiumSigningSeedK = Strong<secure_vector<uint8_t>, struct DilithiumSeedK_> |
Private seed K used during signing. | |
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 | HSS_Level = Strong<uint32_t, struct HSS_Level_, EnableArithmeticWithPlainNumber> |
The HSS layer in the HSS multi tree starting at 0 from the root. | |
using | HSS_Sig_Idx = Strong<uint64_t, struct HSS_Sig_Idx_, EnableArithmeticWithPlainNumber> |
The index of a node within a specific LMS tree layer. | |
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 |
using | KyberCompressedCiphertext = Strong<std::vector<uint8_t>, struct KyberCompressedCiphertext_> |
Compressed and serialized ciphertext value. | |
using | KyberEncryptionRandomness = Strong<secure_vector<uint8_t>, struct KyberEncryptionRandomness_> |
Random value used to generate the Kyber ciphertext. | |
using | KyberHashedCiphertext = Strong<std::vector<uint8_t>, struct KyberHashedCiphertext_> |
using | KyberHashedPublicKey = Strong<std::vector<uint8_t>, struct KyberHashedPublicKey_> |
Hash value of the serialized public key. | |
using | KyberImplicitRejectionValue = Strong<secure_vector<uint8_t>, struct KyberImplicitRejectionValue_> |
Secret random value (called Z in the spec), used for implicit rejection in the decapsulation. | |
using | KyberInternalKeypair |
using | KyberMessage = Strong<secure_vector<uint8_t>, struct KyberMessage_> |
Random message value to be encrypted by the CPA-secure Kyber encryption scheme. | |
using | KyberPoly = Botan::CRYSTALS::Polynomial<KyberPolyTraits, Botan::CRYSTALS::Domain::Normal> |
using | KyberPolyMat = Botan::CRYSTALS::PolynomialMatrix<KyberPolyTraits> |
using | KyberPolyNTT = Botan::CRYSTALS::Polynomial<KyberPolyTraits, Botan::CRYSTALS::Domain::NTT> |
using | KyberPolyVec = Botan::CRYSTALS::PolynomialVector<KyberPolyTraits, Botan::CRYSTALS::Domain::Normal> |
using | KyberPolyVecNTT = Botan::CRYSTALS::PolynomialVector<KyberPolyTraits, Botan::CRYSTALS::Domain::NTT> |
using | KyberSamplingRandomness = Strong<secure_vector<uint8_t>, struct KyberSamplingRandomness_> |
PRF value used for sampling of error polynomials. | |
using | KyberSeedRandomness = Strong<secure_vector<uint8_t>, struct KyberSeedRandomness_> |
Principal seed used to generate Kyber key pairs. | |
using | KyberSeedRho = Strong<std::vector<uint8_t>, struct KyberSeedRho_> |
Public seed value to generate the Kyber matrix A. | |
using | KyberSeedSigma = Strong<secure_vector<uint8_t>, struct KyberSeedSigma_> |
Private seed used to generate polynomial vectors s and e during key generation. | |
using | KyberSerializedPublicKey = Strong<std::vector<uint8_t>, struct KyberSerializedPublicKey_> |
Public key in serialized form (t || rho) | |
using | KyberSharedSecret = Strong<secure_vector<uint8_t>, struct KyberSharedSecret_> |
Shared secret value generated during encapsulation and recovered during decapsulation. | |
using | KyberSigmaOrEncryptionRandomness |
Variant value of either a KyberSeedSigma or a KyberEncryptionRandomness. | |
using | LMOTS_K = Strong<std::vector<uint8_t>, struct LMOTS_K_> |
The K value from the LM-OTS public key. | |
using | LMOTS_Node = Strong<secure_vector<uint8_t>, struct LMOTS_Node_> |
One node within one LM-OTS hash chain. | |
using | LMOTS_Signature_Bytes = Strong<std::vector<uint8_t>, struct LMOTS_Signature_Bytes_> |
Byte vector of an LM-OTS signature. | |
using | LMS_AuthenticationPath = Strong<std::vector<uint8_t>, struct LMS_AuthenticationPath_> |
The authentication path of an LMS signature. | |
using | LMS_Identifier = Strong<std::vector<uint8_t>, struct LMS_Identifier_> |
The identifier of an LMS tree (I in RFC 8554) | |
using | LMS_Message = Strong<std::vector<uint8_t>, struct LMS_Message_> |
A message that is signed with an LMS tree. | |
using | LMS_Seed = Strong<secure_vector<uint8_t>, struct LMS_SEED_> |
Seed of the LMS tree, used to generate the LM-OTS private keys. | |
using | LMS_Signature_Bytes = Strong<std::vector<uint8_t>, struct LMS_Signature_Bytes_> |
Raw bytes of an LMS signature. | |
using | LMS_Tree_Node = Strong<std::vector<uint8_t>, struct LMS_Tree_Node_> |
A node with the LMS tree. | |
using | LMS_Tree_Node_Idx = Strong<uint32_t, struct LMS_Tree_Node_Idx_, EnableArithmeticWithPlainNumber> |
The index of a node within a specific LMS tree layer. | |
template<typename T > | |
using | lock_guard_type = lock_guard<T> |
typedef MessageAuthenticationCode | MAC |
using | ML_DSA_Mode = DilithiumMode |
using | ML_DSA_PrivateKey = Dilithium_PrivateKey |
using | ML_DSA_PublicKey = Dilithium_PublicKey |
using | ML_KEM_Mode = KyberMode |
using | ML_KEM_PrivateKey = Kyber_PrivateKey |
using | ML_KEM_PublicKey = Kyber_PublicKey |
using | mutex_type = noop_mutex |
template<std::signed_integral T> | |
using | next_longer_int_t |
template<std::unsigned_integral T> | |
using | next_longer_uint_t |
using | Point448 = Strong<std::array<uint8_t, X448_LEN>, struct Point448_> |
typedef EC_Point | PointGFp |
using | recursive_mutex_type = noop_mutex |
typedef RandomNumberGenerator | RNG |
typedef PBKDF | S2K |
using | s32bit = std::int32_t |
using | ScalarX448 = Strong<std::array<uint8_t, X448_LEN>, struct ScalarX448_> |
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 | SphincsContext = Strong<std::vector<uint8_t>, struct SphincsContext_> |
using | SphincsHashedMessage = Strong<std::vector<uint8_t>, struct SphincsHashedMessage_> |
using | SphincsHypertreeSignature = Strong<std::vector<uint8_t>, struct SphincsXmssSignature_> |
using | SphincsInputMessage = Strong<std::vector<uint8_t>, struct SphincsInputMessage_> |
using | SphincsMessagePrefix = Strong<std::vector<uint8_t>, struct SphincsMessagePrefix_> |
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_> |
template<typename T > | |
using | strong_type_wrapped_type = typename detail::wrapped_type_helper<std::remove_cvref_t<T>>::type |
Extracts the wrapped type from a strong type. | |
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 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) |
template<typename T > | |
T | assert_is_some (std::optional< T > v, const char *expr, const char *func, const char *file, int line) |
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) |
template<WordType W, size_t N> | |
constexpr auto | bigint_add (std::span< W, N > z, std::span< const W, N > x, std::span< const W, N > y) -> W |
template<WordType W> | |
constexpr void | bigint_add2 (W x[], size_t x_size, const W y[], size_t y_size) |
template<WordType W> | |
constexpr auto | bigint_add2_nc (W x[], size_t x_size, const W y[], size_t y_size) -> W |
template<WordType W> | |
constexpr void | bigint_add3 (W z[], const W x[], size_t x_size, const W y[], size_t y_size) |
template<WordType W> | |
constexpr auto | bigint_add3_nc (W z[], const W x[], size_t x_size, const W y[], size_t y_size) -> W |
template<WordType W> | |
constexpr int32_t | bigint_cmp (const W x[], size_t x_size, const W y[], size_t y_size) |
template<WordType W> | |
constexpr void | bigint_cnd_abs (W cnd, W x[], size_t size) |
template<WordType W> | |
constexpr W | bigint_cnd_add (W cnd, W x[], const W y[], size_t size) |
template<WordType W> | |
constexpr W | bigint_cnd_add (W cnd, W x[], size_t x_size, const W y[], size_t y_size) |
template<WordType W> | |
constexpr void | bigint_cnd_add_or_sub (CT::Mask< W > mask, W x[], const W y[], size_t size) |
template<WordType W> | |
constexpr auto | bigint_cnd_addsub (CT::Mask< W > mask, W x[], const W y[], const W z[], size_t size) -> W |
template<WordType W> | |
constexpr auto | bigint_cnd_sub (W cnd, W x[], const W y[], size_t size) -> W |
template<WordType W> | |
constexpr auto | bigint_cnd_sub (W cnd, W x[], size_t x_size, const W y[], size_t y_size) -> W |
template<WordType W> | |
constexpr void | bigint_cnd_swap (W cnd, W x[], W 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_mul7 (word z[14], const word x[7], const word y[7]) |
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_sqr7 (word z[14], const word x[7]) |
void | bigint_comba_sqr8 (word z[16], const word x[8]) |
void | bigint_comba_sqr9 (word z[18], const word x[9]) |
template<WordType W> | |
constexpr auto | bigint_ct_is_eq (const W x[], size_t x_size, const W y[], size_t y_size) -> CT::Mask< W > |
template<WordType W> | |
constexpr auto | bigint_ct_is_lt (const W x[], size_t x_size, const W y[], size_t y_size, bool lt_or_equal=false) -> CT::Mask< W > |
template<WordType W> | |
constexpr auto | bigint_divop_vartime (W n1, W n0, W d) -> W |
template<WordType W> | |
constexpr auto | bigint_linmul2 (W x[], size_t x_size, W y) -> W |
template<WordType W> | |
constexpr void | bigint_linmul3 (W z[], const W x[], size_t x_size, W y) |
template<WordType W> | |
constexpr void | bigint_mod_sub (W t[], const W s[], const W mod[], size_t mod_sw, W ws[]) |
template<size_t N, WordType W> | |
constexpr void | bigint_mod_sub_n (W t[], const W s[], const W mod[], W ws[]) |
template<WordType W> | |
constexpr auto | bigint_modop_vartime (W n1, W n0, W d) -> W |
template<WordType W> | |
constexpr void | bigint_monty_maybe_sub (size_t N, W z[], W x0, const W x[], const W p[]) |
template<size_t N, WordType W> | |
constexpr void | bigint_monty_maybe_sub (W z[N], W x0, const W x[N], const W y[N]) |
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) |
template<WordType W> | |
constexpr void | bigint_shl1 (W x[], size_t x_size, size_t x_words, size_t shift) |
template<WordType W> | |
constexpr void | bigint_shl2 (W y[], const W x[], size_t x_size, size_t shift) |
template<WordType W> | |
constexpr void | bigint_shr1 (W x[], size_t x_size, size_t shift) |
template<WordType W> | |
constexpr void | bigint_shr2 (W y[], const W x[], size_t x_size, size_t 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) |
template<WordType W> | |
constexpr auto | bigint_sub2 (W x[], size_t x_size, const W y[], size_t y_size) -> W |
template<WordType W> | |
constexpr void | bigint_sub2_rev (W x[], const W y[], size_t y_size) |
template<WordType W> | |
constexpr auto | bigint_sub3 (W z[], const W x[], size_t x_size, const W y[], size_t y_size) -> W |
template<WordType W> | |
constexpr auto | bigint_sub_abs (W z[], const W x[], const W y[], size_t N, W ws[]) -> CT::Mask< W > |
template<WordType W> | |
constexpr int32_t | bigint_sub_abs (W z[], const W x[], size_t x_size, const W 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) |
constexpr auto | bitlen (size_t x) |
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 | |
BOTAN_FUNC_ISA_INLINE ("gfni,avx2") SIMD_8x32 gf2p8mul(const SIMD_8x32 &a | |
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) |
constexpr 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<std::unsigned_integral T> | |
constexpr T | ceil_division (T a, 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) |
template<std::unsigned_integral T> | |
constexpr std::optional< T > | checked_add (T a, T b) |
template<std::unsigned_integral T, std::unsigned_integral... Ts> requires all_same_v<T, Ts...> | |
constexpr std::optional< T > | checked_add (T a, T b, Ts... rest) |
template<typename RT , typename AT > requires std::integral<strong_type_wrapped_type<RT>> && std::integral<strong_type_wrapped_type<AT>> | |
constexpr RT | checked_cast_to (AT i) |
template<typename RT , typename ExceptionType , typename AT > requires std::integral<strong_type_wrapped_type<RT>> && std::integral<strong_type_wrapped_type<AT>> | |
constexpr RT | checked_cast_to_or_throw (AT i, std::string_view error_msg_on_fail) |
template<std::unsigned_integral T> | |
constexpr std::optional< T > | checked_mul (T a, T b) |
template<std::unsigned_integral T> | |
constexpr std::optional< T > | checked_sub (T a, T b) |
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) |
template<size_t N, WordType W> | |
constexpr void | comba_mul (W z[2 *N], const W x[N], const W y[N]) |
template<size_t N, WordType W> | |
constexpr void | comba_sqr (W z[2 *N], const W x[N]) |
constexpr 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<concepts::contiguous_strong_type TreeNode, concepts::strong_span AuthPathSS, concepts::tree_node_index TreeNodeIndex, concepts::tree_layer_index TreeLayerIndex, typename Address > requires concepts::tree_address<Address, TreeLayerIndex, TreeNodeIndex> | |
void | compute_root (StrongSpan< TreeNode > out_root, AuthPathSS authentication_path, TreeNodeIndex leaf_idx, StrongSpan< const TreeNode > leaf, size_t node_size, TreeLayerIndex total_tree_height, uint32_t idx_offset, concepts::tree_hash_node_pair< TreeNodeIndex, TreeLayerIndex, Address, StrongSpan< TreeNode > > auto node_pair_hash, Address &tree_address) |
Uses an authentication path and a leaf node to reconstruct the root node of a merkle tree. | |
template<typename OutR = detail::AutoDetect, ranges::spanable_range... Rs> requires (all_same_v<std::ranges::range_value_t<Rs>...>) | |
constexpr auto | concat (Rs &&... ranges) |
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<ranges::spanable_range InR> | |
void | copy_out_be (std::span< uint8_t > out, InR &&in) |
template<ranges::spanable_range InR> | |
void | copy_out_le (std::span< uint8_t > out, InR &&in) |
template<WordType W, size_t N, W C> | |
consteval std::array< W, N > | crandall_p () |
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::array< uint8_t, ED448_LEN > | create_pk_from_sk (std::span< const uint8_t, ED448_LEN > sk) |
Create a public key point from a secret key (RFC 8032 5.2.5) | |
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) |
Point448 | decode_point (std::span< const uint8_t > p_bytes) |
Decode a point from a byte array. RFC 7748 Section 5 (decodeUCoordinate) | |
ScalarX448 | decode_scalar (std::span< const uint8_t > scalar_bytes) |
Decode a scalar from a byte array. RFC 7748 Section 5 (decodeScalar448) | |
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) |
secure_vector< uint8_t > | encode_point (const Point448 &p) |
Encode a point to a 56 byte vector. RFC 7748 Section 5 (encodeUCoordinate) | |
template<typename T > | |
uint16_t | expand_mask_16bit (T tst) |
void | expand_message_xmd (std::string_view hash_fn, std::span< uint8_t > output, std::span< const uint8_t > input, std::span< const uint8_t > domain_sep) |
void | expand_message_xmd (std::string_view hash_fn, std::span< uint8_t > output, std::string_view input_str, std::string_view domain_sep_str) |
template<typename T > requires (std::is_integral<T>::value) | |
constexpr T | expand_top_bit (T a) |
template<std::integral T> | |
consteval eea_result< T > | extended_euclidean_algorithm (T a, T b) |
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 &hash) |
FIPS 205, Algorithm 17: fors_pkFromSig. | |
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) |
FIPS 205, Algorithm 16: fors_sign (with simultaneous FORS pk generation) | |
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) |
template<WordType W> | |
constexpr uint32_t | get_uint32 (const W xw[], size_t i) |
template<uint64_t A, uint8_t B> | |
SIMD_8x32 | gf2p8affine (const SIMD_8x32 &x) |
template<uint64_t A, uint8_t B> | |
SIMD_8x32 | gf2p8affineinv (const SIMD_8x32 &x) |
consteval uint64_t | gfni_matrix (std::string_view s) |
gf2m | gray_to_lex (gf2m gray) |
bool | has_filesystem_impl () |
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<WordType W, size_t N> | |
constexpr auto | hex_to_words (const char(&s)[N]) |
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) |
FIPS 205, Algorithm 12: ht_sign. | |
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) |
FIPS 205, Algorithm 13: ht_verify. | |
uint8_t | ieee1363_hash_id (std::string_view name) |
size_t | if_work_factor (size_t bits) |
template<typename T > | |
constexpr void | ignore_param (T &&) |
template<typename... T> | |
constexpr void | ignore_params (T &&... args) |
template<std::unsigned_integral T> | |
constexpr size_t | index_of_first_set_byte (T v) |
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) |
LMOTS_K | lmots_compute_pubkey_from_sig (const LMOTS_Signature &sig, const LMS_Message &msg, const LMS_Identifier &identifier, LMS_Tree_Node_Idx q) |
Compute a public key candidate for an OTS-signature-message pair and the OTS instance parameters. | |
uint64_t | load_3 (const uint8_t in[3]) |
uint64_t | load_4 (const uint8_t *in) |
template<typename OutT = detail::AutoDetect, typename... ParamTs> | |
constexpr auto | load_be (ParamTs &&... params) |
template<typename OutT = detail::AutoDetect, typename... ParamTs> | |
constexpr auto | load_le (ParamTs &&... params) |
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 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) |
void | mgf1_mask (HashFunction &hash, std::span< const uint8_t > input, std::span< uint8_t > output) |
size_t | miller_rabin_test_iterations (size_t n_bits, size_t prob, bool random) |
template<std::integral T, std::integral T2 = next_longer_int_t<T>> requires (sizeof(T) <= 4) | |
consteval T | modular_inverse (T q, T2 m=T2(1)<< sizeof(T) *8) |
template<std::integral T> requires (size_t(sizeof(T)) <= 4) | |
consteval T | montgomery_R (T q) |
template<std::integral T> requires (size_t(sizeof(T)) <= 4) | |
consteval T | montgomery_R2 (T q) |
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) |
template<WordType W> | |
constexpr auto | monty_inverse (W a) -> W |
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) |
constexpr 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) |
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) |
CT::Option< size_t > | oaep_find_delim (std::span< const uint8_t > input, std::span< const 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 EC_Group &lhs, const EC_Group &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) |
template<std::unsigned_integral T> | |
constexpr donna128 | operator* (const donna128 &x, T y) |
EC_Point | operator* (const EC_Point &point, const BigInt &scalar) |
Ed448Point | operator* (const Scalar448 &lhs, const Ed448Point &rhs) |
Syntax sugar for scalar multiplication. | |
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::unsigned_integral T> | |
constexpr donna128 | operator* (T y, const donna128 &x) |
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, 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) |
constexpr donna128 | operator+ (const donna128 &x, const donna128 &y) |
constexpr 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) |
constexpr donna128 | operator| (const donna128 &x, const donna128 &y) |
constexpr donna128 | operator| (const donna128 &x, uint64_t 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) |
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) |
EC_Point | OS2ECP (std::span< const uint8_t > data, const CurveGFp &curve) |
template<typename T > requires std::is_default_constructible_v<T> | |
constexpr auto | out_opt (std::optional< T > &outopt) noexcept |
template<typename T > | |
constexpr auto | out_ptr (T &outptr) noexcept |
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) |
template<WordType W, size_t N, W C> | |
constexpr std::array< W, N > | redc_crandall (std::span< const W, 2 *N > z) |
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) |
template<std::unsigned_integral T> requires (sizeof(T) == 1 || sizeof(T) == 2 || sizeof(T) == 4 || sizeof(T) == 8) | |
constexpr T | reverse_bytes (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) |
Gf448Elem | root (const Gf448Elem &elem) |
Compute the root of elem in the field. | |
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) |
constexpr 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) |
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, WordType W, size_t N> | |
constexpr W | shift_left (std::array< W, N > &x) |
template<size_t S, WordType W, size_t N> | |
constexpr W | shift_right (std::array< W, N > &x) |
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) |
std::array< uint8_t, 2 *ED448_LEN > | sign_message (std::span< const uint8_t, ED448_LEN > sk, std::span< const uint8_t, ED448_LEN > pk, bool f, std::span< const uint8_t > context, std::span< const uint8_t > msg) |
Sign a message using a keypair (RFC 8032 5.2.6) | |
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 &group, const EC_Point &point) |
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) |
Gf448Elem | square (const Gf448Elem &elem) |
Computes elem^2. Faster than operator*. | |
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<typename ModifierT = detail::AutoDetect, typename... ParamTs> | |
constexpr auto | store_be (ParamTs &&... params) |
template<typename ModifierT = detail::AutoDetect, typename... ParamTs> | |
constexpr auto | store_le (ParamTs &&... params) |
std::string | string_join (const std::vector< std::string > &strs, char delim) |
std::optional< 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) |
template<std::unsigned_integral T> | |
constexpr T | swar_in_range (T v, T lower, T upper) |
template<std::unsigned_integral T> | |
constexpr T | swar_lt (T a, T b) |
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) |
template<typename T > requires std::is_enum_v<T> | |
auto | to_underlying (T e) noexcept |
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<concepts::contiguous_strong_type TreeNode, concepts::strong_span AuthPathSS, concepts::tree_node_index TreeNodeIndex, concepts::tree_layer_index TreeLayerIndex, typename Address > requires concepts::tree_address<Address, TreeLayerIndex, TreeNodeIndex> | |
void | treehash (StrongSpan< TreeNode > out_root, std::optional< AuthPathSS > out_auth_path, std::optional< TreeNodeIndex > leaf_idx, size_t node_size, TreeLayerIndex total_tree_height, uint32_t idx_offset, concepts::tree_hash_node_pair< TreeNodeIndex, TreeLayerIndex, Address, StrongSpan< TreeNode > > auto node_pair_hash, concepts::tree_gen_leaf< TreeNodeIndex, TreeLayerIndex, Address, StrongSpan< TreeNode > > auto gen_leaf, Address &tree_address) |
Treehash logic to build up a merkle hash tree. | |
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_default_constructible_v<ToT> && std::is_trivially_copyable_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 > | |
constexpr decltype(auto) | unwrap_strong_type (T &&t) |
Generically unwraps a strong type to its underlying type. | |
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) |
bool | verify_signature (std::span< const uint8_t, ED448_LEN > pk, bool phflag, std::span< const uint8_t > context, std::span< const uint8_t > sig, std::span< const uint8_t > msg) |
Verify a signature(RFC 8032 5.2.7) | |
const char * | version_cstr () |
uint32_t | version_datestamp () |
uint32_t | version_major () |
uint32_t | version_minor () |
uint32_t | version_patch () |
std::string | version_string () |
template<WordType W> | |
constexpr void | word3_add (W *w2, W *w1, W *w0, W x) |
template<WordType W> | |
constexpr void | word3_muladd (W *w2, W *w1, W *w0, W x, W y) |
template<WordType W> | |
constexpr void | word3_muladd_2 (W *w2, W *w1, W *w0, W x, W y) |
template<WordType W> | |
constexpr auto | word4_add3 (W z[4], const W x[4], const W y[4], W carry) -> W |
template<WordType W> | |
constexpr auto | word4_sub3 (W z[4], const W x[4], const W y[4], W carry) -> W |
template<WordType W> | |
constexpr auto | word8_add2 (W x[8], const W y[8], W carry) -> W |
template<WordType W> | |
constexpr auto | word8_add3 (W z[8], const W x[8], const W y[8], W carry) -> W |
template<WordType W> | |
constexpr auto | word8_linmul2 (W x[8], W y, W carry) -> W |
template<WordType W> | |
constexpr auto | word8_linmul3 (W z[8], const W x[8], W y, W carry) -> W |
template<WordType W> | |
constexpr auto | word8_madd3 (W z[8], const W x[8], W y, W carry) -> W |
template<WordType W> | |
constexpr auto | word8_sub2 (W x[8], const W y[8], W carry) -> W |
template<WordType W> | |
constexpr auto | word8_sub2_rev (W x[8], const W y[8], W carry) -> W |
template<WordType W> | |
constexpr auto | word8_sub3 (W z[8], const W x[8], const W y[8], W carry) -> W |
template<WordType W> | |
constexpr auto | word_add (W x, W y, W *carry) -> W |
template<WordType W> | |
constexpr auto | word_madd2 (W a, W b, W *c) -> W |
template<WordType W> | |
constexpr auto | word_madd3 (W a, W b, W c, W *d) -> W |
template<WordType W> | |
constexpr auto | word_sub (W x, W y, W *carry) -> W |
constexpr size_t | words_for_bits (size_t x) |
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) |
FIPS 205, Algorithm 8: wots_pkFromSig. | |
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) |
FIPS 205, Algorithm 6 and 7: wots_pkGen and wots_sign. | |
template<typename T , typename ParamT > requires std::constructible_from<T, ParamT> || (concepts::strong_type<T> && std::constructible_from<typename T::wrapped_type, ParamT>) | |
constexpr decltype(auto) | wrap_strong_type (ParamT &&t) |
Wraps a value into a caller-defined (strong) type. | |
Point448 | x448 (const ScalarX448 &k, const Point448 &u) |
Multiply a scalar k with a point u . | |
Point448 | x448_basepoint (const ScalarX448 &k) |
Multiply a scalar with the base group element (5) | |
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 &message, 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) |
FIPS 205, Algorithm 10: xmss_sign. | |
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) |
void | xts_update_tweak_block (uint8_t tweak[], size_t BS, size_t blocks_in_tweak) |
template<typename T , typename Alloc > | |
void | zap (std::vector< T, Alloc > &vec) |
template<typename T , typename Alloc > | |
void | zeroise (std::vector< T, Alloc > &vec) |
Variables | |
const SIMD_8x32 & | b |
constexpr size_t | BLAKE2B_BLOCKBYTES = 128 |
constexpr size_t | BYTES_448 = ceil_tobytes(448) |
constexpr size_t | ED448_LEN = 57 |
const size_t | HEX_CODEC_BUFFER_SIZE = 256 |
template<typename T > | |
constexpr bool | is_strong_span_v = is_strong_span<T>::value |
template<typename... Ts> | |
constexpr bool | is_strong_type_v = is_strong_type<std::remove_const_t<Ts>...>::value |
constexpr size_t | LMS_IDENTIFIER_LEN = 16 |
The length in bytes of the LMS identifier (I). | |
const size_t | MAX_EXT_DEG = 16 |
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] |
constexpr size_t | WORDS_448 = 7 |
constexpr size_t | X448_LEN = 56 |
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)
Symmetric 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 (C) 2024 Fabian Albert, René Meusel - Rohde & Schwarz Cybersecurity
Botan is released under the Simplified BSD License (see license.txt)
HSS - Hierarchical Signatures System (RFC 8554) (C) 2023 Jack Lloyd 2023 Fabian Albert, Philippe Lieser - Rohde & Schwarz Cybersecurity GmbH
Botan is released under the Simplified BSD License (see license.txt)
HSS-LMS (C) 2023 Jack Lloyd 2023 Fabian Albert, René Meusel, Amos Treiber - Rohde & Schwarz Cybersecurity
Botan is released under the Simplified BSD License (see license.txt)
Utils for HSS/LMS (C) 2023 Jack Lloyd 2023 Fabian Albert, Philippe Lieser - Rohde & Schwarz Cybersecurity GmbH
Botan is released under the Simplified BSD License (see license.txt)
LM-OTS - Leighton-Micali One-Time Signatures (C) 2023 Jack Lloyd 2023 Fabian Albert, Philippe Lieser - Rohde & Schwarz Cybersecurity GmbH
Botan is released under the Simplified BSD License (see license.txt)
LM-OTS - Leighton-Micali One-Time Signatures (RFC 8554 Section 4) (C) 2023 Jack Lloyd 2023 Fabian Albert, Philippe Lieser - Rohde & Schwarz Cybersecurity GmbH
Botan is released under the Simplified BSD License (see license.txt)
LMS - Leighton-Micali Hash-Based Signatures (RFC 8554) (C) 2023 Jack Lloyd 2023 Fabian Albert, Philippe Lieser - Rohde & Schwarz Cybersecurity GmbH
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)
Treehash logic used for hash-based signatures (C) 2023 Jack Lloyd 2023 Fabian Albert, René Meusel, Amos Treiber, Philippe Lieser - Rohde & Schwarz Cybersecurity GmbH
Parts of this file have been adapted from https://github.com/sphincs/sphincsplus
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::Bounded_XOF = detail::Bounded_XOF<XOF&, bound> |
Definition at line 221 of file pqcrystals_helpers.h.
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 18 of file curve25519.h.
Definition at line 17 of file curve25519.h.
using Botan::DilithiumCommitmentHash = Strong<std::vector<uint8_t>, struct DilithiumCommitmentHash_> |
Hash of the message representative and the signer's commitment.
Definition at line 64 of file dilithium_types.h.
using Botan::DilithiumHashedPublicKey = Strong<std::vector<uint8_t>, struct DilithiumHashedPublicKey_> |
Hash value of the serialized public key data (result of H(BytesToBits(pkEncode(pk)), also referred to as 'tr')
Definition at line 52 of file dilithium_types.h.
Internal representation of a Dilithium key pair.
Definition at line 67 of file dilithium_types.h.
using Botan::DilithiumMessageRepresentative = Strong<std::vector<uint8_t>, struct DilithiumMessageRepresentative_> |
Representation of the message to be signed.
Definition at line 55 of file dilithium_types.h.
using Botan::DilithiumOptionalRandomness = Strong<secure_vector<uint8_t>, struct DilithiumOptionalRandomness_> |
Optional randomness 'rnd' used for rho prime computation in ML-DSA.
Definition at line 39 of file dilithium_types.h.
using Botan::DilithiumPoly = Botan::CRYSTALS::Polynomial<DilithiumPolyTraits, Botan::CRYSTALS::Domain::Normal> |
Definition at line 26 of file dilithium_types.h.
Definition at line 24 of file dilithium_types.h.
using Botan::DilithiumPolyNTT = Botan::CRYSTALS::Polynomial<DilithiumPolyTraits, Botan::CRYSTALS::Domain::NTT> |
Definition at line 22 of file dilithium_types.h.
using Botan::DilithiumPolyVec = Botan::CRYSTALS::PolynomialVector<DilithiumPolyTraits, Botan::CRYSTALS::Domain::Normal> |
Definition at line 27 of file dilithium_types.h.
using Botan::DilithiumPolyVecNTT = Botan::CRYSTALS::PolynomialVector<DilithiumPolyTraits, Botan::CRYSTALS::Domain::NTT> |
Definition at line 23 of file dilithium_types.h.
using Botan::DilithiumSeedRandomness = Strong<secure_vector<uint8_t>, struct DilithiumSeedRandomness_> |
Principal seed used to generate Dilithium key pairs.
Definition at line 30 of file dilithium_types.h.
using Botan::DilithiumSeedRho = Strong<std::vector<uint8_t>, struct DilithiumPublicSeed_> |
Public seed to sample the polynomial matrix A from.
Definition at line 33 of file dilithium_types.h.
using Botan::DilithiumSeedRhoPrime = Strong<secure_vector<uint8_t>, struct DilithiumSeedRhoPrime_> |
Private seed to sample the polynomial vectors s1 and s2 from.
Definition at line 36 of file dilithium_types.h.
using Botan::DilithiumSerializedCommitment = Strong<std::vector<uint8_t>, struct DilithiumSerializedCommitment_> |
Serialized representation of a commitment w1.
Definition at line 61 of file dilithium_types.h.
using Botan::DilithiumSerializedPrivateKey = Strong<secure_vector<uint8_t>, struct DilithiumSerializedPrivateKey_> |
Serialized private key data.
Definition at line 45 of file dilithium_types.h.
using Botan::DilithiumSerializedPublicKey = Strong<std::vector<uint8_t>, struct DilithiumSerializedPublicKey_> |
Serialized public key data (result of pkEncode(pk))
Definition at line 48 of file dilithium_types.h.
using Botan::DilithiumSerializedSignature = Strong<std::vector<uint8_t>, struct DilithiumSerializedSignature_> |
Serialized signature data.
Definition at line 58 of file dilithium_types.h.
using Botan::DilithiumSigningSeedK = Strong<secure_vector<uint8_t>, struct DilithiumSeedK_> |
Private seed K used during signing.
Definition at line 42 of file dilithium_types.h.
Definition at line 140 of file ed25519_fe.h.
using Botan::ForsLeafSecret = Strong<secure_vector<uint8_t>, struct ForsLeafSecret_> |
Definition at line 71 of file sp_types.h.
using Botan::ForsSignature = Strong<std::vector<uint8_t>, struct ForsSignature_> |
Definition at line 72 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::HSS_Level = Strong<uint32_t, struct HSS_Level_, EnableArithmeticWithPlainNumber> |
using Botan::HSS_Sig_Idx = Strong<uint64_t, struct HSS_Sig_Idx_, EnableArithmeticWithPlainNumber> |
using Botan::HypertreeLayerIndex = Strong<uint32_t, struct HypertreeLayerIndex_> |
Index of a layer in the XMSS hyper-tree.
Definition at line 86 of file sp_types.h.
using Botan::KyberCompressedCiphertext = Strong<std::vector<uint8_t>, struct KyberCompressedCiphertext_> |
Compressed and serialized ciphertext value.
Definition at line 63 of file kyber_types.h.
using Botan::KyberEncryptionRandomness = Strong<secure_vector<uint8_t>, struct KyberEncryptionRandomness_> |
Random value used to generate the Kyber ciphertext.
Definition at line 48 of file kyber_types.h.
using Botan::KyberHashedCiphertext = Strong<std::vector<uint8_t>, struct KyberHashedCiphertext_> |
Hash of the compressed and serialized ciphertext value TODO: Remove this once Kyber-R3 is removed
Definition at line 67 of file kyber_types.h.
using Botan::KyberHashedPublicKey = Strong<std::vector<uint8_t>, struct KyberHashedPublicKey_> |
Hash value of the serialized public key.
Definition at line 60 of file kyber_types.h.
using Botan::KyberImplicitRejectionValue = Strong<secure_vector<uint8_t>, struct KyberImplicitRejectionValue_> |
Secret random value (called Z in the spec), used for implicit rejection in the decapsulation.
Definition at line 42 of file kyber_types.h.
Definition at line 73 of file kyber_types.h.
using Botan::KyberMessage = Strong<secure_vector<uint8_t>, struct KyberMessage_> |
Random message value to be encrypted by the CPA-secure Kyber encryption scheme.
Definition at line 45 of file kyber_types.h.
using Botan::KyberPoly = Botan::CRYSTALS::Polynomial<KyberPolyTraits, Botan::CRYSTALS::Domain::Normal> |
Definition at line 29 of file kyber_types.h.
Definition at line 27 of file kyber_types.h.
using Botan::KyberPolyNTT = Botan::CRYSTALS::Polynomial<KyberPolyTraits, Botan::CRYSTALS::Domain::NTT> |
Definition at line 25 of file kyber_types.h.
using Botan::KyberPolyVec = Botan::CRYSTALS::PolynomialVector<KyberPolyTraits, Botan::CRYSTALS::Domain::Normal> |
Definition at line 30 of file kyber_types.h.
using Botan::KyberPolyVecNTT = Botan::CRYSTALS::PolynomialVector<KyberPolyTraits, Botan::CRYSTALS::Domain::NTT> |
Definition at line 26 of file kyber_types.h.
using Botan::KyberSamplingRandomness = Strong<secure_vector<uint8_t>, struct KyberSamplingRandomness_> |
PRF value used for sampling of error polynomials.
Definition at line 51 of file kyber_types.h.
using Botan::KyberSeedRandomness = Strong<secure_vector<uint8_t>, struct KyberSeedRandomness_> |
Principal seed used to generate Kyber key pairs.
Definition at line 33 of file kyber_types.h.
using Botan::KyberSeedRho = Strong<std::vector<uint8_t>, struct KyberSeedRho_> |
Public seed value to generate the Kyber matrix A.
Definition at line 36 of file kyber_types.h.
using Botan::KyberSeedSigma = Strong<secure_vector<uint8_t>, struct KyberSeedSigma_> |
Private seed used to generate polynomial vectors s and e during key generation.
Definition at line 39 of file kyber_types.h.
using Botan::KyberSerializedPublicKey = Strong<std::vector<uint8_t>, struct KyberSerializedPublicKey_> |
Public key in serialized form (t || rho)
Definition at line 57 of file kyber_types.h.
using Botan::KyberSharedSecret = Strong<secure_vector<uint8_t>, struct KyberSharedSecret_> |
Shared secret value generated during encapsulation and recovered during decapsulation.
Definition at line 54 of file kyber_types.h.
Variant value of either a KyberSeedSigma or a KyberEncryptionRandomness.
Definition at line 70 of file kyber_types.h.
using Botan::LMOTS_K = Strong<std::vector<uint8_t>, struct LMOTS_K_> |
using Botan::LMOTS_Node = Strong<secure_vector<uint8_t>, struct LMOTS_Node_> |
using Botan::LMOTS_Signature_Bytes = Strong<std::vector<uint8_t>, struct LMOTS_Signature_Bytes_> |
using Botan::LMS_AuthenticationPath = Strong<std::vector<uint8_t>, struct LMS_AuthenticationPath_> |
using Botan::LMS_Identifier = Strong<std::vector<uint8_t>, struct LMS_Identifier_> |
using Botan::LMS_Message = Strong<std::vector<uint8_t>, struct LMS_Message_> |
using Botan::LMS_Seed = Strong<secure_vector<uint8_t>, struct LMS_SEED_> |
using Botan::LMS_Signature_Bytes = Strong<std::vector<uint8_t>, struct LMS_Signature_Bytes_> |
using Botan::LMS_Tree_Node = Strong<std::vector<uint8_t>, struct LMS_Tree_Node_> |
using Botan::LMS_Tree_Node_Idx = Strong<uint32_t, struct LMS_Tree_Node_Idx_, EnableArithmeticWithPlainNumber> |
using Botan::lock_guard_type = lock_guard<T> |
typedef MessageAuthenticationCode Botan::MAC |
using Botan::ML_DSA_Mode = DilithiumMode |
using Botan::ML_KEM_Mode = KyberMode |
using Botan::mutex_type = noop_mutex |
using Botan::next_longer_int_t |
using Botan::next_longer_uint_t |
Definition at line 28 of file pqcrystals_helpers.h.
using Botan::Point448 = Strong<std::array<uint8_t, X448_LEN>, struct Point448_> |
Definition at line 18 of file x448_internal.h.
typedef EC_Point Botan::PointGFp |
Definition at line 449 of file ec_point.h.
typedef RandomNumberGenerator Botan::RNG |
typedef PBKDF Botan::S2K |
using Botan::s32bit = std::int32_t |
using Botan::ScalarX448 = Strong<std::array<uint8_t, X448_LEN>, struct ScalarX448_> |
Definition at line 24 of file x448_internal.h.
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 67 of file sp_types.h.
using Botan::SphincsContext = Strong<std::vector<uint8_t>, struct SphincsContext_> |
Definition at line 57 of file sp_types.h.
using Botan::SphincsHashedMessage = Strong<std::vector<uint8_t>, struct SphincsHashedMessage_> |
Definition at line 59 of file sp_types.h.
using Botan::SphincsHypertreeSignature = Strong<std::vector<uint8_t>, struct SphincsXmssSignature_> |
Definition at line 66 of file sp_types.h.
using Botan::SphincsInputMessage = Strong<std::vector<uint8_t>, struct SphincsInputMessage_> |
Definition at line 49 of file sp_types.h.
using Botan::SphincsMessagePrefix = Strong<std::vector<uint8_t>, struct SphincsMessagePrefix_> |
The prefix appended to the message in [hash_]slh_sign and slh_verify. E.g. for SLH-DSA (pure): 0x00 || |ctx| || ctx. Empty for SPHINCS+.
Definition at line 47 of file sp_types.h.
using Botan::SphincsMessageRandomness = Strong<secure_vector<uint8_t>, struct SphincsMessageRandomness_> |
Definition at line 64 of file sp_types.h.
using Botan::SphincsOptionalRandomness = Strong<secure_vector<uint8_t>, struct SphincsOptionalRandomness_> |
Definition at line 63 of file sp_types.h.
using Botan::SphincsPublicSeed = Strong<std::vector<uint8_t>, struct SphincsPublicSeed_> |
Definition at line 60 of file sp_types.h.
using Botan::SphincsSecretPRF = Strong<secure_vector<uint8_t>, struct SphincsSecretPRF_> |
Definition at line 62 of file sp_types.h.
using Botan::SphincsSecretSeed = Strong<secure_vector<uint8_t>, struct SphincsSecretSeed_> |
Definition at line 61 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 70 of file sp_types.h.
using Botan::SphincsXmssSignature = Strong<std::vector<uint8_t>, struct SphincsXmssSignature_> |
Definition at line 65 of file sp_types.h.
using Botan::strong_type_wrapped_type = typename detail::wrapped_type_helper<std::remove_cvref_t<T>>::type |
Extracts the wrapped type from a strong type.
If the provided type is not a strong type, it is returned as is.
::wrapped_type
declaration if you know that you are dealing with a strong type. Definition at line 262 of file strong_type.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 83 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 92 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 95 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 98 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 79 of file sp_types.h.
using Botan::WotsPublicKey = Strong<std::vector<uint8_t>, struct WotsPublicKey_> |
Definition at line 73 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 76 of file sp_types.h.
using Botan::WotsSignature = Strong<secure_vector<uint8_t>, struct WotsSignature_> |
Definition at line 80 of file sp_types.h.
typedef ASN1_Time Botan::X509_Time |
Definition at line 409 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 89 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 29 of file asn1_obj.h.
|
strong |
ASN.1 Type Tags
Definition at line 44 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 187 of file pkix_enums.h.
|
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 26 of file ec_group.h.
|
strong |
Enumerator | |
---|---|
Builtin | |
ExternalSource |
Definition at line 36 of file ec_group.h.
|
strong |
Enumerator | |
---|---|
Uncompressed | |
Compressed | |
UNCOMPRESSED | |
COMPRESSED | |
Hybrid | |
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 |
Enum of available LM-OTS algorithm types.
The supported parameter sets are defined in RFC 8554 Section 4.1. and draft-fluhrer-lms-more-parm-sets-11 Section 4. HSS/LMS typecodes are introduced in RFC 8554 Section 3.2. and their format specified in Section 3.3.
Definition at line 65 of file lm_ots.h.
|
strong |
Enum of available LMS algorithm types.
The supported parameter sets are defined in RFC 8554 Section 5.1. and draft-fluhrer-lms-more-parm-sets-11 Section 5. HSS/LMS typecodes are introduced in RFC 8554 Section 3.2. and their format specified in Section 3.3.
Definition at line 30 of file lms.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 | |
SLHDSA128Small | |
SLHDSA128Fast | |
SLHDSA192Small | |
SLHDSA192Fast | |
SLHDSA256Small | |
SLHDSA256Fast |
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 138 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 Botan::EC_Group::EC_Group(), gcd(), and Botan::EC_Group::verify_group().
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 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
Verify an Argon2 password hash
against the provided password
. Returns false if the input hash seems malformed or if the computed hash does not match.
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 = 2, | ||
size_t | salt_len = 16, | ||
size_t | output_len = 32 ) |
Generate an Argon2 hash of the specified password
. The y
parameter specifies the variant: 0 for Argon2d, 1 for Argon2i, and 2 for Argon2id.
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().
T Botan::assert_is_some | ( | std::optional< T > | v, |
const char * | expr, | ||
const char * | func, | ||
const char * | file, | ||
int | line ) |
Define BOTAN_ASSERT_IS_SOME
Definition at line 390 of file stl_util.h.
References assertion_failure().
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.
Referenced by assert_is_some().
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 162 of file base32.cpp.
References base_decode_to_vec().
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 166 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 149 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 154 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 158 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 141 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 145 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 164 of file base58.cpp.
References base58_decode(), and load_be().
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::bytes(), and Botan::BigInt::serialize().
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 188 of file base64.cpp.
References base_decode_to_vec().
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 181 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 192 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 168 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 173 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 177 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 200 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 160 of file base64.cpp.
References base_encode().
Referenced by argon2_generate_pwhash(), base64_encode(), Botan::OCSP::Request::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 164 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 196 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(), and out_ptr().
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().
Referenced by base32_decode(), and base64_decode().
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.
|
inlineconstexpr |
Definition at line 257 of file mp_core.h.
References bigint_add3_nc(), word4_add3(), and word8_add3().
|
inlineconstexpr |
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 275 of file mp_core.h.
References bigint_add2_nc().
Referenced by Botan::BigInt::add().
|
inlineconstexpr |
Two operand addition with carry out
Definition at line 206 of file mp_core.h.
References BOTAN_ASSERT, carry(), word8_add2(), and word_add().
Referenced by bigint_add2(), and redc_crandall().
|
inlineconstexpr |
Three operand addition
Definition at line 283 of file mp_core.h.
References bigint_add3_nc().
Referenced by Botan::BigInt::add2().
|
inlineconstexpr |
Three operand addition with carry out
Definition at line 232 of file mp_core.h.
References bigint_add3_nc(), carry(), word8_add3(), and word_add().
Referenced by bigint_add(), bigint_add3(), bigint_add3_nc(), Botan::BigInt::mod_add(), and redc_p521().
|
inlineconstexpr |
Compare x and y Return -1 if x < y Return 0 if x == y Return 1 if x > y
Definition at line 592 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().
|
inlineconstexpr |
Definition at line 192 of file mp_core.h.
References carry(), Botan::CT::Mask< T >::expand(), and word_add().
|
inlineconstexpr |
Definition at line 75 of file mp_core.h.
References bigint_cnd_add().
|
inlineconstexpr |
Definition at line 42 of file mp_core.h.
References BOTAN_ASSERT, carry(), Botan::CT::Mask< T >::expand(), word8_add3(), and word_add().
Referenced by bigint_cnd_add(), Botan::BigInt::ct_cond_add(), redc_p192(), redc_p224(), redc_p256(), and redc_p384().
|
inlineconstexpr |
Definition at line 129 of file mp_core.h.
References carry(), Botan::CT::Mask< T >::select(), Botan::CT::Mask< T >::select_n(), word8_add3(), word8_sub3(), word_add(), and word_sub().
|
inlineconstexpr |
Definition at line 162 of file mp_core.h.
References carry(), word8_add3(), word8_sub3(), word_add(), and word_sub().
Referenced by bigint_mod_sub(), and bigint_mod_sub_n().
|
inlineconstexpr |
Definition at line 117 of file mp_core.h.
References bigint_cnd_sub().
|
inlineconstexpr |
Definition at line 84 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().
|
inlineconstexpr |
Definition at line 30 of file mp_core.h.
References b, and 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 794 of file mp_comba.cpp.
References Botan::word3< W >::extract(), and Botan::word3< W >::mul().
Referenced by bigint_mul(), and comba_mul().
BOTAN_FUZZER_API void Botan::bigint_comba_mul24 | ( | word | z[48], |
const word | x[24], | ||
const word | y[24] ) |
Definition at line 1446 of file mp_comba.cpp.
References Botan::word3< W >::extract(), and Botan::word3< W >::mul().
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 42 of file mp_comba.cpp.
References Botan::word3< W >::extract(), and Botan::word3< W >::mul().
Referenced by bigint_mul(), and comba_mul().
BOTAN_FUZZER_API void Botan::bigint_comba_mul6 | ( | word | z[12], |
const word | x[6], | ||
const word | y[6] ) |
Definition at line 115 of file mp_comba.cpp.
References Botan::word3< W >::extract(), and Botan::word3< W >::mul().
Referenced by bigint_mul(), and comba_mul().
BOTAN_FUZZER_API void Botan::bigint_comba_mul7 | ( | word | z[14], |
const word | x[7], | ||
const word | y[7] ) |
Definition at line 221 of file mp_comba.cpp.
References Botan::word3< W >::extract(), and Botan::word3< W >::mul().
Referenced by comba_mul().
BOTAN_FUZZER_API void Botan::bigint_comba_mul8 | ( | word | z[16], |
const word | x[8], | ||
const word | y[8] ) |
Definition at line 352 of file mp_comba.cpp.
References Botan::word3< W >::extract(), and Botan::word3< W >::mul().
Referenced by bigint_mul(), and comba_mul().
BOTAN_FUZZER_API void Botan::bigint_comba_mul9 | ( | word | z[18], |
const word | x[9], | ||
const word | y[9] ) |
Definition at line 511 of file mp_comba.cpp.
References Botan::word3< W >::extract(), and Botan::word3< W >::mul().
Referenced by bigint_mul(), and comba_mul().
BOTAN_FUZZER_API void Botan::bigint_comba_sqr16 | ( | word | z[32], |
const word | x[16] ) |
Definition at line 618 of file mp_comba.cpp.
References Botan::word3< W >::extract(), Botan::word3< W >::mul(), and Botan::word3< W >::mul_x2().
Referenced by bigint_sqr(), and comba_sqr().
BOTAN_FUZZER_API void Botan::bigint_comba_sqr24 | ( | word | z[48], |
const word | x[24] ) |
Definition at line 1090 of file mp_comba.cpp.
References Botan::word3< W >::extract(), Botan::word3< W >::mul(), and Botan::word3< W >::mul_x2().
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 Botan::word3< W >::extract(), Botan::word3< W >::mul(), and Botan::word3< W >::mul_x2().
Referenced by bigint_sqr(), and comba_sqr().
BOTAN_FUZZER_API void Botan::bigint_comba_sqr6 | ( | word | z[12], |
const word | x[6] ) |
Definition at line 74 of file mp_comba.cpp.
References Botan::word3< W >::extract(), Botan::word3< W >::mul(), and Botan::word3< W >::mul_x2().
Referenced by bigint_sqr(), and comba_sqr().
BOTAN_FUZZER_API void Botan::bigint_comba_sqr7 | ( | word | z[14], |
const word | x[7] ) |
Definition at line 171 of file mp_comba.cpp.
References Botan::word3< W >::extract(), Botan::word3< W >::mul(), and Botan::word3< W >::mul_x2().
Referenced by comba_sqr().
BOTAN_FUZZER_API void Botan::bigint_comba_sqr8 | ( | word | z[16], |
const word | x[8] ) |
Definition at line 292 of file mp_comba.cpp.
References Botan::word3< W >::extract(), Botan::word3< W >::mul(), and Botan::word3< W >::mul_x2().
Referenced by bigint_sqr(), and comba_sqr().
BOTAN_FUZZER_API void Botan::bigint_comba_sqr9 | ( | word | z[18], |
const word | x[9] ) |
Definition at line 440 of file mp_comba.cpp.
References Botan::word3< W >::extract(), Botan::word3< W >::mul(), and Botan::word3< W >::mul_x2().
Referenced by bigint_sqr(), and comba_sqr().
|
inlineconstexpr |
Definition at line 672 of file mp_core.h.
References Botan::CT::Mask< T >::is_zero().
Referenced by Botan::BigInt::is_equal().
|
inlineconstexpr |
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 639 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(), Botan::BigInt::is_less_than(), and Botan::PCurve::PrimeOrderCurveImpl< C >::mul2_vartime_x_mod_order_eq().
|
inlineconstexpr |
Compute ((n1<<bits) + n0) / d
Definition at line 778 of file mp_core.h.
Referenced by bigint_modop_vartime(), and vartime_divide().
|
inlinenodiscardconstexpr |
Definition at line 552 of file mp_core.h.
References carry(), word8_linmul2(), and word_madd2().
Referenced by Botan::BigInt::mul(), and Botan::BigInt::operator*=().
|
inlineconstexpr |
Definition at line 569 of file mp_core.h.
References carry(), word8_linmul3(), and word_madd2().
Referenced by bigint_mul(), bigint_sqr(), Botan::BigInt::mul(), operator*(), and operator*().
|
inlineconstexpr |
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 739 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().
|
inlineconstexpr |
Definition at line 757 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().
|
inlineconstexpr |
Compute ((n1<<bits) + n0) % d
Definition at line 813 of file mp_core.h.
References bigint_divop_vartime(), carry(), and word_madd2().
Referenced by operator%(), and Botan::BigInt::operator%=().
|
inlineconstexpr |
Conditional subtraction for Montgomery reduction
This function assumes that (x0 || x) is less than 2*p
Computes z[0:N] = (x0 || x[0:N]) - p[0:N]
If z would be positive, returns z[0:N] Otherwise returns original input x
Definition at line 374 of file mp_core.h.
References Botan::CT::conditional_assign_mem(), word8_sub3(), and word_sub().
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(), bigint_monty_redc_generic(), and redc_crandall().
|
inlineconstexpr |
Conditional subtraction for Montgomery reduction
This function assumes that (x0 || x) is less than 2*p
Computes z[0:N] = (x0 || x[0:N]) - p[0:N]
If z would be positive, returns z[0:N] Otherwise returns original input x
Definition at line 403 of file mp_core.h.
References Botan::CT::conditional_assign_mem(), word4_sub3(), word8_sub3(), and word_sub().
|
inline |
Montgomery Reduction
z | integer to reduce, of size exactly 2*p_size. Output is in the first p_size 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 words |
ws_size | size of ws in words |
Definition at line 1047 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 205 of file mp_monty_n.cpp.
References Botan::word3< W >::add(), bigint_monty_maybe_sub(), clear_mem(), Botan::word3< W >::extract(), Botan::word3< W >::monty_step(), and Botan::word3< W >::mul().
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 516 of file mp_monty_n.cpp.
References Botan::word3< W >::add(), bigint_monty_maybe_sub(), clear_mem(), Botan::word3< W >::extract(), Botan::word3< W >::monty_step(), and Botan::word3< W >::mul().
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 1171 of file mp_monty_n.cpp.
References Botan::word3< W >::add(), bigint_monty_maybe_sub(), clear_mem(), Botan::word3< W >::extract(), Botan::word3< W >::monty_step(), and Botan::word3< W >::mul().
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 Botan::word3< W >::add(), bigint_monty_maybe_sub(), clear_mem(), Botan::word3< W >::extract(), Botan::word3< W >::monty_step(), and Botan::word3< W >::mul().
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 49 of file mp_monty_n.cpp.
References Botan::word3< W >::add(), bigint_monty_maybe_sub(), clear_mem(), Botan::word3< W >::extract(), Botan::word3< W >::monty_step(), and Botan::word3< W >::mul().
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 110 of file mp_monty_n.cpp.
References Botan::word3< W >::add(), bigint_monty_maybe_sub(), clear_mem(), Botan::word3< W >::extract(), Botan::word3< W >::monty_step(), and Botan::word3< W >::mul().
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 Botan::word3< W >::add(), bigint_monty_maybe_sub(), BOTAN_ARG_CHECK, clear_mem(), Botan::word3< W >::extract(), Botan::word3< W >::monty_step(), and Botan::word3< W >::mul().
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::BigInt::mul(), Botan::Montgomery_Params::mul(), Botan::Montgomery_Params::mul(), Botan::Montgomery_Params::mul_by(), Botan::Montgomery_Params::mul_by(), operator*(), and Botan::Scalar448::operator*().
|
inlineconstexpr |
Definition at line 467 of file mp_core.h.
References carry(), carry_shift(), clear_mem(), copy_mem(), and Botan::CT::Mask< T >::expand().
Referenced by Botan::BigInt::operator<<=().
|
inlineconstexpr |
Definition at line 510 of file mp_core.h.
References carry(), carry_shift(), copy_mem(), and Botan::CT::Mask< T >::expand().
Referenced by Botan::BigInt::ct_shift_left(), and operator<<().
|
inlineconstexpr |
Definition at line 486 of file mp_core.h.
References carry(), carry_shift(), clear_mem(), copy_mem(), and Botan::CT::Mask< T >::expand().
Referenced by Botan::BigInt::operator>>=().
|
inlineconstexpr |
Definition at line 528 of file mp_core.h.
References 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().
|
inlineconstexpr |
Two operand subtraction
Definition at line 291 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().
|
inlineconstexpr |
Two operand subtraction, x = y - x; assumes y >= x
Definition at line 317 of file mp_core.h.
References BOTAN_ASSERT, word8_sub2_rev(), and word_sub().
Referenced by Botan::BigInt::add().
|
inlineconstexpr |
Three operand subtraction
Expects that x_size >= y_size
Writes to z[0:x_size] and returns borrow
Definition at line 341 of file mp_core.h.
References BOTAN_ASSERT, word8_sub3(), and word_sub().
Referenced by bigint_mod_sub(), bigint_mod_sub_n(), bigint_sub_abs(), ct_divide(), ct_modulo(), Botan::BigInt::ct_reduce_below(), Botan::BigInt::mod_add(), and Botan::BigInt::reduce_below().
|
inlineconstexpr |
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 439 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().
|
inlineconstexpr |
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 709 of file mp_core.h.
References bigint_cmp(), bigint_sub3(), Botan::CT::conditional_swap(), and Botan::CT::conditional_swap_ptr().
|
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().
|
constexpr |
Definition at line 98 of file pqcrystals_helpers.h.
References ceil_log2().
Referenced by Botan::DilithiumConstants::DilithiumConstants(), and Botan::KyberConstants::KyberConstants().
Botan::BOTAN_FUNC_ISA | ( | "avx2" | ) |
Definition at line 157 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().
Botan::BOTAN_FUNC_ISA_INLINE | ( | " | gfni, |
avx2" | ) const & |
size_t Botan::buffer_insert | ( | std::vector< T, Alloc > & | buf, |
size_t | buf_offset, | ||
const std::vector< T, Alloc2 > & | input ) |
Definition at line 325 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 314 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_modop_vartime(), bigint_shl1(), bigint_shl2(), bigint_shr1(), bigint_shr2(), Botan::Streebog::compress_64(), Botan::FE_25519::from_bytes(), ge_scalarmult_base(), Botan::BigInt::mul(), Botan::FE_25519::mul(), Botan::BigInt::operator*=(), Botan::donna128::operator+=(), Botan::donna128::operator+=(), redc_crandall(), redc_p521(), sc_muladd(), sc_reduce(), Botan::EC_Group_Data::scalar_from_bytes_with_trunc(), shift_left(), shift_right(), Botan::Sodium::sodium_add(), Botan::Sodium::sodium_increment(), Botan::FE_25519::sqr2(), Botan::FE_25519::sqr_iter(), word3_muladd(), word3_muladd_2(), word4_add3(), word4_sub3(), word8_add2(), word8_add3(), word8_linmul2(), word8_linmul3(), word8_madd3(), word8_sub2(), word8_sub2_rev(), word8_sub3(), word_add(), word_madd2(), word_madd3(), word_sub(), and xts_update_tweak_block().
|
inline |
Definition at line 49 of file ed25519_internal.h.
|
inline |
Definition at line 39 of file ed25519_internal.h.
Referenced by sc_muladd(), sc_reduce(), and Botan::FE_25519::to_bytes().
|
inlineconstexpr |
Definition at line 133 of file donna128.h.
Referenced by bigint_shl1(), bigint_shl2(), bigint_shr1(), and bigint_shr2().
|
inline |
|
inline |
Definition at line 273 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::KDF::derive_key(), Botan::KDF::derive_key(), Botan::KDF::derive_key(), Botan::PK_Key_Agreement::derive_key(), Botan::PK_Key_Agreement::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::Application_Layer_Protocol_Notification::serialize(), Botan::TLS::Server_Name_Indicator::serialize(), Botan::Encrypted_PSK_Database::set(), Botan::PSK_Database::set_str(), Botan::Buffered_Computation::update(), Botan::PK_Signer::update(), Botan::PK_Verifier::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 277 of file mem_ops.h.
References b.
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::TPM2::Context::manufacturer(), Botan::HTTP::operator<<(), operator<<(), operator>>(), Botan::DataSource_Stream::peek(), Botan::DataSource_Stream::read(), Botan::Pipe::read_all_as_string(), Botan::ASN1::to_string(), Botan::TPM2::Context::vendor(), 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 bitlen(), 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 157 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.
Corresponds to FIPS 205, Algorithm 7 or 8, Step 1-7
Definition at line 91 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
Takes a password
and a bcrypt hash
and returns true if the password is the same as the one that was used to generate the bcrypt 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(), Botan::CT::is_equal(), and load_be().
|
inlineconstexpr |
Definition at line 19 of file int_utils.h.
Referenced by checked_add(), Botan::AlternativeName::count(), and Botan::OID::encode_into().
|
inlineconstexpr |
Definition at line 37 of file int_utils.h.
References b, and checked_add().
|
constexpr |
Definition at line 74 of file int_utils.h.
References checked_cast_to_or_throw().
Referenced by Botan::ML_DSA_MessageHash::start(), and Botan::HSS_LMS_PublicKeyInternal::verify_signature().
|
constexpr |
Definition at line 61 of file int_utils.h.
References unwrap_strong_type(), and wrap_strong_type().
Referenced by checked_cast_to(), and Botan::HSS_LMS_Params::HSS_LMS_Params().
|
inlineconstexpr |
Definition at line 46 of file int_utils.h.
Referenced by Botan::mlock_allocator::allocate(), allocate_memory(), and Botan::mlock_allocator::deallocate().
Definition at line 28 of file int_utils.h.
References b.
Definition at line 193 of file bit_ops.h.
References b.
Referenced by majority(), Botan::CT::Mask< T >::select(), Botan::CT::Mask< T >::select_n(), 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::CT::copy_output(), create_aes_row_generator(), 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(), Botan::Gf448Elem::Gf448Elem(), hex_decode(), Botan::BLAKE2b::key_schedule(), Botan::PKCS11::MechanismWrapper::MechanismParameters::MechanismParameters(), Botan::EC_Point_Var_Point_Precompute::mul(), pbkdf2(), Botan::CRYSTALS::Trait_Base< ConstantsT, DerivedT >::polyvec_pointwise_acc_montgomery(), 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().
|
inlineconstexpr |
Definition at line 948 of file mp_core.h.
References bigint_comba_mul16(), bigint_comba_mul4(), bigint_comba_mul6(), bigint_comba_mul7(), bigint_comba_mul8(), bigint_comba_mul9(), Botan::word3< W >::extract(), and Botan::word3< W >::mul().
|
inlineconstexpr |
Definition at line 984 of file mp_core.h.
References bigint_comba_sqr16(), bigint_comba_sqr4(), bigint_comba_sqr6(), bigint_comba_sqr7(), bigint_comba_sqr8(), bigint_comba_sqr9(), Botan::word3< W >::extract(), and Botan::word3< W >::mul().
|
inlineconstexpr |
Definition at line 137 of file donna128.h.
References b, and 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 SLH-DSA verification logic.
Definition at line 102 of file sp_treehash.cpp.
References BOTAN_ASSERT_NOMSG, copy_mem(), 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().
|
inline |
Uses an authentication path and a leaf node to reconstruct the root node of a merkle tree.
out_root | A output buffer for the root node of the merkle tree. |
authentication_path | The authentication path in one buffer (concatenated nodes). |
leaf_idx | The index of the leaf used to sig in the bottom layer beginning with 0. |
leaf | The leaf node used to sig. |
node_size | The size of each node in the tree. |
total_tree_height | The hight of the merkle tree to construct. |
idx_offset | If we compute a subtree this marks the index of the leftmost leaf node in the bottom layer. |
node_pair_hash | The function to process two child nodes to compute their parent node. |
tree_address | The address that is passed to node_pair hash. This function will update the address accordings to the currently processed node. This object may contain further algorithm specific information, like the position of this merkle tree in a hypertree. |
Definition at line 214 of file tree_hash.h.
References BOTAN_ASSERT_NOMSG, copy_mem(), Botan::BufferSlicer::empty(), Botan::detail::Strong_Base< T >::get(), Botan::StrongSpan< T >::size(), and Botan::BufferSlicer::take().
|
constexpr |
Concatenate an arbitrary number of buffers. Performs range-checks as needed.
The output type can be auto-detected based on the input ranges, or explicitly specified by the caller. If all input ranges have a static extent, the total size is calculated at compile time and a statically sized std::array<> is used. Otherwise this tries to use the type of the first input range as output type.
Alternatively, the output container type can be specified explicitly.
Definition at line 263 of file stl_util.h.
References Botan::detail::concatenate().
Referenced by Botan::PKIX::check_ocsp(), Botan::Kyber_Expanded_Keypair_Codec::encode_keypair(), Botan::ML_KEM_Expanding_Keypair_Codec::encode_keypair(), Botan::SphincsPlus_PrivateKey::private_key_bits(), Botan::FrodoKEM_PrivateKey::raw_private_key_bits(), Botan::FrodoKEM_PublicKey::raw_public_key_bits(), Botan::TLS::Hybrid_KEM_PublicKey::raw_public_key_bits(), Botan::XMSS_PublicKey::raw_public_key_bits(), Botan::HSS_LMS_PublicKeyInternal::to_bytes(), and Botan::LMS_PublicKey::to_bytes().
|
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_ed448_get_privkey(), botan_privkey_x25519_get_privkey(), botan_privkey_x448_get_privkey(), botan_pubkey_ed25519_get_pubkey(), botan_pubkey_ed448_get_pubkey(), botan_pubkey_x25519_get_pubkey(), botan_pubkey_x448_get_pubkey(), Botan_FFI::botan_view_bin_bounce_fn(), buffer_insert(), buffer_insert(), Botan::Ed25519_PublicKey::check_key(), Botan::CRYSTALS::Polynomial< Trait, D >::clone(), Botan::CRYSTALS::PolynomialVector< Trait, D >::clone(), commoncrypto_adjust_key_size(), Botan::Streebog::compress_64(), compute_root(), compute_root(), Botan::TPM2::copy_into(), Botan::TPM2::copy_into(), Botan::Sodium::crypto_auth_hmacsha512256(), Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_seed_keypair(), curve25519_donna(), ed25519_gen_keypair(), Botan::Ed448_PublicKey::Ed448_PublicKey(), Botan::ML_KEM_Encryptor::encapsulate(), 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::Gf448Elem::Gf448Elem(), Botan::GHASH::ghash_update(), hkdf_expand_label(), Botan::HKDF_Expand::kdf(), Botan::HKDF_Extract::kdf(), Botan::KDF1::kdf(), Botan::KDF1_18033::kdf(), Botan::KDF2::kdf(), Botan::SP800_108_Counter::kdf(), Botan::SP800_108_Feedback::kdf(), Botan::SP800_108_Pipeline::kdf(), Botan::X942_PRF::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::PseudorandomKeyGeneration::PseudorandomKeyGeneration(), Botan::DataSource_Memory::read(), Botan::Blowfish::salted_set_key(), Botan::Scalar448::Scalar448(), Botan::CTR_BE::seek(), Botan::EC_AffinePoint_Data_PC::serialize_uncompressed_to(), Botan::EC_AffinePoint_Data_BN::serialize_x_to(), Botan::EC_AffinePoint_Data_PC::serialize_x_to(), Botan::EC_AffinePoint_Data_BN::serialize_xy_to(), Botan::EC_AffinePoint_Data_PC::serialize_xy_to(), Botan::EC_AffinePoint_Data_BN::serialize_y_to(), Botan::EC_AffinePoint_Data_PC::serialize_y_to(), Botan::TLS::Session_Keys::Session_Keys(), Botan::CFB_Mode::shift_register(), Botan::HSS_LMS_PrivateKeyInternal::sign(), Botan::RTSS_Share::split(), Botan::polyn_gf2m::sqmod_init(), Botan::Montgomery_Params::square_this(), treehash(), treehash(), Botan::Base64_Decoder::write(), Botan::Base64_Encoder::write(), Botan::Buffered_Filter::write(), Botan::Hex_Decoder::write(), Botan::Hex_Encoder::write(), Botan_FFI::write_output(), and Botan::X448_PublicKey::X448_PublicKey().
|
inline |
Partially copy a subset of in
into out
using big-endian byte order.
Definition at line 801 of file loadstor.h.
References Botan::detail::copy_out_any_word_aligned_portion(), get_byte_var(), and T.
|
inline |
Partially copy a subset of in
into out
using little-endian byte order.
Definition at line 817 of file loadstor.h.
References Botan::detail::copy_out_any_word_aligned_portion(), get_byte_var(), and T.
Referenced by Botan::BLAKE2b::final_result(), and xts_update_tweak_block().
|
consteval |
Return 2**B - C
Definition at line 1101 of file mp_core.h.
Referenced by redc_crandall().
|
inline |
Definition at line 25 of file frodo_aes_generator.h.
References Botan::BufferStuffer::append(), Botan::Block_Cipher_Fixed_Params< 16, 16 >::BLOCK_SIZE, BOTAN_ASSERT_NOMSG, BOTAN_DEBUG_ASSERT, clear_mem(), Botan::BufferStuffer::full(), Botan::FrodoKEMMode::is_aes(), Botan::FrodoKEMConstants::mode(), Botan::FrodoKEMConstants::n(), Botan::BufferStuffer::next(), Botan::BufferStuffer::remaining_capacity(), 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 425 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 397 of file pk_keys.h.
References create_hex_fingerprint().
BOTAN_TEST_API std::array< uint8_t, ED448_LEN > Botan::create_pk_from_sk | ( | std::span< const uint8_t, ED448_LEN > | sk | ) |
Create a public key point from a secret key (RFC 8032 5.2.5)
Definition at line 224 of file ed448_internal.cpp.
References Botan::Ed448Point::base_point().
Referenced by Botan::Ed448_PrivateKey::Ed448_PrivateKey(), and Botan::Ed448_PrivateKey::Ed448_PrivateKey().
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 470 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::EC_Group::from_name(), Botan::KyberMode::Kyber1024_R3, Botan::DilithiumMode::ML_DSA_6x5, Botan::KyberMode::ML_KEM_768, 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 Botan::BigInt::_data(), b, bigint_sub3(), Botan::BigInt::bits(), Botan::BigInt::conditionally_set_bit(), Botan::BigInt::ct_cond_swap(), 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 b, Botan::BigInt::bits(), Botan::BigInt::conditionally_set_bit(), Botan::CT::Mask< T >::expand_top_bit(), 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.
References expand_top_bit().
Referenced by ctz(), Botan::CT::Choice::from_int(), Botan::CT::Mask< T >::is_zero(), 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 Botan::BigInt::_data(), b, bigint_sub3(), Botan::BigInt::bits(), Botan::BigInt::conditionally_set_bit(), Botan::BigInt::ct_cond_swap(), 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(), and var_ctz32().
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 19 of file x25519.cpp.
References curve25519_donna().
Referenced by Botan::X25519_PrivateKey::check_key(), Botan::Sodium::crypto_scalarmult_curve25519_base(), Botan::X25519_PrivateKey::X25519_PrivateKey(), Botan::X25519_PrivateKey::X25519_PrivateKey(), and Botan::X25519_PrivateKey::X25519_PrivateKey().
void Botan::curve25519_donna | ( | uint8_t | mypublic[32], |
const uint8_t | secret[32], | ||
const uint8_t | basepoint[32] ) |
Definition at line 454 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 47 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().
BOTAN_TEST_API Point448 Botan::decode_point | ( | std::span< const uint8_t > | p_bytes | ) |
Decode a point from a byte array. RFC 7748 Section 5 (decodeUCoordinate)
Definition at line 25 of file x448_internal.cpp.
References BOTAN_ARG_CHECK, typecast_copy(), and X448_LEN.
BOTAN_TEST_API ScalarX448 Botan::decode_scalar | ( | std::span< const uint8_t > | scalar_bytes | ) |
Decode a scalar from a byte array. RFC 7748 Section 5 (decodeScalar448)
Definition at line 30 of file x448_internal.cpp.
References BOTAN_ARG_CHECK, typecast_copy(), and X448_LEN.
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 51 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 46 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(), load_le(), 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.
BOTAN_TEST_API secure_vector< uint8_t > Botan::encode_point | ( | const Point448 & | p | ) |
Encode a point to a 56 byte vector. RFC 7748 Section 5 (encodeUCoordinate)
Definition at line 21 of file x448_internal.cpp.
References Botan::detail::Strong_Adapter< T >::begin(), and Botan::detail::Strong_Adapter< T >::end().
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, |
std::span< uint8_t > | output, | ||
std::span< const uint8_t > | input, | ||
std::span< const uint8_t > | domain_sep ) |
XMD hash function from RFC 9380
This is only used internally to implement hash2curve so is not exposed to end users.
Definition at line 16 of file xmd.cpp.
References copy_mem(), Botan::HashFunction::create_or_throw(), and fmt().
Referenced by expand_message_xmd().
|
inline |
Definition at line 27 of file xmd.h.
References expand_message_xmd().
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 ct_is_zero(), and Botan::CT::Mask< T >::expand_top_bit().
|
consteval |
Run the extended Euclidean algorithm to find the greatest common divisor of a and b and the Bézout coefficients, u and v.
Definition at line 69 of file pqcrystals_helpers.h.
Referenced by modular_inverse().
|
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(), and b.
Referenced by ge_frombytes_negate_vartime().
|
inline |
Definition at line 150 of file ed25519_fe.h.
References b, and 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 b, and 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 b, and Botan::FE_25519::sub().
Referenced by ge_frombytes_negate_vartime().
|
inline |
Definition at line 154 of file ed25519_fe.h.
References b, and 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::AlternativeName::add_attribute(), Botan::GOST_3410_PublicKey::algo_name(), Botan::TLS::KEX_to_KEM_Adapter_PublicKey::algo_name(), Botan::AlternativeName::AlternativeName(), argon2_generate_pwhash(), assert_unreachable(), Botan::TLS::auth_method_from_string(), Botan::CFB_Mode::CFB_Mode(), Botan::TPM2::cipher_tss2_to_botan(), Botan::CMAC::CMAC(), Botan::AES_256_CTR_XOF::copy_state(), Botan::KDF::create(), Botan::TPM2::PrivateKey::create(), Botan::TPM2::PublicKey::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::Cert_Extension::TNAuthList::Entry::decode_from(), Botan::DL_Group::DL_Group(), Botan::DL_Group::DL_Group(), Botan::EC_Group::EC_Group(), Botan::PEM_Code::encode(), expand_message_xmd(), Botan::Stream_Decompression::finish(), Botan::PSS_Params::from_emsa_name(), Botan::EC_Group::from_name(), Botan::EC_Group::from_OID(), Botan::OID::from_string(), generate_dsa_primes(), Botan::EC_PublicKey::get_int_field(), Botan::TPM2::get_raw_rc(), 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::HSS_LMS_Params::HSS_LMS_Params(), 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::BLAKE2b::name(), Botan::BLAKE2s::name(), Botan::Cascade_Cipher::name(), Botan::CBC_Mode::name(), Botan::CCM_Mode::name(), Botan::CFB_Mode::name(), Botan::ChaCha::name(), Botan::CMAC::name(), Botan::Comb4P::name(), Botan::CTR_BE::name(), Botan::DilithiumMessageHash::name(), Botan::FPE_FE1::name(), Botan::GCM_Mode::name(), Botan::GeneralName::name(), Botan::GMAC::name(), Botan::HKDF::name(), Botan::HKDF_Expand::name(), Botan::HKDF_Extract::name(), Botan::HMAC::name(), Botan::HMAC_DRBG::name(), Botan::KDF1::name(), Botan::KDF1_18033::name(), Botan::KDF2::name(), Botan::Keccak_1600::name(), Botan::KMAC128::name(), Botan::KMAC256::name(), Botan::Lion::name(), Botan::OFB::name(), Botan::PBKDF2_Family::name(), Botan::PKCS5_PBKDF2::name(), Botan::RFC4880_S2K_Family::name(), Botan::SHA_3::name(), Botan::SHAKE_128::name(), Botan::SHAKE_256::name(), Botan::SipHash::name(), Botan::Skein_512::name(), Botan::SP800_108_Counter::name(), Botan::SP800_108_Feedback::name(), Botan::SP800_108_Pipeline::name(), Botan::SP800_56C_One_Step_Hash::name(), Botan::SP800_56C_One_Step_HMAC::name(), Botan::SP800_56C_Two_Step::name(), Botan::Streebog::name(), Botan::TLS_12_PRF::name(), Botan::Truncated_Hash::name(), Botan::Asymmetric_Key::object_identifier(), 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(), throw_invalid_argument(), throw_invalid_state(), Botan::Argon2::to_string(), Botan::ASN1_Time::to_string(), Botan::Bcrypt_PBKDF::to_string(), Botan::PBKDF2::to_string(), Botan::RFC4880_S2K::to_string(), Botan::Scrypt::to_string(), Botan::TLS::Cipher_State::update_read_keys(), Botan::TLS::Cipher_State::update_write_keys(), 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 ) |
FIPS 205, Algorithm 17: fors_pkFromSig.
Reconstructs the FORS public key from a given FORS signature
and message
. This is tailored for the use case in the SLH-DSA implementation and is not meant for general usability.
Definition at line 129 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 ) |
FIPS 205, Algorithm 16: fors_sign (with simultaneous FORS pk generation)
Implements a domain specific wrapper for the few-times signature scheme FORS (Forest of Random Subsets). It is meant to be used inside SLH-DSA and does not aim to be applicable for other use cases.
Definition at line 63 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(), b, bigint_cmp(), bigint_shr2(), bigint_sub_abs(), BOTAN_DEBUG_ASSERT, Botan::BigInt::is_zero(), Botan::CT::poison_all(), Botan::BigInt::Positive, Botan::BigInt::sig_words(), Botan::CT::unpoison_all(), and Botan::BigInt::with_capacity().
Referenced by botan_mp_gcd(), 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.
References b.
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 315 of file stl_util.h.
Referenced by Botan::TLS::Channel_Impl_13::send_handshake_message(), and Botan::TLS::Channel_Impl_13::send_handshake_message().
|
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 329 of file stl_util.h.
References is_generalizable_to().
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
Takes the password
to hash, a rng
, and a work_factor
. The resulting password hash is returned as a string.
Higher work factors increase the amount of time the algorithm runs, increasing the cost of cracking attempts. The increase is exponential, so a work factor of 12 takes roughly twice as long as work factor 11. The default work factor was set to 10 up until the 2.8.0 release.
It is recommended to set the work factor as high as your system can tolerate (from a performance and latency perspective) since higher work factors greatly improve the security against GPU-based attacks. For example, for protecting high value administrator passwords, consider using work factor 15 or 16; at these work factors each bcrypt computation takes several seconds. Since admin logins will be relatively uncommon, it might be acceptable for each login attempt to take some time. As of 2018, a good password cracking rig (with 8 NVIDIA 1080 cards) can attempt about 1 billion bcrypt computations per month for work factor 13. For work factor 12, it can do twice as many. For work factor 15, it can do only one quarter as many attempts.
Due to bugs affecting various implementations of bcrypt, several different variants of the algorithm are defined. As of 2.7.0 Botan supports generating (or checking) the 2a, 2b, and 2y variants. Since Botan has never been affected by any of the bugs which necessitated these version upgrades, all three versions are identical beyond the version identifier. Which variant to use is controlled by the version
argument.
The bcrypt work_factor
must be at least 4 (though at this work factor bcrypt is not very secure). The bcrypt format allows up to 31, but Botan currently rejects all work factors greater than 18 since even that work factor requires roughly 15 seconds of computation on a fast machine.
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). |
TODO(Botan4) Convert work_factor to a size_t
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::_assign_from_bytes(), b, 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
Functions much like generate_bcrypt(). The last parameter, alg_id
, specifies which PRF to use. Currently defined values are:
The work_factor
must be greater than zero and less than 512. This performs 10000 * work_factor
PBKDF2 iterations, using 96 bits of salt taken from rng
. Using work factor of 10 or more is recommended.
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(), get_byte(), and Botan::RandomNumberGenerator::randomize().
|
inline |
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 52 of file rfc6979.h.
References Botan::BigInt::bits(), and Botan::RFC6979_Nonce_Generator::nonce_for().
BigInt Botan::generate_rsa_prime | ( | RandomNumberGenerator & | keygen_rng, |
RandomNumberGenerator & | prime_test_rng, | ||
size_t | bits, | ||
const BigInt & | coprime, | ||
size_t | prob = 128 ) |
Generate a prime suitable for RSA p/q
keygen_rng | a random number generator |
prime_test_rng | a random number generator |
bits | how large the resulting prime should be in bits (must be >= 512) |
coprime | a positive integer that (prime - 1) should be coprime to |
prob | use test so false positive is bounded by 1/2**prob |
Definition at line 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 140 of file aead.h.
References Botan::AEAD_Mode::create(), and name.
|
inlineconstexpr |
Byte extraction
input | the value to extract from |
Definition at line 75 of file loadstor.h.
References T.
Referenced by Botan::TLS::TLS_CBC_HMAC_AEAD_Mode::assoc_data_with_len(), Botan::polyn_gf2m::encode(), Botan::detail::fallback_store_any(), Botan::TLS::Connection_Cipher_State::format_ad(), generate_passhash9(), hex_encode(), hkdf_expand_label(), Botan::TLS::Channel_Impl_12::key_material_export(), Botan::McEliece_PrivateKey::private_key_bits(), Botan::TLS::Application_Layer_Protocol_Notification::serialize(), Botan::TLS::Certificate_Verify::serialize(), Botan::TLS::Cookie::serialize(), Botan::TLS::EarlyDataIndication::serialize(), Botan::TLS::Extensions::serialize(), Botan::TLS::PSK::serialize(), Botan::TLS::Record_Size_Limit::serialize(), Botan::TLS::Server_Hello::serialize(), Botan::TLS::Server_Name_Indicator::serialize(), Botan::TLS::SRTP_Protection_Profiles::serialize(), Botan::TLS::Supported_Groups::serialize(), Botan::TLS::Server_Key_Exchange::Server_Key_Exchange(), Botan::CCM_Mode::set_associated_data_n(), Botan::TLS::TLS_CBC_HMAC_AEAD_Encryption::set_associated_data_n(), and Botan::RTSS_Share::split().
Byte extraction
byte_num | which byte to extract, 0 == highest byte |
input | the value to extract from |
Definition at line 65 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 285 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 243 of file pbkdf.h.
|
inline |
|
constexpr |
Definition at line 33 of file pcurves_solinas.h.
Referenced by redc_p192(), redc_p224(), redc_p256(), and redc_p384().
Definition at line 53 of file simd_avx2_gfni.h.
Definition at line 59 of file simd_avx2_gfni.h.
|
consteval |
Definition at line 19 of file simd_avx2_gfni.h.
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.
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 149 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 132 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 158 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 117 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 73 of file hex.cpp.
References clear_mem(), fmt(), format_char_for_display(), and out_ptr().
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 128 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 136 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 145 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 35 of file hex.cpp.
References get_byte().
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().
|
constexpr |
Definition at line 890 of file mp_core.h.
References shift_left().
Referenced by redc_p192(), redc_p224(), redc_p256(), redc_p384(), and redc_p521().
|
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(), get_byte(), and Botan::HKDF_Expand::kdf().
|
constexprnoexcept |
Definition at line 293 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 252 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 ) |
FIPS 205, Algorithm 12: ht_sign.
Creates a SLH-DSA 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_address(), Botan::Sphincs_Address::set_layer_address(), Botan::Sphincs_Address::set_tree_address(), 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 ) |
FIPS 205, Algorithm 13: ht_verify.
Given a message signed_msg
the SLH-DSA 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_address(), Botan::Sphincs_Address::set_layer_address(), Botan::Sphincs_Address::set_tree_address(), 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 35 of file workfactor.cpp.
Referenced by dl_work_factor(), Botan::RSA_PublicKey::estimated_strength(), and Botan::TPM_PrivateKey::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().
|
constexpr |
Definition at line 114 of file assert.h.
References ignore_param().
|
constexpr |
Return the index of the first byte with the high bit set
Definition at line 130 of file int_utils.h.
References T.
void BOTAN_UNSTABLE_API Botan::initialize_allocator | ( | ) |
Ensure the allocator is initialized
Definition at line 63 of file allocator.cpp.
References Botan::mlock_allocator::instance().
Referenced by Botan::Allocator_Initializer::Allocator_Initializer().
|
inline |
Definition at line 71 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 179 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::EC_Group_Data::inverse_mod_order(), 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_TEST_API 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 225 of file parsing.cpp.
References store_be().
Referenced by Botan::AlternativeName::contents(), Botan::AlternativeName::get_attribute(), and Botan::GeneralName::name().
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 Botan::EC_Group::EC_Group(), is_bailie_psw_probable_prime(), and is_prime().
|
constexprnoexcept |
Definition at line 298 of file stl_util.h.
Referenced by generalize_to().
|
constexprnoexcept |
Definition at line 303 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 321 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
This uses probabilistic algorithms - there is some non-zero (but very low) probability that this function will return true even if n is actually composite.
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 355 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::DL_Group::verify_group(), and Botan::EC_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.
|
inline |
Definition at line 31 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 270 of file numthry.cpp.
References b, ct_divide(), gcd(), and Botan::BigInt::Positive.
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().
BOTAN_TEST_API LMOTS_K Botan::lmots_compute_pubkey_from_sig | ( | const LMOTS_Signature & | sig, |
const LMS_Message & | msg, | ||
const LMS_Identifier & | identifier, | ||
LMS_Tree_Node_Idx | q ) |
Compute a public key candidate for an OTS-signature-message pair and the OTS instance parameters.
Defined in RFC 8554 4.6 - Algorithm 4b
Definition at line 327 of file lm_ots.cpp.
References Botan::LMOTS_Signature::algorithm_type(), Botan::LMOTS_Signature::C(), Botan::LMOTS_Params::create_or_throw(), store_be(), and Botan::LMOTS_Signature::y().
|
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.
References load_le().
Referenced by Botan::FE_25519::from_bytes(), sc_muladd(), and sc_reduce().
|
inlineconstexpr |
Load "something" in big endian byte order See the documentation of this file for more details.
Definition at line 530 of file loadstor.h.
References Botan::detail::load_any().
Referenced by Botan::TLS::Datagram_Handshake_IO::add_record(), base58_check_decode(), check_passhash9(), Botan::SHA_256::compress_digest(), Botan::SHA_512::compress_digest(), Botan::SHA_512::compress_digest_bmi2(), Botan::SHA_256::compress_digest_x86_bmi2(), Botan::SHA_1::compress_n(), Botan::SM3::compress_n(), Botan::Whirlpool::compress_n(), Botan::AlternativeName::decode_from(), Botan::GeneralName::decode_from(), Botan::TLS::Session::decrypt(), Botan::CryptoBox::decrypt_bin(), Botan::Blowfish::decrypt_n(), Botan::CAST_128::decrypt_n(), Botan::DES::decrypt_n(), Botan::Noekeon::decrypt_n(), Botan::SEED::decrypt_n(), Botan::SHACAL2::decrypt_n(), Botan::SM4::decrypt_n(), Botan::TripleDES::decrypt_n(), Botan::Blowfish::encrypt_n(), Botan::CAST_128::encrypt_n(), Botan::DES::encrypt_n(), Botan::Noekeon::encrypt_n(), Botan::SEED::encrypt_n(), Botan::SHACAL2::encrypt_n(), Botan::SM4::encrypt_n(), Botan::TripleDES::encrypt_n(), Botan::HSS_LMS_PrivateKeyInternal::from_bytes_or_throw(), Botan::HSS_LMS_PublicKeyInternal::from_bytes_or_throw(), Botan::HSS_Signature::from_bytes_or_throw(), Botan::LMOTS_Signature::from_bytes_or_throw(), Botan::LMS_PublicKey::from_bytes_or_throw(), Botan::LMS_Signature::from_bytes_or_throw(), Botan::HOTP::generate_hotp(), Botan::TLS::TLS_Data_Reader::get_elem(), Botan::SIMD_4x32::load_be(), nist_key_unwrap(), nist_key_unwrap_padded(), Botan::TLS::Server_Hello_12::random_signals_downgrade(), Botan::TLS::Server_Hello_13::random_signals_downgrade(), Botan::CTR_BE::seek(), ucs2_to_utf8(), and ucs4_to_utf8().
|
inlineconstexpr |
Load "something" in little endian byte order See the documentation of this file for more details.
Definition at line 521 of file loadstor.h.
References Botan::detail::load_any().
Referenced by Botan::Keccak_Permutation::absorb(), Botan::SIMD_16x32::BOTAN_FUNC_ISA(), Botan::SIMD_8x32::BOTAN_FUNC_ISA(), Botan::Gf448Elem::bytes_are_canonical_representation(), Botan::MD4::compress_n(), Botan::MD5::compress_n(), Botan::RIPEMD_160::compress_n(), Botan::Sodium::crypto_core_hsalsa20(), Botan::GOST_28147_89::decrypt_n(), Botan::Kuznyechik::decrypt_n(), Botan::Serpent::decrypt_n(), Botan::Threefish_512::decrypt_n(), Botan::Twofish::decrypt_n(), Botan::FrodoMatrix::deserialize(), ed25519_verify(), Botan::GOST_28147_89::encrypt_n(), Botan::Kuznyechik::encrypt_n(), Botan::Serpent::encrypt_n(), Botan::Threefish_512::encrypt_n(), Botan::Twofish::encrypt_n(), Botan::Dilithium_Algos::expand_A(), Botan::Gf448Elem::Gf448Elem(), load_4(), Botan::SIMD_4x32::load_le(), Botan::Kyber_Algos::load_le3(), Botan::FrodoMatrix::mul_add_as_plus_e(), Botan::FrodoMatrix::mul_add_sa_plus_e(), random_prime(), Botan::FrodoMatrix::sample(), Botan::Dilithium_Algos::sample_in_ball(), Botan::ChaCha::seek(), Botan::Salsa20::seek(), Botan::Salsa20::set_iv_bytes(), Botan::Threefish_512::set_tweak(), Botan::Sodium::sodium_free(), Botan::CRYSTALS::unpack(), and xts_update_tweak_block().
std::unique_ptr< Private_Key > Botan::load_private_key | ( | const AlgorithmIdentifier & | alg_id, |
std::span< const uint8_t > | key_bits ) |
Definition at line 272 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 119 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::TPM2::PrivateKey::raw_private_key_bits(), 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 199 of file bit_ops.h.
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 153 of file compression.h.
References Botan::Compression_Algorithm::create().
|
inline |
Definition at line 159 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 88 of file loadstor.h.
Referenced by Botan::TLS::Certificate_Request_12::Certificate_Request_12(), Botan::TLS::TLS_Data_Reader::get_uint16_t(), Botan::Kyber_Modern_Symmetric_Primitives::get_XOF(), Botan::ML_KEM_Symmetric_Primitives::get_XOF(), 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 100 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 117 of file loadstor.h.
Definition at line 70 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 90 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().
Referenced by mgf1_mask().
|
inline |
Definition at line 28 of file mgf1.h.
References mgf1_mask().
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().
|
consteval |
Calculate the modular multiplacative inverse of q modulo m. By default, this assumes m to be 2^bitlength of T for application in a Montgomery reduction.
Definition at line 94 of file pqcrystals_helpers.h.
References extended_euclidean_algorithm(), and T.
Definition at line 44 of file pqcrystals_helpers.h.
References T.
Referenced by montgomery_R2().
Definition at line 52 of file pqcrystals_helpers.h.
References montgomery_R().
BigInt Botan::monty_execute | ( | const Montgomery_Exponentation_State & | precomputed_state, |
const BigInt & | k, | ||
size_t | max_k_bits ) |
Definition at line 151 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 155 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().
|
inlineconstexpr |
Definition at line 832 of file mp_core.h.
References b.
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 159 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 146 of file monty_exp.cpp.
References monty_precompute().
Referenced by monty_exp(), monty_exp_vartime(), monty_precompute(), and passes_miller_rabin_test().
|
inlineconstexpr |
Perform a 64x64->128 bit multiplication
Definition at line 23 of file mul128.h.
References b.
Referenced by operator*().
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 30 of file point_mul.cpp.
References Botan::EC_Point_Multi_Point_Precompute::multi_exp().
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(), Botan::BlockCipher::decrypt(), and load_be().
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(), Botan::BlockCipher::decrypt(), and load_be().
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().
BOTAN_FUZZER_API CT::Option< size_t > Botan::oaep_find_delim | ( | std::span< const uint8_t > | input, |
std::span< const uint8_t > | phash ) |
Definition at line 102 of file oaep.cpp.
References Botan::CT::Mask< T >::as_choice(), Botan::CT::Mask< T >::cleared(), Botan::CT::Mask< T >::is_equal(), Botan::CT::is_not_equal(), Botan::CT::Mask< T >::is_zero(), and Botan::CT::Mask< T >::set().
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 641 of file ec_group.h.
bool Botan::operator!= | ( | const OctetString & | x, |
const OctetString & | y ) |
Compare two strings
x | an octet string |
y | an octet string |
Definition at line 92 of file symkey.cpp.
|
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 681 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 400 of file strong_type.h.
References b, Botan::detail::Strong_Base< T >::get(), and T.
|
constexpr |
Definition at line 395 of file strong_type.h.
References b, and Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 389 of file strong_type.h.
References b.
|
constexpr |
Definition at line 528 of file strong_type.h.
References b, and Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 522 of file strong_type.h.
References b, and Botan::detail::Strong_Base< T >::get().
Definition at line 46 of file big_ops3.cpp.
References Botan::BigInt::_data(), bigint_linmul3(), bigint_mul(), Botan::BigInt::cond_flip_sign(), 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 Botan::BigInt::_data(), bigint_linmul3(), Botan::BigInt::mutable_data(), Botan::BigInt::set_sign(), Botan::BigInt::sig_words(), Botan::BigInt::sign(), and Botan::BigInt::with_capacity().
|
inlineconstexpr |
Definition at line 100 of file donna128.h.
References BOTAN_ARG_CHECK, Botan::donna128::hi(), Botan::donna128::lo(), and mul64x64_128().
Definition at line 416 of file ec_point.h.
References Botan::EC_Point::mul().
Ed448Point Botan::operator* | ( | const Scalar448 & | lhs, |
const Ed448Point & | rhs ) |
Syntax sugar for scalar multiplication.
Definition at line 220 of file ed448_internal.cpp.
References Botan::Ed448Point::scalar_mul().
|
constexpr |
Definition at line 349 of file strong_type.h.
References b, Botan::detail::Strong_Base< T >::get(), and T.
|
constexpr |
Definition at line 344 of file strong_type.h.
References b, and Botan::detail::Strong_Base< T >::get().
|
inlineconstexpr |
Definition at line 109 of file donna128.h.
|
constexpr |
Definition at line 338 of file strong_type.h.
References b.
|
constexpr |
Definition at line 489 of file strong_type.h.
References b, and Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 483 of file strong_type.h.
References b, and Botan::detail::Strong_Base< T >::get().
Definition at line 1082 of file bigint.h.
References Botan::BigInt::_data(), Botan::BigInt::add2(), Botan::BigInt::sig_words(), and Botan::BigInt::sign().
Definition at line 1086 of file bigint.h.
References Botan::BigInt::add2(), and Botan::BigInt::Positive.
Definition at line 113 of file donna128.h.
Definition at line 119 of file donna128.h.
Definition at line 406 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 315 of file strong_type.h.
References b, Botan::detail::Strong_Base< T >::get(), and T.
|
constexpr |
Definition at line 310 of file strong_type.h.
References b, and Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 304 of file strong_type.h.
References b.
|
constexpr |
Definition at line 580 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 573 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
Referenced by generate_dsa_primes().
|
constexpr |
Definition at line 463 of file strong_type.h.
References b, and Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 457 of file strong_type.h.
References b, and Botan::detail::Strong_Base< T >::get().
Definition at line 1094 of file bigint.h.
References Botan::BigInt::_data(), Botan::BigInt::add2(), Botan::BigInt::reverse_sign(), and Botan::BigInt::sig_words().
Definition at line 1098 of file bigint.h.
References Botan::BigInt::add2(), and Botan::BigInt::Negative.
Definition at line 411 of file ec_point.h.
|
constexpr |
Definition at line 332 of file strong_type.h.
References b, Botan::detail::Strong_Base< T >::get(), and T.
|
constexpr |
Definition at line 327 of file strong_type.h.
References b, and Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 321 of file strong_type.h.
References b.
|
constexpr |
Definition at line 593 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 586 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 476 of file strong_type.h.
References b, and Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 470 of file strong_type.h.
References b, and 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 366 of file strong_type.h.
References b, Botan::detail::Strong_Base< T >::get(), and T.
|
constexpr |
Definition at line 361 of file strong_type.h.
References b, and Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 355 of file strong_type.h.
References b.
|
constexpr |
Definition at line 502 of file strong_type.h.
References b, and Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 496 of file strong_type.h.
References b, and Botan::detail::Strong_Base< T >::get().
Definition at line 276 of file asn1_time.cpp.
References Botan::ASN1_Time::cmp().
Definition at line 1135 of file bigint.h.
References b, and Botan::BigInt::is_less_than().
|
inline |
Definition at line 1159 of file bigint.h.
References b, and Botan::BigInt::cmp_word().
Compare two OIDs.
Definition at line 158 of file asn1_oid.cpp.
References b, and 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 Botan::BigInt::_data(), bigint_shl2(), BOTAN_MP_WORD_BITS, 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 260 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 284 of file name_constraint.cpp.
References Botan::GeneralSubtree::base().
Definition at line 266 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
inline |
Definition at line 322 of file asn1_obj.h.
References Botan::OID::to_string().
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 451 of file strong_type.h.
References b, Botan::detail::Strong_Base< T >::get(), and T.
|
constexpr |
Definition at line 446 of file strong_type.h.
References b, and Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 440 of file strong_type.h.
References b.
|
constexpr |
Definition at line 567 of file strong_type.h.
References b, and Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 561 of file strong_type.h.
References b, and Botan::detail::Strong_Base< T >::get().
Definition at line 268 of file asn1_time.cpp.
References Botan::ASN1_Time::cmp().
Definition at line 1127 of file bigint.h.
References b, and Botan::BigInt::cmp().
|
inline |
Definition at line 1151 of file bigint.h.
References b, and Botan::BigInt::cmp_word().
Definition at line 278 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
auto Botan::operator<=> | ( | Strong< T1, Tags... > | a, |
T2 | b ) |
Definition at line 288 of file strong_type.h.
References b, and Botan::detail::Strong_Base< T >::get().
auto Botan::operator<=> | ( | T1 | a, |
Strong< T2, Tags... > | b ) |
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 1119 of file bigint.h.
References b, and Botan::BigInt::is_equal().
|
inline |
Definition at line 1143 of file bigint.h.
References b, and 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 272 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 298 of file strong_type.h.
References b, and Botan::detail::Strong_Base< T >::get().
auto Botan::operator== | ( | T1 | a, |
Strong< T2, Tags... > | b ) |
Definition at line 280 of file asn1_time.cpp.
References Botan::ASN1_Time::cmp().
|
inline |
Definition at line 1163 of file bigint.h.
References b, and Botan::BigInt::cmp_word().
Definition at line 272 of file asn1_time.cpp.
References Botan::ASN1_Time::cmp().
Definition at line 1131 of file bigint.h.
References b, and Botan::BigInt::cmp().
|
inline |
Definition at line 1155 of file bigint.h.
References b, and Botan::BigInt::cmp_word().
Definition at line 187 of file big_ops3.cpp.
References Botan::BigInt::_data(), bigint_shr2(), BOTAN_MP_WORD_BITS, 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 42 of file big_io.cpp.
|
constexpr |
Definition at line 434 of file strong_type.h.
References b, Botan::detail::Strong_Base< T >::get(), and T.
|
constexpr |
Definition at line 429 of file strong_type.h.
References b, and Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 423 of file strong_type.h.
References b.
|
constexpr |
Definition at line 554 of file strong_type.h.
References b, and Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 548 of file strong_type.h.
References b, and 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 383 of file strong_type.h.
References b, Botan::detail::Strong_Base< T >::get(), and T.
|
constexpr |
Definition at line 378 of file strong_type.h.
References b, and Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 372 of file strong_type.h.
References b.
std::vector< uint8_t, Alloc > & Botan::operator^= | ( | std::vector< uint8_t, Alloc > & | out, |
const std::vector< uint8_t, Alloc2 > & | in ) |
|
constexpr |
Definition at line 515 of file strong_type.h.
References b, and Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 509 of file strong_type.h.
References b, and Botan::detail::Strong_Base< T >::get().
|
inline |
Definition at line 79 of file asn1_obj.h.
|
inline |
Definition at line 87 of file asn1_obj.h.
|
inline |
Definition at line 83 of file asn1_obj.h.
Definition at line 75 of file asn1_obj.h.
Definition at line 125 of file donna128.h.
References Botan::donna128::hi(), and Botan::donna128::lo().
Definition at line 129 of file donna128.h.
References Botan::donna128::hi(), and Botan::donna128::lo().
|
inline |
|
constexpr |
Definition at line 417 of file strong_type.h.
References b, Botan::detail::Strong_Base< T >::get(), and T.
|
constexpr |
Definition at line 412 of file strong_type.h.
References b, and Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 406 of file strong_type.h.
References b.
|
constexpr |
Definition at line 541 of file strong_type.h.
References b, and Botan::detail::Strong_Base< T >::get().
|
constexpr |
Definition at line 535 of file strong_type.h.
References b, and Botan::detail::Strong_Base< T >::get().
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 665 of file ec_point.cpp.
References Botan::BigInt::decode().
Perform point decoding Use EC_Group::OS2ECP instead
Definition at line 648 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 Botan::EC_AffinePoint_Data_BN::EC_AffinePoint_Data_BN(), OS2ECP(), OS2ECP(), and Botan::EC_Group_Data::point_deserialize().
EC_Point BOTAN_UNSTABLE_API Botan::OS2ECP | ( | std::span< const uint8_t > | data, |
const CurveGFp & | curve ) |
Definition at line 706 of file ec_point.cpp.
References OS2ECP().
|
nodiscardconstexprnoexcept |
Definition at line 447 of file stl_util.h.
References T.
Definition at line 420 of file stl_util.h.
References T.
Referenced by Botan::TPM2::Object::_public_info(), base_decode(), Botan::TPM2::PrivateKey::create_transient_from_template(), Botan::TPM2::HashFunction::final_with_ticket(), hex_decode(), Botan::TPM2::Signature_Operation::sign(), Botan::TLS::Extensions::take(), and Botan::TPM2::Session::tpm_nonce().
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 280 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 242 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 271 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 253 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 81 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 100 of file poly_dbl.cpp.
Referenced by Botan::XTS_Mode::update_tweak(), and xts_update_tweak_block().
|
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 284 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 395 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 695 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.
Referenced by Botan::BlockCipher::providers(), Botan::HashFunction::providers(), Botan::KDF::providers(), Botan::MessageAuthenticationCode::providers(), Botan::PasswordHashFamily::providers(), Botan::PBKDF::providers(), Botan::StreamCipher::providers(), and Botan::XOF::providers().
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 b, 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 b, 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(), load_le(), 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().
|
constexpr |
Reduce z modulo p = 2**B - C where C is small
z is assumed to be at most (p-1)**2
For details on the algorithm see
Definition at line 1122 of file mp_core.h.
References bigint_add2_nc(), bigint_monty_maybe_sub(), carry(), crandall_p(), word_madd2(), and word_madd3().
|
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 102 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, get_uint32(), Botan::BigInt::grow_to(), hex_to_words(), 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 191 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, get_uint32(), Botan::BigInt::grow_to(), hex_to_words(), 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 286 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, get_uint32(), Botan::BigInt::grow_to(), hex_to_words(), 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 401 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, get_uint32(), Botan::BigInt::grow_to(), hex_to_words(), 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 Botan::BigInt::_data(), bigint_add3_nc(), bigint_cnd_sub(), bigint_shr2(), BOTAN_ASSERT_EQUAL, BOTAN_DEBUG_ASSERT, BOTAN_MP_WORD_BITS, carry(), clear_mem(), Botan::CT::Mask< T >::expand(), Botan::BigInt::grow_to(), hex_to_words(), Botan::CT::Mask< T >::is_equal(), Botan::BigInt::is_positive(), Botan::BigInt::mask_bits(), 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_PrivateKey::check_key(), Botan::TLS::Hybrid_KEM_PublicKey::check_key(), Botan::TLS::Hybrid_KEM_PublicKey::load_for_group(), Botan::Modular_Reducer::multiply(), Botan::TLS::Hybrid_KEM_PublicKey::raw_public_key_bits(), and Botan::Modular_Reducer::square().
|
inlineconstexpr |
Swap the byte order of an unsigned integer
Definition at line 24 of file bswap.h.
References reverse_bytes(), and T.
Referenced by Botan::detail::load_any(), reverse_bytes(), and Botan::detail::store_any().
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().
SHA-2 Sigma style function
Definition at line 51 of file rotate.h.
References rotr().
Referenced by Botan::Dilithium_Algos::decode_public_key(), Botan::Dilithium_Algos::encode_public_key(), Botan::Dilithium_Algos::expand_A(), Botan::Dilithium_Algos::expand_keypair(), Botan::Kyber_Algos::expand_keypair(), Botan::Dilithium_Symmetric_Primitives_Base::H(), SHA2_32_F(), and SHA2_64_F().
Compute the root of elem
in the field.
The root of a in GF(p) is computed as r = a^((p+1)/4) mod p. Note that the root is not unique, i.e. r and p-r are both roots.
Definition at line 354 of file curve448_gf.cpp.
References Botan::Gf448Elem::words().
Referenced by Botan::Ed448Point::decode(), Botan::Sphincs_Hash_Functions::H_msg(), Botan::XMSS_Hash::h_msg(), Botan::XMSS_Hash::h_msg_init(), Botan::SphincsPlus_PrivateKey::SphincsPlus_PrivateKey(), and xmss_gen_root().
|
inline |
Definition at line 310 of file simd_avx512.h.
Definition at line 289 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_16x32::BOTAN_FUNC_ISA(), Botan::SIMD_8x32::BOTAN_FUNC_ISA(), Botan::SHA_1::compress_n(), Botan::Noekeon::decrypt_n(), Botan::Threefish_F::e_round(), Botan::Noekeon::encrypt_n(), Botan::GOST_28147_89::GOST_28147_89(), Keccak_Permutation_round(), and Botan::Serpent_F::transform().
|
inline |
Definition at line 315 of file simd_avx512.h.
Definition at line 294 of file simd_avx2.h.
Bit rotation right by a compile-time constant amount
input | the input word |
Definition at line 33 of file rotate.h.
References T.
Referenced by Botan::SIMD_16x32::BOTAN_FUNC_ISA(), Botan::SIMD_16x32::BOTAN_FUNC_ISA(), Botan::SIMD_8x32::BOTAN_FUNC_ISA(), Botan::SIMD_8x32::BOTAN_FUNC_ISA(), Botan::Threefish_F::d_round(), Botan::Noekeon::decrypt_n(), Botan::Noekeon::encrypt_n(), Botan::Serpent_F::i_transform(), rho(), and sigma().
|
inlineconstexpr |
Integer rounding
Returns an integer z such that n <= z <= n + align_to and z % align_to == 0
n | an integer |
align_to | the alignment boundary |
Definition at line 25 of file rounding.h.
References BOTAN_ARG_CHECK.
Referenced by 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, like so:
It will return an empty string if the versions match, or otherwise an error message indicating the discrepancy. This only is useful in dynamic libraries, where it is possible to compile and run against different versions.
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 299 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.
References b.
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.
References b.
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.
References b.
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.
References b.
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.
References b.
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.
References b.
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.
References b.
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.
References b.
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.
References b.
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.
References b.
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.
References b.
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.
References b.
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.
References b.
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.
References b.
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.
References b.
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.
References b.
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 b, carry(), carry0(), 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 carry(), carry0(), 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 86 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 118 of file scrypt.h.
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 83 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(), majority(), rho(), and sigma().
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(), majority(), rho(), and sigma().
Referenced by Botan::SHA_512::compress_digest(), and Botan::SHA_512::compress_digest_bmi2().
|
inlineconstexpr |
Definition at line 861 of file mp_core.h.
References carry().
Referenced by hex_to_words().
|
inlineconstexpr |
|
inline |
Definition at line 321 of file simd_avx512.h.
Definition at line 300 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().
SHA-2 Sigma style function
Definition at line 43 of file rotate.h.
References rotr().
Referenced by Botan::Kyber_Algos::expand_keypair(), SHA2_32_F(), and SHA2_64_F().
BOTAN_TEST_API std::array< uint8_t, 114 > Botan::sign_message | ( | std::span< const uint8_t, ED448_LEN > | sk, |
std::span< const uint8_t, ED448_LEN > | pk, | ||
bool | f, | ||
std::span< const uint8_t > | context, | ||
std::span< const uint8_t > | msg ) |
Sign a message using a keypair (RFC 8032 5.2.6)
sk | the secret key |
pk | the public key |
f | the prehash flag (true iff using Ed448ph) |
context | the context string |
msg | the message to sign |
Definition at line 237 of file ed448_internal.cpp.
References Botan::BufferStuffer::append(), Botan::Ed448Point::base_point(), BOTAN_ASSERT, ED448_LEN, and Botan::BufferStuffer::full().
Referenced by Botan::PK_Signer::sign_message().
|
inlineconstexpr |
Return the number of significant bytes in n
n | an integer value |
Definition at line 80 of file bit_ops.h.
References b.
std::vector< uint8_t > Botan::sm2_compute_za | ( | HashFunction & | hash, |
std::string_view | user_id, | ||
const EC_Group & | group, | ||
const EC_Point & | point ) |
Definition at line 244 of file sm2.cpp.
References sm2_compute_za().
Referenced by botan_pubkey_sm2_compute_za(), and 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(), 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(), Botan::Ed448Point::decode(), Botan::Ed448Point::double_point(), Botan::Ed448Point::operator+(), Botan::PCurve::PrimeOrderCurveImpl< C >::scalar_square(), Botan::Modular_Reducer::square(), and x448().
Computes elem^2. Faster than operator*.
Definition at line 348 of file curve448_gf.cpp.
References Botan::Gf448Elem::words().
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(), 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(), Botan::DL_Group::power_g_p(), and Botan::BigInt::serialize().
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 "something" in big endian byte order See the documentation of this file for more details.
Definition at line 773 of file loadstor.h.
References Botan::detail::store_any().
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(), Botan::FPE_FE1::decrypt(), Botan::Blowfish::decrypt_n(), Botan::CAST_128::decrypt_n(), Botan::DES::decrypt_n(), Botan::Noekeon::decrypt_n(), Botan::SEED::decrypt_n(), Botan::SHACAL2::decrypt_n(), Botan::SM4::decrypt_n(), Botan::TripleDES::decrypt_n(), Botan::AlternativeName::encode_into(), Botan::CryptoBox::encrypt(), Botan::FPE_FE1::encrypt(), Botan::TLS::Session::encrypt(), Botan::Blowfish::encrypt_n(), Botan::CAST_128::encrypt_n(), Botan::DES::encrypt_n(), Botan::Noekeon::encrypt_n(), Botan::SEED::encrypt_n(), Botan::SHACAL2::encrypt_n(), Botan::SM4::encrypt_n(), Botan::TripleDES::encrypt_n(), Botan::TLS::Connection_Cipher_State::format_ad(), Botan::Kyber_Modern_Symmetric_Primitives::get_PRF(), Botan::ML_KEM_Symmetric_Primitives::get_PRF(), Botan::Kyber_Modern_Symmetric_Primitives::get_XOF(), Botan::ML_KEM_Symmetric_Primitives::get_XOF(), ipv4_to_string(), Botan::SP800_108_Counter::kdf(), Botan::SP800_108_Feedback::kdf(), Botan::SP800_108_Pipeline::kdf(), lmots_compute_pubkey_from_sig(), Botan::LMOTS_Public_Key::LMOTS_Public_Key(), Botan::TLS::make_hello_random(), Botan::TPM2::Context::manufacturer(), Botan::TLS::Cipher_State::next_ticket_nonce(), nist_key_wrap(), nist_key_wrap_padded(), Botan::XMSS_PublicKey::raw_public_key_bits(), Botan::CTR_BE::seek(), Botan::TLS::New_Session_Ticket_12::serialize(), Botan::TLS::New_Session_Ticket_13::serialize(), Botan::PseudorandomKeyGeneration::set_i(), Botan::PseudorandomKeyGeneration::set_j(), Botan::PseudorandomKeyGeneration::set_q(), Botan::HSS_LMS_PrivateKeyInternal::sign(), Botan::LMOTS_Private_Key::sign(), Botan::LMS_PrivateKey::sign_and_get_pk(), Botan::SIMD_4x32::store_be(), Botan::HSS_LMS_PrivateKeyInternal::to_bytes(), Botan::HSS_LMS_PublicKeyInternal::to_bytes(), Botan::LMS_PublicKey::to_bytes(), Botan::Sphincs_Address::to_bytes(), Botan::Sphincs_Address::to_bytes_compressed(), Botan::Buffered_Computation::update_be(), Botan::Buffered_Computation::update_be(), Botan::Buffered_Computation::update_be(), and Botan::TPM2::Context::vendor().
|
inlineconstexpr |
Store "something" in little endian byte order See the documentation of this file for more details.
Definition at line 764 of file loadstor.h.
References Botan::detail::store_any().
Referenced by create_aes_row_generator(), create_shake_row_generator(), Botan::Sodium::crypto_core_hsalsa20(), 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::CRYSTALS::pack(), 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(), Botan::SIMD_4x32::store_le(), Botan::Gf448Elem::to_bytes(), Botan::Scalar448::to_bytes(), Botan::Buffered_Computation::update_le(), Botan::Buffered_Computation::update_le(), Botan::Buffered_Computation::update_le(), and Botan::ChaCha20Poly1305_Mode::update_len().
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().
std::optional< uint32_t > BOTAN_TEST_API 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 BOTAN_ASSERT_NOMSG.
Referenced by Botan::AlternativeName::add_attribute(), Botan::AlternativeName::AlternativeName(), Botan::NameConstraints::is_excluded(), Botan::NameConstraints::is_permitted(), Botan::GeneralName::matches(), and Botan::X509_Certificate::matches_dns_name().
SWAR (SIMD within a word) byte-by-byte comparison
This individually compares each byte of the provided words. It returns a mask which contains, for each byte, 0x80 if the byte in a
was less than the byte in b
. Otherwise the mask is 00.
This implementation assumes that the high bits of each byte in both lower
and upper
are clear! It is possible to support the full range of bytes, but this requires additional comparisons.
Definition at line 114 of file int_utils.h.
References T.
SWAR (SIMD within a word) byte-by-byte comparison
This individually compares each byte of the provided words. It returns a mask which contains, for each byte, 0xFF if the byte in a
was less than the byte in b
. Otherwise the mask is 00.
This implementation assumes that the high bits of each byte in both a
and b
are clear! It is possible to support the full range of bytes, but this requires additional comparisons.
Definition at line 91 of file int_utils.h.
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, TRUSTED_CERT_HAS_EXPIRED, TRUSTED_CERT_NOT_YET_VALID, 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(), 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().
Definition at line 414 of file stl_util.h.
std::string Botan::tolower_string | ( | std::string_view | in | ) |
Definition at line 241 of file parsing.cpp.
Referenced by Botan::AlternativeName::add_dns(), Botan::GeneralName::decode_from(), and 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 SLH-DSA 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 17 of file sp_treehash.cpp.
References BOTAN_ASSERT_NOMSG, copy_mem(), 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().
|
inline |
Treehash logic to build up a merkle hash tree.
Computes the root of the merkle tree. Can also output an authentication path necessary for a hash based signature.
Given the following tree: Layer: 2 7R / \ 1 3X 6A / \ / \ 0 1X 2A 4 5
The treehash logic traverses the tree (Post-order traversal), i.e., the nodes are discovered in order 1,2,3,...,7. If we want to create a signature using leaf node 1, the authentication path is (Node 2, Node 6), since we need those to compute the root.
out_root | An output buffer to store the root node in (size: node_size ). |
out_auth_path | Optional buffer to store the authentication path in (size: node_size * total_tree_height). |
leaf_idx | The optional index of the leaf used to sign in the bottom tree layer beginning with index 0. nullopt if no node is signed, so we need no auth path. |
node_size | The size of each node in the tree. |
total_tree_height | The hight of the merkle tree to construct. |
idx_offset | If we compute a subtree this marks the index of the leftmost leaf node in the bottom layer |
node_pair_hash | The function to process two child nodes to compute their parent node. |
gen_leaf | The logic to create a leaf node given the address in the tree. Probably this function creates a one-time/few-time-signature's public key which is hashed to be the leaf node. |
tree_address | The address that is passed to gen_leaf or node_pair hash. This function will update the address accordings to the currently processed node. This object may contain further algorithm specific information, like the position of this merkle tree in a hypertree. |
Definition at line 114 of file tree_hash.h.
References BOTAN_ASSERT, BOTAN_ASSERT_NOMSG, copy_mem(), Botan::detail::Strong_Base< T >::get(), and Botan::StrongSpan< T >::size().
|
inlineconstexprnoexcept |
Definition at line 254 of file mem_ops.h.
References typecast_copy().
|
inlineconstexprnoexcept |
Create a trivial type by bit-casting a range of trivially copyable type with matching length into it.
Definition at line 212 of file mem_ops.h.
References typecast_copy().
|
inlineconstexpr |
Definition at line 246 of file mem_ops.h.
References T, and typecast_copy().
|
inlineconstexpr |
Definition at line 229 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 201 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 178 of file mem_ops.h.
References Botan::ranges::assert_equal_byte_lengths(), and Botan::ranges::size_bytes().
Referenced by decode_point(), decode_scalar(), Botan::Roughtime::Response::from_bits(), Botan::detail::load_any(), Botan::detail::load_any(), Botan::Roughtime::Nonce::Nonce(), Botan::detail::store_any(), Botan::detail::store_any(), typecast_copy(), 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 190 of file mem_ops.h.
References typecast_copy().
Definition at line 238 of file mem_ops.h.
References T, and typecast_copy().
|
inlineconstexpr |
Definition at line 220 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.
References load_be().
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.
References load_be().
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(), and Botan::Cipher_Mode_Filter::set_iv().
Generically unwraps a strong type to its underlying type.
If the provided type is not a strong type, it is returned as is.
get()
method if you know that you are dealing with a strong type.t | value to be unwrapped |
Definition at line 198 of file strong_type.h.
Referenced by checked_cast_to_or_throw(), Botan::detail::concatenate(), and Botan::detail::unwrap_strong_type_or_enum().
bool Botan::value_exists | ( | const std::vector< T > & | vec, |
const OT & | val ) |
Existence check for values
Definition at line 60 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::TPM2::Context::find_free_persistent_handle(), Botan::TLS::Hello_Retry_Request::Hello_Retry_Request(), Botan::TLS::Signature_Scheme::is_available(), Botan::TLS::Server_Impl_13::new_session_ticket_supported(), Botan::TPM2::Context::persist(), Botan::TLS::Key_Share::retry_offer(), 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(), 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/().
BOTAN_TEST_API bool Botan::verify_signature | ( | std::span< const uint8_t, ED448_LEN > | pk, |
bool | phflag, | ||
std::span< const uint8_t > | context, | ||
std::span< const uint8_t > | sig, | ||
std::span< const uint8_t > | msg ) |
Verify a signature(RFC 8032 5.2.7)
pk | the public key |
phflag | the prehash flag (true iff using Ed448ph) |
context | the context string |
sig | the signature |
msg | the message to verify |
Decoding_Error | if the public key or signature is malformed |
Definition at line 283 of file ed448_internal.cpp.
References Botan::Ed448Point::base_point(), Botan::Scalar448::bytes_are_reduced(), Botan::Ed448Point::decode(), and ED448_LEN.
Referenced by Botan::Roughtime::Response::from_bits().
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 single-line string identifying the version of Botan. No particular format should be assumed.
Definition at line 67 of file version.cpp.
References version_cstr().
|
inlineconstexpr |
Definition at line 520 of file mp_asmi.h.
Referenced by Botan::word3< W >::add().
|
inlineconstexpr |
Definition at line 490 of file mp_asmi.h.
References carry(), and word_madd2().
Referenced by Botan::word3< W >::mul().
|
inlineconstexpr |
Definition at line 547 of file mp_asmi.h.
References carry(), word_add(), and word_madd2().
Referenced by Botan::word3< W >::mul_x2().
|
inlineconstexpr |
Definition at line 259 of file mp_asmi.h.
References carry(), and word_add().
Referenced by bigint_add().
|
inlineconstexpr |
Definition at line 389 of file mp_asmi.h.
References carry(), and word_sub().
Referenced by bigint_monty_maybe_sub().
|
inlineconstexpr |
Definition at line 210 of file mp_asmi.h.
References carry(), and word_add().
Referenced by bigint_add2_nc().
|
inlineconstexpr |
Definition at line 236 of file mp_asmi.h.
References carry(), and word_add().
Referenced by bigint_add(), bigint_add3_nc(), bigint_cnd_add(), bigint_cnd_add_or_sub(), and bigint_cnd_addsub().
|
inlineconstexpr |
Definition at line 411 of file mp_asmi.h.
References carry(), and word_madd2().
Referenced by bigint_linmul2().
|
inlineconstexpr |
Definition at line 437 of file mp_asmi.h.
References carry(), and word_madd2().
Referenced by bigint_linmul3().
|
inlineconstexpr |
Definition at line 463 of file mp_asmi.h.
References carry(), and word_madd3().
Referenced by basecase_mul(), and basecase_sqr().
|
inlineconstexpr |
Definition at line 314 of file mp_asmi.h.
References carry(), and word_sub().
Referenced by bigint_sub2().
|
inlineconstexpr |
Definition at line 340 of file mp_asmi.h.
References carry(), and word_sub().
Referenced by bigint_sub2_rev().
|
inlineconstexpr |
Definition at line 366 of file mp_asmi.h.
References carry(), and word_sub().
Referenced by bigint_cnd_add_or_sub(), bigint_cnd_addsub(), bigint_cnd_sub(), bigint_monty_maybe_sub(), bigint_monty_maybe_sub(), bigint_sub3(), and bigint_sub_abs().
|
inlineconstexpr |
Definition at line 177 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(), word4_add3(), word8_add2(), and word8_add3().
|
inlineconstexpr |
Definition at line 66 of file mp_asmi.h.
Referenced by bigint_linmul2(), bigint_linmul3(), bigint_modop_vartime(), redc_crandall(), word3_muladd(), word3_muladd_2(), word8_linmul2(), and word8_linmul3().
|
inlineconstexpr |
Definition at line 92 of file mp_asmi.h.
Referenced by basecase_mul(), basecase_sqr(), redc_crandall(), and word8_madd3().
|
inlineconstexpr |
Definition at line 281 of file mp_asmi.h.
References carry().
Referenced by bigint_cnd_add_or_sub(), bigint_cnd_addsub(), bigint_cnd_sub(), bigint_monty_maybe_sub(), bigint_monty_maybe_sub(), bigint_sub2(), bigint_sub2_rev(), bigint_sub3(), bigint_sub_abs(), word4_sub3(), word8_sub2(), word8_sub2_rev(), and word8_sub3().
|
constexpr |
Definition at line 18 of file curve448_scalar.h.
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 ) |
FIPS 205, Algorithm 8: wots_pkFromSig.
Reconstructs the WOTS public key from a given WOTS signature
and message
. This is tailored for the use case in the SLH-DSA implementation and is not meant for general usability in non SLH-DSA algorithms.
Definition at line 103 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_address(), 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 ) |
FIPS 205, Algorithm 6 and 7: wots_pkGen and wots_sign.
Implements a domain specific wrapper for the one-time signature scheme WOTS+ (Winternitz OTS). It is meant to be used inside SLH-DSA 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 132 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_address(), Botan::Sphincs_Address::set_hash_address(), Botan::Sphincs_Address::set_keypair_address(), 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().
|
nodiscardconstexpr |
Wraps a value into a caller-defined (strong) type.
If the provided object t
is already of type T
, it is returned as is.
t | value to be wrapped |
Definition at line 223 of file strong_type.h.
References T.
Referenced by checked_cast_to_or_throw(), Botan::detail::load_any(), and Botan::detail::wrap_strong_type_or_enum().
BOTAN_TEST_API Point448 Botan::x448 | ( | const ScalarX448 & | k, |
const Point448 & | u ) |
Multiply a scalar k
with a point u
.
k | scalar |
u | point on curve |
Definition at line 48 of file x448_internal.cpp.
References Botan::CT::Mask< T >::cleared(), Botan::Gf448Elem::ct_cond_swap(), Botan::CT::Mask< T >::expand(), Botan::detail::Strong_Base< T >::get(), and square().
Referenced by x448_basepoint().
BOTAN_TEST_API Point448 Botan::x448_basepoint | ( | const ScalarX448 & | k | ) |
Multiply a scalar with the base group element (5)
Multiply a scalar with the standard group element (5)
k | scalar |
Definition at line 41 of file x448_internal.cpp.
References x448().
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 956 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 882 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 970 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 943 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 ) |
Compute the XMSS public key (root node) of the top-most subtree. Contains logic of FIPS 205, Algorithm 18: slh_keygen_internal
Definition at line 58 of file sp_xmss.cpp.
References Botan::Sphincs_Parameters::d(), HashTree, Botan::Sphincs_Parameters::n(), root(), Botan::Sphincs_Address::set_layer_address(), 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 & | message, | ||
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 ) |
FIPS 205, Algorithm 10: xmss_sign.
This generates a Merkle signature of message
(i.e. a FORS public key (bottom layer) or an XMSS root node). 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
. 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 341 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::Lion::encrypt_n(), Botan::BlockCipher::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 371 of file mem_ops.h.
References Botan::ranges::assert_equal_byte_lengths(), and typecast_copy().
|
inline |
Definition at line 421 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 437 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 429 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 415 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 403 of file mem_ops.h.
References xor_buf().
void Botan::xts_update_tweak_block | ( | uint8_t | tweak[], |
size_t | BS, | ||
size_t | blocks_in_tweak ) |
Definition at line 119 of file poly_dbl.cpp.
References carry(), copy_out_le(), load_le(), and poly_double_n_le().
Referenced by Botan::XTS_Mode::update_tweak().
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::AES_128::clear(), Botan::AES_192::clear(), Botan::AES_256::clear(), Botan::ANSI_X919_MAC::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::ChaCha::clear(), Botan::CTR_BE::clear(), Botan::DES::clear(), Botan::GHASH::clear(), Botan::GOST_28147_89::clear(), Botan::HMAC::clear(), Botan::IDEA::clear(), Botan::KMAC::clear(), Botan::Lion::clear(), Botan::Noekeon::clear(), Botan::Poly1305::clear(), Botan::RC4::clear(), Botan::Salsa20::clear(), Botan::SEED::clear(), Botan::Serpent::clear(), Botan::SHACAL2::clear(), Botan::SipHash::clear(), Botan::SM4::clear(), Botan::Threefish_512::clear(), Botan::TripleDES::clear(), Botan::Twofish::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::BLAKE2b::clear(), Botan::CMAC::clear(), Botan::CTR_BE::clear(), Botan::GMAC::clear(), Botan::GOST_34_11::clear(), Botan::Keccak_Permutation::clear(), Botan::OFB::clear(), Botan::SHAKE_Cipher::clear(), Botan::Streebog::clear(), Botan::Whirlpool::init(), Botan::OctetString::operator^=(), Botan::CBC_Decryption::reset(), Botan::CFB_Mode::reset(), Botan::GHASH::reset(), Botan::OCB_Mode::reset(), Botan::CTR_BE::seek(), Botan::GHASH::set_associated_data(), and zap().
const SIMD_8x32& Botan::b |
Definition at line 63 of file simd_avx2_gfni.h.
Referenced by Botan::FE_25519::add(), Botan::FrodoMatrix::add(), Botan::BufferStuffer::append(), bigint_cnd_swap(), cast_uint8_ptr_to_char(), cast_uint8_ptr_to_char(), ceil_division(), checked_add(), checked_add(), checked_mul(), checked_sub(), choose(), Botan::SIMD_4x32::choose(), combine_lower(), Botan::CT::copy_output(), Botan::Gf448Elem::ct_cond_assign(), Botan::Gf448Elem::ct_cond_swap(), ct_divide(), ct_divide_word(), ct_modulo(), Botan::PEM_Code::decode(), Botan::OID::decode_from(), Botan::DER_Encoder::DER_Encoder(), Botan::DER_Encoder::DER_Encoder(), Botan::CRYSTALS::detail::dot_product(), Botan::EC_Group::EC_Group(), Botan::EC_Group::EC_Group(), extended_euclidean_algorithm(), fe_add(), fe_copy(), fe_frombytes(), fe_mul(), fe_sub(), fe_tobytes(), Botan::CRYSTALS::Trait_Base< ConstantsT, DerivedT >::fqmul(), Botan::FrodoKEM_PrivateKey::FrodoKEM_PrivateKey(), Botan::FrodoKEM_PrivateKey::FrodoKEM_PrivateKey(), Botan::FrodoKEM_PublicKey::FrodoKEM_PublicKey(), gcd(), ge_double_scalarmult_vartime(), generate_dsa_primes(), Botan::GF2m_Field::gf_div_nrr(), Botan::GF2m_Field::gf_div_rnr(), Botan::GF2m_Field::gf_div_zzr(), Botan::GF2m_Field::gf_mul_lll(), Botan::GF2m_Field::gf_mul_nrr(), Botan::GF2m_Field::gf_mul_rrr(), lcm(), majority(), monty_inverse(), Botan::EC_Point::mul(), mul64x64_128(), Botan::FrodoMatrix::mul_add_sb_plus_e(), Botan::FrodoMatrix::mul_bs(), Botan::RandomNumberGenerator::next_byte(), Botan::Zlib_Style_Stream< Stream, ByteType, StreamLenType >::next_in(), Botan::RandomNumberGenerator::next_nonzero_byte(), Botan::Zlib_Style_Stream< Stream, ByteType, StreamLenType >::next_out(), operator!=(), operator!=(), operator!=(), Botan::TLS::operator!=(), operator&(), operator&(), operator&(), operator&(), operator&=(), operator&=(), Botan::CRYSTALS::operator*(), Botan::CRYSTALS::operator*(), operator*(), operator*(), operator*(), operator*=(), operator*=(), Botan::CRYSTALS::operator+(), operator+(), operator+(), operator+(), operator+=(), operator+=(), operator-(), operator-(), operator-(), operator-=(), operator-=(), operator/(), operator/(), operator/(), operator/=(), operator/=(), operator<(), operator<(), operator<(), Botan::TLS::operator<(), operator<<(), operator<<(), operator<<(), operator<<=(), operator<<=(), operator<=(), operator<=(), operator<=>(), operator<=>(), operator==(), operator==(), operator==(), operator==(), Botan::TLS::operator==(), operator>(), operator>(), operator>=(), operator>=(), operator>>(), operator>>(), operator>>(), operator>>=(), operator>>=(), operator^(), operator^(), operator^(), operator^=(), operator^=(), operator|(), operator|(), operator|(), operator|(), Botan::PKCS11::operator|(), operator|=(), operator|=(), Botan::FrodoMatrix::pack(), Botan::EC_Group_Data::params_match(), Botan::PCurve::PrimeOrderCurveImpl< C >::point_add(), Botan::PCurve::PrimeOrderCurveImpl< C >::point_add_mixed(), Botan::KyberPolyTraits::poly_pointwise_montgomery(), Botan::DL_Group::power_b_p(), Botan::BigInt::power_of_2(), random_gf2m(), random_prime(), SBoxD0(), Botan::Serpent_F::SBoxD0(), SBoxD1(), Botan::Serpent_F::SBoxD1(), SBoxD2(), Botan::Serpent_F::SBoxD2(), SBoxD3(), Botan::Serpent_F::SBoxD3(), SBoxD4(), Botan::Serpent_F::SBoxD4(), SBoxD5(), Botan::Serpent_F::SBoxD5(), SBoxD6(), Botan::Serpent_F::SBoxD6(), SBoxD7(), Botan::Serpent_F::SBoxD7(), SBoxE0(), Botan::Serpent_F::SBoxE0(), SBoxE1(), Botan::Serpent_F::SBoxE1(), SBoxE2(), Botan::Serpent_F::SBoxE2(), SBoxE3(), Botan::Serpent_F::SBoxE3(), SBoxE4(), Botan::Serpent_F::SBoxE4(), SBoxE5(), Botan::Serpent_F::SBoxE5(), SBoxE6(), Botan::Serpent_F::SBoxE6(), SBoxE7(), Botan::Serpent_F::SBoxE7(), sc_muladd(), Botan::PCurve::PrimeOrderCurveImpl< C >::scalar_add(), Botan::PCurve::PrimeOrderCurveImpl< C >::scalar_equal(), Botan::PCurve::PrimeOrderCurveImpl< C >::scalar_mul(), Botan::PCurve::PrimeOrderCurveImpl< C >::scalar_sub(), significant_bytes(), Botan::Sodium::sodium_add(), Botan::Sodium::sodium_increment(), Botan::Sodium::sodium_is_zero(), Botan::FE_25519::sub(), Botan::FrodoMatrix::sub(), swar_lt(), Botan::FrodoMatrix::unpack(), Botan::EC_Group::verify_group(), word_madd2(), word_madd3(), Botan::EC_Point::x_bytes(), Botan::EC_Point::xy_bytes(), and Botan::EC_Point::y_bytes().
|
constexpr |
Definition at line 21 of file blake2b.h.
Referenced by Botan::BLAKE2b::add_data().
|
constexpr |
Definition at line 20 of file curve448_gf.h.
|
constexpr |
Definition at line 17 of file ed448_internal.h.
Referenced by Botan::Ed448_PrivateKey::Ed448_PrivateKey(), Botan::Ed448_PrivateKey::Ed448_PrivateKey(), Botan::Ed448_PublicKey::Ed448_PublicKey(), Botan::Ed448_PrivateKey::private_key_bits(), sign_message(), and verify_signature().
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 688 of file strong_type.h.
|
constexpr |
Definition at line 34 of file concepts.h.
|
constexpr |
The length in bytes of the LMS identifier (I).
Definition at line 67 of file lms.h.
Referenced by Botan::HSS_LMS_PrivateKeyInternal::from_bytes_or_throw(), Botan::LMS_PublicKey::from_bytes_or_throw(), Botan::HSS_LMS_PrivateKeyInternal::HSS_LMS_PrivateKeyInternal(), Botan::LMS_PublicKey::LMS_PublicKey(), and Botan::LMS_PublicKey::size().
const size_t Botan::MAX_EXT_DEG = 16 |
Definition at line 18 of file gf2m_small_m.cpp.
const size_t Botan::PRIME_TABLE_SIZE = 6541 |
The size of the PRIMES[] array
Definition at line 172 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().
|
constexpr |
Definition at line 22 of file curve448_gf.h.
Referenced by Botan::Gf448Elem::bytes_are_canonical_representation(), Botan::Gf448Elem::ct_cond_assign(), Botan::Gf448Elem::ct_cond_swap(), Botan::Gf448Elem::is_zero(), and Botan::Gf448Elem::operator==().
|
constexpr |
Definition at line 16 of file x448_internal.h.
Referenced by Botan::X448_PrivateKey::check_key(), decode_point(), decode_scalar(), Botan::X448_PrivateKey::X448_PrivateKey(), and Botan::X448_PublicKey::X448_PublicKey().