Function esp_idf_svc::sys::mbedtls_mpi_set_bit

source ยท
pub unsafe extern "C" fn mbedtls_mpi_set_bit(
    X: *mut mbedtls_mpi,
    pos: usize,
    val: u8,
) -> i32
Expand description

\brief Modify a specific bit in an MPI.

\note This function will grow the target MPI if necessary to set a bit to \c 1 in a not yet existing limb. It will not grow if the bit should be set to \c 0.

\param X The MPI to modify. This must be initialized. \param pos Zero-based index of the bit to modify. \param val The desired value of bit \c pos: \c 0 or \c 1.

\return \c 0 if successful. \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed. \return Another negative error code on other kinds of failure.