Adjust mpi_gcd_modinv_odd docs and precondition checking

Signed-off-by: Felix Conway <felix.conway@arm.com>
diff --git a/library/bignum.c b/library/bignum.c
index a942359..b09a851 100644
--- a/library/bignum.c
+++ b/library/bignum.c
@@ -1763,7 +1763,7 @@
     }
 
     /* Check aliasing requirements */
-    if (A == N || (I != NULL && (I == N || G == N))) {
+    if (A == N || G == I || (I != NULL && (I == N || G == N))) {
         return MBEDTLS_ERR_MPI_BAD_INPUT_DATA;
     }