Name Description Size Coverage
ffi.cpp 9821 -
ffi.h This header exports some of botan's functionality via a C89 interface. This API is used by the Python, OCaml, Rust, Ruby, and Haskell bindings via those languages respective ctypes/FFI libraries. The API is intended to be as easy as possible to call from other languages, which often have easy ways to call C, because C. But some C code is easier to deal with than others, so to make things easy this API follows a few simple rules: - All interactions are via pointers to opaque structs. No need to worry about structure padding issues and the like. - All functions return an int error code (except the version calls, which are assumed to always have something to say). - Use simple types: size_t for lengths, const char* NULL terminated strings, uint8_t for binary. - No ownership of memory transfers across the API boundary. The API will consume data from const pointers with specified lengths. Outputs are either placed into buffers provided by (and allocated by) the caller, or are returned via a callback (what the FFI layer calls "view" functions). When writing to an application-provided buffer, the function takes a pointer to the output array and a read/write pointer to the length. The length field is always set to the actual amount of data that would have been written. If the input buffer's size was insufficient an error is returned. In many situations the length of the output can be known in advance without difficulty, in which case there will be a function which allows querying the expected output length. For example `botan_hash_output_length` allows knowing in advance the expected size for `botan_hash_final`. Some of these are exact, while others such as `botan_pk_op_decrypt_output_length` can only provide an upper bound for various technical reasons. In some cases knowing the exact size is difficult or impossible. In these situations view functions are used; see the handbook for further details. TODO: Doxygen comments for all parameters 118691 -
ffi_block.cpp Destroy a block cipher object 3111 -
ffi_cert.cpp As specified in RFC 5280 Section 4.2.1.6. alternative names essentially are a collection of GeneralNames. This allows mapping a single entry of @p altnames to a GeneralName by its @p index. If the index is out of range, std::nullopt is returned. NOTE: if the set of alternative name types handled here is extended, count_general_names_in() must be updated accordingly! 52249 -
ffi_cert.h 809 -
ffi_cipher.cpp Select an update size so that the following constraints are satisfies: - greater than or equal to the mode's update granularity - greater than the mode's minimum final size - the mode's ideal update granularity is a multiple of this size - (optional) a power of 2 Note that this is necessary mostly for backward-compatibility with previous versions of the FFI (prior to Botan 3.5.0). For Botan 4.0.0 we should just directly return the update granularity of the cipher mode and instruct users to switch to botan_cipher_get_ideal_update_granularity() instead. See also the discussion in GitHub Issue #4090. 13291 -
ffi_ec.cpp 6693 -
ffi_ec.h 348 -
ffi_fpe.cpp 2327 -
ffi_hash.cpp 2449 -
ffi_hotp.cpp 2205 -
ffi_kdf.cpp 5955 -
ffi_keywrap.cpp 3431 -
ffi_mac.cpp 2505 -
ffi_mp.cpp 9600 -
ffi_mp.h 309 -
ffi_oid.cpp 2418 -
ffi_oid.h 345 -
ffi_pk_op.cpp Public Key Decryption 12740 -
ffi_pkey.cpp 17243 -
ffi_pkey.h 402 -
ffi_pkey_algs.cpp 47290 -
ffi_rng.cpp 6187 -
ffi_rng.h 324 -
ffi_srp6.cpp 7096 -
ffi_totp.cpp 2114 -
ffi_tpm2.cpp 7997 -
ffi_util.h 8332 -
ffi_xof.cpp 2609 -
ffi_zfec.cpp 1573 -
info.txt 644 -