mpi_read_buffer(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

okay bestie, welcome to mpi_read_buffer(9) from the Kernel API Manual πŸ’– this page is literally about read MPI to a buffer provided by user (msb first) β€” and yes, the msb first detail is iconic and stays. ✨

πŸ“œ SYNOPSIS πŸ“œ

int mpi_read_buffer (MPI a , uint8_t *buf , unsigned buf_len , unsigned *nbytes , int *sign );

look at that signature, slay πŸ’…

🌸 ARGUMENTS 🌸

  • a β€” a multi precision integer. your main character integer, fr fr 🫢
  • buf β€” buffer to which the output will be written to. Needs to be at least mpi_get_size(a) long. no cap, size matters here πŸ’–
  • buf_len β€” size of the buf. the vibe check for how much room you actually gave it πŸŽ€
  • nbytes β€” receives the actual length of the data written on success and the data to-be-written on -EOVERFLOW in case buf_len was too small. yep, it’s the receipts on success and the β€œbestie your buffer was too small” receipt on overflow 😭
  • sign β€” if not NULL, it will be set to the sign of a. so if you pass a real pointer, it gets the sign, periodt πŸ’…

πŸ’« RETURN πŸ’«

0 on success or error code in case of error β€” that’s the whole mood, bestie βœ…

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./lib/crypto/mpi/mpicoder.c β€” plus mpi_read_raw_data(9), mpi_write_to_sgl(9). go read those too, iykyk 🫢✨


source/version: ./lib/crypto/mpi Β· dated October 2026 β€” mwah, bestie πŸ’‹πŸ’–

πŸ“¦ where this page comes from