mbedtls_mpi_set_bit() is only used within mbedTLS.
 
Symbols
loading...
Files
loading...

mbedtls_mpi_set_bit() function

Modify a specific bit in an MPI.

Syntax

int mbedtls_mpi_set_bit( mbedtls_mpi *X,     size_t pos,     unsigned char val );
Implemented in bignum.c:351

Arguments

X

The MPI to modify. This must be initialized.

pos

Zero-based index of the bit to modify.

val

The desired value of bit \c pos: \c 0 or \c 1.

Return value

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

Notes

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.

References

LocationText
bignum.c:351
int mbedtls_mpi_set_bit( mbedtls_mpi *X, size_t pos, unsigned char val )
bignum.h:357
int mbedtls_mpi_set_bit( mbedtls_mpi *X, size_t pos, unsigned char val );

Call Tree

Functions called by mbedtls_mpi_set_bit()
mbedtls_mpi_set_bit()
all items filtered out
Data read by mbedtls_mpi_set_bit()
Data written by mbedtls_mpi_set_bit()
mbedtls_mpi_set_bit()::ret
mbedtls_mpi_set_bit()::off
mbedtls_mpi_set_bit()::idx
all items filtered out
mbedtls_mpi_set_bit()
mbedtls_mpi_set_bit()::ret
all items filtered out
Type of mbedtls_mpi_set_bit()
mbedtls_mpi_set_bit()
size_t
all items filtered out