Function esp_idf_sys::mbedtls_mpi_write_binary

source ·
pub unsafe extern "C" fn mbedtls_mpi_write_binary(
    X: *const mbedtls_mpi,
    buf: *mut c_uchar,
    buflen: usize,
) -> c_int
Expand description

\brief Export X into unsigned binary data, big endian. Always fills the whole buffer, which will start with zeros if the number is smaller.

\param X The source MPI. This must point to an initialized MPI. \param buf The output buffer. This must be a writable buffer of length \p buflen Bytes. \param buflen The size of the output buffer \p buf in Bytes.

\return \c 0 if successful. \return #MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL if \p buf isn’t large enough to hold the value of \p X. \return Another negative error code on different kinds of failure.