Make a public version of mpi_montg_init() in bignum_new.c and add unit tests

The unit tests were created by capturing runs of the existing function during
execution of existing unit tests.

Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
diff --git a/library/bignum_new.c b/library/bignum_new.c
index 024348a..d275fe8 100644
--- a/library/bignum_new.c
+++ b/library/bignum_new.c
@@ -56,6 +56,21 @@
     (void) mbedtls_mpi_core_add_if( X, N, n, ( carry < borrow ) );
 }
 
+/*
+ * Fast Montgomery initialization (thanks to Tom St Denis).
+ */
+mbedtls_mpi_uint mbedtls_mpi_montg_init( mbedtls_mpi_uint m0 )
+{
+    mbedtls_mpi_uint x = m0;
+
+    x += ( ( m0 + 2 ) & 4 ) << 1;
+
+    for( unsigned int i = biL; i >= 8; i /= 2 )
+        x *= ( 2 - ( m0 * x ) );
+
+    return( ~x + 1 );
+}
+
 mbedtls_mpi_uint mbedtls_mpi_core_mla( mbedtls_mpi_uint *d, size_t d_len,
                                        const mbedtls_mpi_uint *s, size_t s_len,
                                        mbedtls_mpi_uint b )