Remove individual mdX_file() and shaX_file()
diff --git a/library/error.c b/library/error.c
index c9e5e79..fdeb12a 100644
--- a/library/error.c
+++ b/library/error.c
@@ -101,18 +101,6 @@
 #include "mbedtls/md.h"
 #endif
 
-#if defined(MBEDTLS_MD2_C)
-#include "mbedtls/md2.h"
-#endif
-
-#if defined(MBEDTLS_MD4_C)
-#include "mbedtls/md4.h"
-#endif
-
-#if defined(MBEDTLS_MD5_C)
-#include "mbedtls/md5.h"
-#endif
-
 #if defined(MBEDTLS_NET_C)
 #include "mbedtls/net.h"
 #endif
@@ -141,26 +129,10 @@
 #include "mbedtls/pkcs5.h"
 #endif
 
-#if defined(MBEDTLS_RIPEMD160_C)
-#include "mbedtls/ripemd160.h"
-#endif
-
 #if defined(MBEDTLS_RSA_C)
 #include "mbedtls/rsa.h"
 #endif
 
-#if defined(MBEDTLS_SHA1_C)
-#include "mbedtls/sha1.h"
-#endif
-
-#if defined(MBEDTLS_SHA256_C)
-#include "mbedtls/sha256.h"
-#endif
-
-#if defined(MBEDTLS_SHA512_C)
-#include "mbedtls/sha512.h"
-#endif
-
 #if defined(MBEDTLS_SSL_TLS_C)
 #include "mbedtls/ssl.h"
 #endif
@@ -293,7 +265,7 @@
 
 #if defined(MBEDTLS_PK_C)
         if( use_ret == -(MBEDTLS_ERR_PK_ALLOC_FAILED) )
-            mbedtls_snprintf( buf, buflen, "PK - Memory alloation failed" );
+            mbedtls_snprintf( buf, buflen, "PK - Memory allocation failed" );
         if( use_ret == -(MBEDTLS_ERR_PK_TYPE_MISMATCH) )
             mbedtls_snprintf( buf, buflen, "PK - Type mismatch, eg attempt to encrypt with an ECDSA key" );
         if( use_ret == -(MBEDTLS_ERR_PK_BAD_INPUT_DATA) )
@@ -649,21 +621,6 @@
         mbedtls_snprintf( buf, buflen, "HMAC_DRBG - The entropy source failed" );
 #endif /* MBEDTLS_HMAC_DRBG_C */
 
-#if defined(MBEDTLS_MD2_C)
-    if( use_ret == -(MBEDTLS_ERR_MD2_FILE_IO_ERROR) )
-        mbedtls_snprintf( buf, buflen, "MD2 - Read/write error in file" );
-#endif /* MBEDTLS_MD2_C */
-
-#if defined(MBEDTLS_MD4_C)
-    if( use_ret == -(MBEDTLS_ERR_MD4_FILE_IO_ERROR) )
-        mbedtls_snprintf( buf, buflen, "MD4 - Read/write error in file" );
-#endif /* MBEDTLS_MD4_C */
-
-#if defined(MBEDTLS_MD5_C)
-    if( use_ret == -(MBEDTLS_ERR_MD5_FILE_IO_ERROR) )
-        mbedtls_snprintf( buf, buflen, "MD5 - Read/write error in file" );
-#endif /* MBEDTLS_MD5_C */
-
 #if defined(MBEDTLS_NET_C)
     if( use_ret == -(MBEDTLS_ERR_NET_SOCKET_FAILED) )
         mbedtls_snprintf( buf, buflen, "NET - Failed to open a socket" );
@@ -699,26 +656,6 @@
         mbedtls_snprintf( buf, buflen, "PADLOCK - Input data should be aligned" );
 #endif /* MBEDTLS_PADLOCK_C */
 
-#if defined(MBEDTLS_RIPEMD160_C)
-    if( use_ret == -(MBEDTLS_ERR_RIPEMD160_FILE_IO_ERROR) )
-        mbedtls_snprintf( buf, buflen, "RIPEMD160 - Read/write error in file" );
-#endif /* MBEDTLS_RIPEMD160_C */
-
-#if defined(MBEDTLS_SHA1_C)
-    if( use_ret == -(MBEDTLS_ERR_SHA1_FILE_IO_ERROR) )
-        mbedtls_snprintf( buf, buflen, "SHA1 - Read/write error in file" );
-#endif /* MBEDTLS_SHA1_C */
-
-#if defined(MBEDTLS_SHA256_C)
-    if( use_ret == -(MBEDTLS_ERR_SHA256_FILE_IO_ERROR) )
-        mbedtls_snprintf( buf, buflen, "SHA256 - Read/write error in file" );
-#endif /* MBEDTLS_SHA256_C */
-
-#if defined(MBEDTLS_SHA512_C)
-    if( use_ret == -(MBEDTLS_ERR_SHA512_FILE_IO_ERROR) )
-        mbedtls_snprintf( buf, buflen, "SHA512 - Read/write error in file" );
-#endif /* MBEDTLS_SHA512_C */
-
 #if defined(MBEDTLS_THREADING_C)
     if( use_ret == -(MBEDTLS_ERR_THREADING_FEATURE_UNAVAILABLE) )
         mbedtls_snprintf( buf, buflen, "THREADING - The selected feature is not available" );
diff --git a/library/md2.c b/library/md2.c
index 1526352..5cd024a 100644
--- a/library/md2.c
+++ b/library/md2.c
@@ -38,10 +38,6 @@
 
 #include <string.h>
 
-#if defined(MBEDTLS_FS_IO)
-#include <stdio.h>
-#endif
-
 #if defined(MBEDTLS_SELF_TEST)
 #if defined(MBEDTLS_PLATFORM_C)
 #include "mbedtls/platform.h"
@@ -213,40 +209,6 @@
     mbedtls_md2_free( &ctx );
 }
 
-#if defined(MBEDTLS_FS_IO)
-/*
- * output = MD2( file contents )
- */
-int mbedtls_md2_file( const char *path, unsigned char output[16] )
-{
-    FILE *f;
-    size_t n;
-    mbedtls_md2_context ctx;
-    unsigned char buf[1024];
-
-    if( ( f = fopen( path, "rb" ) ) == NULL )
-        return( MBEDTLS_ERR_MD2_FILE_IO_ERROR );
-
-    mbedtls_md2_init( &ctx );
-    mbedtls_md2_starts( &ctx );
-
-    while( ( n = fread( buf, 1, sizeof( buf ), f ) ) > 0 )
-        mbedtls_md2_update( &ctx, buf, n );
-
-    mbedtls_md2_finish( &ctx, output );
-    mbedtls_md2_free( &ctx );
-
-    if( ferror( f ) != 0 )
-    {
-        fclose( f );
-        return( MBEDTLS_ERR_MD2_FILE_IO_ERROR );
-    }
-
-    fclose( f );
-    return( 0 );
-}
-#endif /* MBEDTLS_FS_IO */
-
 #if defined(MBEDTLS_SELF_TEST)
 
 /*
diff --git a/library/md4.c b/library/md4.c
index 75a6719..9062358 100644
--- a/library/md4.c
+++ b/library/md4.c
@@ -38,10 +38,6 @@
 
 #include <string.h>
 
-#if defined(MBEDTLS_FS_IO)
-#include <stdio.h>
-#endif
-
 #if defined(MBEDTLS_SELF_TEST)
 #if defined(MBEDTLS_PLATFORM_C)
 #include "mbedtls/platform.h"
@@ -309,40 +305,6 @@
     mbedtls_md4_free( &ctx );
 }
 
-#if defined(MBEDTLS_FS_IO)
-/*
- * output = MD4( file contents )
- */
-int mbedtls_md4_file( const char *path, unsigned char output[16] )
-{
-    FILE *f;
-    size_t n;
-    mbedtls_md4_context ctx;
-    unsigned char buf[1024];
-
-    if( ( f = fopen( path, "rb" ) ) == NULL )
-        return( MBEDTLS_ERR_MD4_FILE_IO_ERROR );
-
-    mbedtls_md4_init( &ctx );
-    mbedtls_md4_starts( &ctx );
-
-    while( ( n = fread( buf, 1, sizeof( buf ), f ) ) > 0 )
-        mbedtls_md4_update( &ctx, buf, n );
-
-    mbedtls_md4_finish( &ctx, output );
-    mbedtls_md4_free( &ctx );
-
-    if( ferror( f ) != 0 )
-    {
-        fclose( f );
-        return( MBEDTLS_ERR_MD4_FILE_IO_ERROR );
-    }
-
-    fclose( f );
-    return( 0 );
-}
-#endif /* MBEDTLS_FS_IO */
-
 #if defined(MBEDTLS_SELF_TEST)
 
 /*
diff --git a/library/md5.c b/library/md5.c
index 592304e..599debc 100644
--- a/library/md5.c
+++ b/library/md5.c
@@ -37,10 +37,6 @@
 
 #include <string.h>
 
-#if defined(MBEDTLS_FS_IO)
-#include <stdio.h>
-#endif
-
 #if defined(MBEDTLS_SELF_TEST)
 #if defined(MBEDTLS_PLATFORM_C)
 #include "mbedtls/platform.h"
@@ -326,40 +322,6 @@
     mbedtls_md5_free( &ctx );
 }
 
-#if defined(MBEDTLS_FS_IO)
-/*
- * output = MD5( file contents )
- */
-int mbedtls_md5_file( const char *path, unsigned char output[16] )
-{
-    FILE *f;
-    size_t n;
-    mbedtls_md5_context ctx;
-    unsigned char buf[1024];
-
-    if( ( f = fopen( path, "rb" ) ) == NULL )
-        return( MBEDTLS_ERR_MD5_FILE_IO_ERROR );
-
-    mbedtls_md5_init( &ctx );
-    mbedtls_md5_starts( &ctx );
-
-    while( ( n = fread( buf, 1, sizeof( buf ), f ) ) > 0 )
-        mbedtls_md5_update( &ctx, buf, n );
-
-    mbedtls_md5_finish( &ctx, output );
-    mbedtls_md5_free( &ctx );
-
-    if( ferror( f ) != 0 )
-    {
-        fclose( f );
-        return( MBEDTLS_ERR_MD5_FILE_IO_ERROR );
-    }
-
-    fclose( f );
-    return( 0 );
-}
-#endif /* MBEDTLS_FS_IO */
-
 #if defined(MBEDTLS_SELF_TEST)
 /*
  * RFC 1321 test vectors
diff --git a/library/ripemd160.c b/library/ripemd160.c
index 12c2e20..d8a451d 100644
--- a/library/ripemd160.c
+++ b/library/ripemd160.c
@@ -38,10 +38,6 @@
 
 #include <string.h>
 
-#if defined(MBEDTLS_FS_IO)
-#include <stdio.h>
-#endif
-
 #if defined(MBEDTLS_SELF_TEST)
 #if defined(MBEDTLS_PLATFORM_C)
 #include "mbedtls/platform.h"
@@ -384,40 +380,6 @@
     mbedtls_ripemd160_free( &ctx );
 }
 
-#if defined(MBEDTLS_FS_IO)
-/*
- * output = RIPEMD-160( file contents )
- */
-int mbedtls_ripemd160_file( const char *path, unsigned char output[20] )
-{
-    FILE *f;
-    size_t n;
-    mbedtls_ripemd160_context ctx;
-    unsigned char buf[1024];
-
-    if( ( f = fopen( path, "rb" ) ) == NULL )
-        return( MBEDTLS_ERR_RIPEMD160_FILE_IO_ERROR );
-
-    mbedtls_ripemd160_init( &ctx );
-    mbedtls_ripemd160_starts( &ctx );
-
-    while( ( n = fread( buf, 1, sizeof( buf ), f ) ) > 0 )
-        mbedtls_ripemd160_update( &ctx, buf, n );
-
-    mbedtls_ripemd160_finish( &ctx, output );
-    mbedtls_ripemd160_free( &ctx );
-
-    if( ferror( f ) != 0 )
-    {
-        fclose( f );
-        return( MBEDTLS_ERR_RIPEMD160_FILE_IO_ERROR );
-    }
-
-    fclose( f );
-    return( 0 );
-}
-#endif /* MBEDTLS_FS_IO */
-
 #if defined(MBEDTLS_SELF_TEST)
 /*
  * Test vectors from the RIPEMD-160 paper and
diff --git a/library/sha1.c b/library/sha1.c
index 6b34cea..9a21bcb 100644
--- a/library/sha1.c
+++ b/library/sha1.c
@@ -37,10 +37,6 @@
 
 #include <string.h>
 
-#if defined(MBEDTLS_FS_IO)
-#include <stdio.h>
-#endif
-
 #if defined(MBEDTLS_SELF_TEST)
 #if defined(MBEDTLS_PLATFORM_C)
 #include "mbedtls/platform.h"
@@ -359,40 +355,6 @@
     mbedtls_sha1_free( &ctx );
 }
 
-#if defined(MBEDTLS_FS_IO)
-/*
- * output = SHA-1( file contents )
- */
-int mbedtls_sha1_file( const char *path, unsigned char output[20] )
-{
-    FILE *f;
-    size_t n;
-    mbedtls_sha1_context ctx;
-    unsigned char buf[1024];
-
-    if( ( f = fopen( path, "rb" ) ) == NULL )
-        return( MBEDTLS_ERR_SHA1_FILE_IO_ERROR );
-
-    mbedtls_sha1_init( &ctx );
-    mbedtls_sha1_starts( &ctx );
-
-    while( ( n = fread( buf, 1, sizeof( buf ), f ) ) > 0 )
-        mbedtls_sha1_update( &ctx, buf, n );
-
-    mbedtls_sha1_finish( &ctx, output );
-    mbedtls_sha1_free( &ctx );
-
-    if( ferror( f ) != 0 )
-    {
-        fclose( f );
-        return( MBEDTLS_ERR_SHA1_FILE_IO_ERROR );
-    }
-
-    fclose( f );
-    return( 0 );
-}
-#endif /* MBEDTLS_FS_IO */
-
 #if defined(MBEDTLS_SELF_TEST)
 /*
  * FIPS-180-1 test vectors
diff --git a/library/sha256.c b/library/sha256.c
index 4e0b1f3..cf0b15f 100644
--- a/library/sha256.c
+++ b/library/sha256.c
@@ -37,10 +37,6 @@
 
 #include <string.h>
 
-#if defined(MBEDTLS_FS_IO)
-#include <stdio.h>
-#endif
-
 #if defined(MBEDTLS_SELF_TEST)
 #if defined(MBEDTLS_PLATFORM_C)
 #include "mbedtls/platform.h"
@@ -331,40 +327,6 @@
     mbedtls_sha256_free( &ctx );
 }
 
-#if defined(MBEDTLS_FS_IO)
-/*
- * output = SHA-256( file contents )
- */
-int mbedtls_sha256_file( const char *path, unsigned char output[32], int is224 )
-{
-    FILE *f;
-    size_t n;
-    mbedtls_sha256_context ctx;
-    unsigned char buf[1024];
-
-    if( ( f = fopen( path, "rb" ) ) == NULL )
-        return( MBEDTLS_ERR_SHA256_FILE_IO_ERROR );
-
-    mbedtls_sha256_init( &ctx );
-    mbedtls_sha256_starts( &ctx, is224 );
-
-    while( ( n = fread( buf, 1, sizeof( buf ), f ) ) > 0 )
-        mbedtls_sha256_update( &ctx, buf, n );
-
-    mbedtls_sha256_finish( &ctx, output );
-    mbedtls_sha256_free( &ctx );
-
-    if( ferror( f ) != 0 )
-    {
-        fclose( f );
-        return( MBEDTLS_ERR_SHA256_FILE_IO_ERROR );
-    }
-
-    fclose( f );
-    return( 0 );
-}
-#endif /* MBEDTLS_FS_IO */
-
 #if defined(MBEDTLS_SELF_TEST)
 /*
  * FIPS-180-2 test vectors
diff --git a/library/sha512.c b/library/sha512.c
index fb872a1..f09b0f7 100644
--- a/library/sha512.c
+++ b/library/sha512.c
@@ -43,10 +43,6 @@
 
 #include <string.h>
 
-#if defined(MBEDTLS_FS_IO)
-#include <stdio.h>
-#endif
-
 #if defined(MBEDTLS_SELF_TEST)
 #if defined(MBEDTLS_PLATFORM_C)
 #include "mbedtls/platform.h"
@@ -366,40 +362,6 @@
     mbedtls_sha512_free( &ctx );
 }
 
-#if defined(MBEDTLS_FS_IO)
-/*
- * output = SHA-512( file contents )
- */
-int mbedtls_sha512_file( const char *path, unsigned char output[64], int is384 )
-{
-    FILE *f;
-    size_t n;
-    mbedtls_sha512_context ctx;
-    unsigned char buf[1024];
-
-    if( ( f = fopen( path, "rb" ) ) == NULL )
-        return( MBEDTLS_ERR_SHA512_FILE_IO_ERROR );
-
-    mbedtls_sha512_init( &ctx );
-    mbedtls_sha512_starts( &ctx, is384 );
-
-    while( ( n = fread( buf, 1, sizeof( buf ), f ) ) > 0 )
-        mbedtls_sha512_update( &ctx, buf, n );
-
-    mbedtls_sha512_finish( &ctx, output );
-    mbedtls_sha512_free( &ctx );
-
-    if( ferror( f ) != 0 )
-    {
-        fclose( f );
-        return( MBEDTLS_ERR_SHA512_FILE_IO_ERROR );
-    }
-
-    fclose( f );
-    return( 0 );
-}
-#endif /* MBEDTLS_FS_IO */
-
 #if defined(MBEDTLS_SELF_TEST)
 
 /*