Lines Matching refs:MBEDTLS_MPI_CHK
57 MBEDTLS_MPI_CHK( mbedtls_mpi_read_string( &P, 10, "2789" ) ); in main()
58 MBEDTLS_MPI_CHK( mbedtls_mpi_read_string( &Q, 10, "3203" ) ); in main()
59 MBEDTLS_MPI_CHK( mbedtls_mpi_read_string( &E, 10, "257" ) ); in main()
60 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &N, &P, &Q ) ); in main()
63 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( " N = ", &N, 10, NULL ) ); in main()
64 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( " E = ", &E, 10, NULL ) ); in main()
67 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( " P = ", &P, 10, NULL ) ); in main()
68 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( " Q = ", &Q, 10, NULL ) ); in main()
71 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_int( &P, &P, 1 ) ); in main()
72 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_int( &Q, &Q, 1 ) ); in main()
73 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &H, &P, &Q ) ); in main()
74 MBEDTLS_MPI_CHK( mbedtls_mpi_inv_mod( &D, &E, &H ) ); in main()
81 MBEDTLS_MPI_CHK( mbedtls_mpi_read_string( &X, 10, "55555" ) ); in main()
82 MBEDTLS_MPI_CHK( mbedtls_mpi_exp_mod( &Y, &X, &E, &N, NULL ) ); in main()
83 MBEDTLS_MPI_CHK( mbedtls_mpi_exp_mod( &Z, &Y, &D, &N, NULL ) ); in main()
86 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( " X (plaintext) = ", &X, 10, NULL ) ); in main()
87 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( " Y (ciphertext) = X^E mod N = ", &Y, 10, NULL ) ); in main()
88 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( " Z (decrypted) = Y^D mod N = ", &Z, 10, NULL ) ); in main()