Lines Matching refs:MBEDTLS_MPI_CHK
37 MBEDTLS_MPI_CHK(mbedtls_mpi_read_string(&P, 10, "2789")); in main()
38 MBEDTLS_MPI_CHK(mbedtls_mpi_read_string(&Q, 10, "3203")); in main()
39 MBEDTLS_MPI_CHK(mbedtls_mpi_read_string(&E, 10, "257")); in main()
40 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_mpi(&N, &P, &Q)); in main()
43 MBEDTLS_MPI_CHK(mbedtls_mpi_write_file(" N = ", &N, 10, NULL)); in main()
44 MBEDTLS_MPI_CHK(mbedtls_mpi_write_file(" E = ", &E, 10, NULL)); in main()
47 MBEDTLS_MPI_CHK(mbedtls_mpi_write_file(" P = ", &P, 10, NULL)); in main()
48 MBEDTLS_MPI_CHK(mbedtls_mpi_write_file(" Q = ", &Q, 10, NULL)); in main()
51 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_int(&P, &P, 1)); in main()
52 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_int(&Q, &Q, 1)); in main()
53 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_mpi(&H, &P, &Q)); in main()
54 MBEDTLS_MPI_CHK(mbedtls_mpi_inv_mod(&D, &E, &H)); in main()
61 MBEDTLS_MPI_CHK(mbedtls_mpi_read_string(&X, 10, "55555")); in main()
62 MBEDTLS_MPI_CHK(mbedtls_mpi_exp_mod(&Y, &X, &E, &N, NULL)); in main()
63 MBEDTLS_MPI_CHK(mbedtls_mpi_exp_mod(&Z, &Y, &D, &N, NULL)); in main()
66 MBEDTLS_MPI_CHK(mbedtls_mpi_write_file(" X (plaintext) = ", &X, 10, NULL)); in main()
67 MBEDTLS_MPI_CHK(mbedtls_mpi_write_file(" Y (ciphertext) = X^E mod N = ", &Y, 10, NULL)); in main()
68 MBEDTLS_MPI_CHK(mbedtls_mpi_write_file(" Z (decrypted) = Y^D mod N = ", &Z, 10, NULL)); in main()