Forbid uninteresting edge cases
A == N (as pointers) will not happen in pratice: in our context, it
would mean we know at compile time that A == N (as values), and we
wouldn't be calling this function if we knew that already.
N == 1 when I != NULL is also not going to happen: we don't care about
operations mod 1.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
diff --git a/library/bignum_core.h b/library/bignum_core.h
index 1589c34..b8e0807 100644
--- a/library/bignum_core.h
+++ b/library/bignum_core.h
@@ -825,7 +825,9 @@
/** Compute GCD(A, N) and optionally the inverse of A mod N if it exists.
*
* Requires N to be odd, and 0 <= A <= N.
+ * When I != NULL, N (the modulus) must not be 1.
*
+ * A and N may not alias each other.
* When I == NULL (computing only the GCD), G may alias A or N.
* When I != NULL (computing the modular inverse), G or I may alias A
* but none of them may alias N (the modulus).