The Great Renaming

A simple execution of tmp/invoke-rename.pl
diff --git a/include/mbedtls/des.h b/include/mbedtls/des.h
index 3f7236c..bee0921 100644
--- a/include/mbedtls/des.h
+++ b/include/mbedtls/des.h
@@ -21,13 +21,13 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-#ifndef POLARSSL_DES_H
-#define POLARSSL_DES_H
+#ifndef MBEDTLS_DES_H
+#define MBEDTLS_DES_H
 
-#if !defined(POLARSSL_CONFIG_FILE)
+#if !defined(MBEDTLS_CONFIG_FILE)
 #include "config.h"
 #else
-#include POLARSSL_CONFIG_FILE
+#include MBEDTLS_CONFIG_FILE
 #endif
 
 #include <stddef.h>
@@ -39,14 +39,14 @@
 #include <inttypes.h>
 #endif
 
-#define DES_ENCRYPT     1
-#define DES_DECRYPT     0
+#define MBEDTLS_DES_ENCRYPT     1
+#define MBEDTLS_DES_DECRYPT     0
 
-#define POLARSSL_ERR_DES_INVALID_INPUT_LENGTH              -0x0032  /**< The data input has an invalid length. */
+#define MBEDTLS_ERR_DES_INVALID_INPUT_LENGTH              -0x0032  /**< The data input has an invalid length. */
 
-#define DES_KEY_SIZE    8
+#define MBEDTLS_DES_KEY_SIZE    8
 
-#if !defined(POLARSSL_DES_ALT)
+#if !defined(MBEDTLS_DES_ALT)
 // Regular implementation
 //
 
@@ -62,7 +62,7 @@
     int mode;                   /*!<  encrypt/decrypt   */
     uint32_t sk[32];            /*!<  DES subkeys       */
 }
-des_context;
+mbedtls_des_context;
 
 /**
  * \brief          Triple-DES context structure
@@ -72,35 +72,35 @@
     int mode;                   /*!<  encrypt/decrypt   */
     uint32_t sk[96];            /*!<  3DES subkeys      */
 }
-des3_context;
+mbedtls_des3_context;
 
 /**
  * \brief          Initialize DES context
  *
  * \param ctx      DES context to be initialized
  */
-void des_init( des_context *ctx );
+void mbedtls_des_init( mbedtls_des_context *ctx );
 
 /**
  * \brief          Clear DES context
  *
  * \param ctx      DES context to be cleared
  */
-void des_free( des_context *ctx );
+void mbedtls_des_free( mbedtls_des_context *ctx );
 
 /**
  * \brief          Initialize Triple-DES context
  *
  * \param ctx      DES3 context to be initialized
  */
-void des3_init( des3_context *ctx );
+void mbedtls_des3_init( mbedtls_des3_context *ctx );
 
 /**
  * \brief          Clear Triple-DES context
  *
  * \param ctx      DES3 context to be cleared
  */
-void des3_free( des3_context *ctx );
+void mbedtls_des3_free( mbedtls_des3_context *ctx );
 
 /**
  * \brief          Set key parity on the given key to odd.
@@ -110,7 +110,7 @@
  *
  * \param key      8-byte secret key
  */
-void des_key_set_parity( unsigned char key[DES_KEY_SIZE] );
+void mbedtls_des_key_set_parity( unsigned char key[MBEDTLS_DES_KEY_SIZE] );
 
 /**
  * \brief          Check that key parity on the given key is odd.
@@ -122,7 +122,7 @@
  *
  * \return         0 is parity was ok, 1 if parity was not correct.
  */
-int des_key_check_key_parity( const unsigned char key[DES_KEY_SIZE] );
+int mbedtls_des_key_check_key_parity( const unsigned char key[MBEDTLS_DES_KEY_SIZE] );
 
 /**
  * \brief          Check that key is not a weak or semi-weak DES key
@@ -131,7 +131,7 @@
  *
  * \return         0 if no weak key was found, 1 if a weak key was identified.
  */
-int des_key_check_weak( const unsigned char key[DES_KEY_SIZE] );
+int mbedtls_des_key_check_weak( const unsigned char key[MBEDTLS_DES_KEY_SIZE] );
 
 /**
  * \brief          DES key schedule (56-bit, encryption)
@@ -141,7 +141,7 @@
  *
  * \return         0
  */
-int des_setkey_enc( des_context *ctx, const unsigned char key[DES_KEY_SIZE] );
+int mbedtls_des_setkey_enc( mbedtls_des_context *ctx, const unsigned char key[MBEDTLS_DES_KEY_SIZE] );
 
 /**
  * \brief          DES key schedule (56-bit, decryption)
@@ -151,7 +151,7 @@
  *
  * \return         0
  */
-int des_setkey_dec( des_context *ctx, const unsigned char key[DES_KEY_SIZE] );
+int mbedtls_des_setkey_dec( mbedtls_des_context *ctx, const unsigned char key[MBEDTLS_DES_KEY_SIZE] );
 
 /**
  * \brief          Triple-DES key schedule (112-bit, encryption)
@@ -161,8 +161,8 @@
  *
  * \return         0
  */
-int des3_set2key_enc( des3_context *ctx,
-                      const unsigned char key[DES_KEY_SIZE * 2] );
+int mbedtls_des3_set2key_enc( mbedtls_des3_context *ctx,
+                      const unsigned char key[MBEDTLS_DES_KEY_SIZE * 2] );
 
 /**
  * \brief          Triple-DES key schedule (112-bit, decryption)
@@ -172,8 +172,8 @@
  *
  * \return         0
  */
-int des3_set2key_dec( des3_context *ctx,
-                      const unsigned char key[DES_KEY_SIZE * 2] );
+int mbedtls_des3_set2key_dec( mbedtls_des3_context *ctx,
+                      const unsigned char key[MBEDTLS_DES_KEY_SIZE * 2] );
 
 /**
  * \brief          Triple-DES key schedule (168-bit, encryption)
@@ -183,8 +183,8 @@
  *
  * \return         0
  */
-int des3_set3key_enc( des3_context *ctx,
-                      const unsigned char key[DES_KEY_SIZE * 3] );
+int mbedtls_des3_set3key_enc( mbedtls_des3_context *ctx,
+                      const unsigned char key[MBEDTLS_DES_KEY_SIZE * 3] );
 
 /**
  * \brief          Triple-DES key schedule (168-bit, decryption)
@@ -194,8 +194,8 @@
  *
  * \return         0
  */
-int des3_set3key_dec( des3_context *ctx,
-                      const unsigned char key[DES_KEY_SIZE * 3] );
+int mbedtls_des3_set3key_dec( mbedtls_des3_context *ctx,
+                      const unsigned char key[MBEDTLS_DES_KEY_SIZE * 3] );
 
 /**
  * \brief          DES-ECB block encryption/decryption
@@ -206,11 +206,11 @@
  *
  * \return         0 if successful
  */
-int des_crypt_ecb( des_context *ctx,
+int mbedtls_des_crypt_ecb( mbedtls_des_context *ctx,
                     const unsigned char input[8],
                     unsigned char output[8] );
 
-#if defined(POLARSSL_CIPHER_MODE_CBC)
+#if defined(MBEDTLS_CIPHER_MODE_CBC)
 /**
  * \brief          DES-CBC buffer encryption/decryption
  *
@@ -223,19 +223,19 @@
  *                 module instead.
  *
  * \param ctx      DES context
- * \param mode     DES_ENCRYPT or DES_DECRYPT
+ * \param mode     MBEDTLS_DES_ENCRYPT or MBEDTLS_DES_DECRYPT
  * \param length   length of the input data
  * \param iv       initialization vector (updated after use)
  * \param input    buffer holding the input data
  * \param output   buffer holding the output data
  */
-int des_crypt_cbc( des_context *ctx,
+int mbedtls_des_crypt_cbc( mbedtls_des_context *ctx,
                     int mode,
                     size_t length,
                     unsigned char iv[8],
                     const unsigned char *input,
                     unsigned char *output );
-#endif /* POLARSSL_CIPHER_MODE_CBC */
+#endif /* MBEDTLS_CIPHER_MODE_CBC */
 
 /**
  * \brief          3DES-ECB block encryption/decryption
@@ -246,11 +246,11 @@
  *
  * \return         0 if successful
  */
-int des3_crypt_ecb( des3_context *ctx,
+int mbedtls_des3_crypt_ecb( mbedtls_des3_context *ctx,
                      const unsigned char input[8],
                      unsigned char output[8] );
 
-#if defined(POLARSSL_CIPHER_MODE_CBC)
+#if defined(MBEDTLS_CIPHER_MODE_CBC)
 /**
  * \brief          3DES-CBC buffer encryption/decryption
  *
@@ -263,29 +263,29 @@
  *                 module instead.
  *
  * \param ctx      3DES context
- * \param mode     DES_ENCRYPT or DES_DECRYPT
+ * \param mode     MBEDTLS_DES_ENCRYPT or MBEDTLS_DES_DECRYPT
  * \param length   length of the input data
  * \param iv       initialization vector (updated after use)
  * \param input    buffer holding the input data
  * \param output   buffer holding the output data
  *
- * \return         0 if successful, or POLARSSL_ERR_DES_INVALID_INPUT_LENGTH
+ * \return         0 if successful, or MBEDTLS_ERR_DES_INVALID_INPUT_LENGTH
  */
-int des3_crypt_cbc( des3_context *ctx,
+int mbedtls_des3_crypt_cbc( mbedtls_des3_context *ctx,
                      int mode,
                      size_t length,
                      unsigned char iv[8],
                      const unsigned char *input,
                      unsigned char *output );
-#endif /* POLARSSL_CIPHER_MODE_CBC */
+#endif /* MBEDTLS_CIPHER_MODE_CBC */
 
 #ifdef __cplusplus
 }
 #endif
 
-#else  /* POLARSSL_DES_ALT */
+#else  /* MBEDTLS_DES_ALT */
 #include "des_alt.h"
-#endif /* POLARSSL_DES_ALT */
+#endif /* MBEDTLS_DES_ALT */
 
 #ifdef __cplusplus
 extern "C" {
@@ -296,7 +296,7 @@
  *
  * \return         0 if successful, or 1 if the test failed
  */
-int des_self_test( int verbose );
+int mbedtls_des_self_test( int verbose );
 
 #ifdef __cplusplus
 }