Hi Youssouf,

I think you're looking for mbedtls_mpi_write_file() - just pass NULL as the file argument to write to stdout. You can use the radix argument to print out hex or decimal.

Regards,
Manuel.

From: mbed-tls <mbed-tls-bounces@lists.trustedfirmware.org> on behalf of youssouf sokhona via mbed-tls <mbed-tls@lists.trustedfirmware.org>
Sent: 25 August 2020 15:40
To: mbed-tls@lists.trustedfirmware.org <mbed-tls@lists.trustedfirmware.org>
Subject: [mbed-tls] Set an MPI and print it
 

Hi everyone, I think you all are fine.

 

I am a beginner on mbedtls, and I wanted to set a dhm context. So, at first, I just want to set the value of the prime P, and the generator G. So to that I wrote the function below :

 

To check if it is correctly set, I wanted to print it to see. However, it is not the case. Do you know how to set and print the value ?

 

Thanks, and have a good day

 

Best regards, YS