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

mbedtls_mpi_write_binary() function

Export an MPI into unsigned big endian binary data of fixed size.

Syntax

int mbedtls_mpi_write_binary( const mbedtls_mpi *X,     unsigned char *buf,     size_t buflen );
Implemented in bignum.c:864

Arguments

X

The source MPI. This must point to an initialized MPI.

buf

The output buffer. This must be a writable buffer of length \p buflen Bytes.

buflen

The size of the output buffer \p buf in Bytes.

Return value

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

References

LocationReferrerText
bignum.c:864
int mbedtls_mpi_write_binary( const mbedtls_mpi *X,
bignum.h:511
int mbedtls_mpi_write_binary( const mbedtls_mpi *X, unsigned char *buf,
asn1write.c:145mbedtls_asn1_write_mpi()
MBEDTLS_MPI_CHK( mbedtls_mpi_write_binary( X, *p, len ) );
ecdh.c:640ecdh_calc_secret_internal()
return mbedtls_mpi_write_binary( &ctx->z, buf, *olen );
ecp.c:772mbedtls_ecp_point_write_binary()
MBEDTLS_MPI_CHK( mbedtls_mpi_write_binary( &P->X, buf + 1, plen ) );
ecp.c:773mbedtls_ecp_point_write_binary()
MBEDTLS_MPI_CHK( mbedtls_mpi_write_binary( &P->Y, buf + 1 + plen, plen ) );
ecp.c:783mbedtls_ecp_point_write_binary()
MBEDTLS_MPI_CHK( mbedtls_mpi_write_binary( &P->X, buf + 1, plen ) );

Call Tree

Functions calling mbedtls_mpi_write_binary()
Functions called by mbedtls_mpi_write_binary()
mbedtls_mpi_write_binary()
memset()
all items filtered out
Data read by mbedtls_mpi_write_binary()
Data written by mbedtls_mpi_write_binary()
mbedtls_mpi_write_binary()::stored_bytes
mbedtls_mpi_write_binary()::bytes_to_copy
mbedtls_mpi_write_binary()::p
mbedtls_mpi_write_binary()::i
all items filtered out
mbedtls_mpi_write_binary()
mbedtls_mpi_write_binary()::stored_bytes
mbedtls_mpi_write_binary()::bytes_to_copy
mbedtls_mpi_write_binary()::p
mbedtls_mpi_write_binary()::i
all items filtered out
Type of mbedtls_mpi_write_binary()
mbedtls_mpi_write_binary()
size_t
all items filtered out