The Great Renaming

A simple execution of tmp/invoke-rename.pl
diff --git a/include/mbedtls/camellia.h b/include/mbedtls/camellia.h
index 03218d1..b724ed5 100644
--- a/include/mbedtls/camellia.h
+++ b/include/mbedtls/camellia.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_CAMELLIA_H
-#define POLARSSL_CAMELLIA_H
+#ifndef MBEDTLS_CAMELLIA_H
+#define MBEDTLS_CAMELLIA_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,13 +39,13 @@
 #include <inttypes.h>
 #endif
 
-#define CAMELLIA_ENCRYPT     1
-#define CAMELLIA_DECRYPT     0
+#define MBEDTLS_CAMELLIA_ENCRYPT     1
+#define MBEDTLS_CAMELLIA_DECRYPT     0
 
-#define POLARSSL_ERR_CAMELLIA_INVALID_KEY_LENGTH           -0x0024  /**< Invalid key length. */
-#define POLARSSL_ERR_CAMELLIA_INVALID_INPUT_LENGTH         -0x0026  /**< Invalid data input length. */
+#define MBEDTLS_ERR_CAMELLIA_INVALID_KEY_LENGTH           -0x0024  /**< Invalid key length. */
+#define MBEDTLS_ERR_CAMELLIA_INVALID_INPUT_LENGTH         -0x0026  /**< Invalid data input length. */
 
-#if !defined(POLARSSL_CAMELLIA_ALT)
+#if !defined(MBEDTLS_CAMELLIA_ALT)
 // Regular implementation
 //
 
@@ -61,21 +61,21 @@
     int nr;                     /*!<  number of rounds  */
     uint32_t rk[68];            /*!<  CAMELLIA round keys    */
 }
-camellia_context;
+mbedtls_camellia_context;
 
 /**
  * \brief          Initialize CAMELLIA context
  *
  * \param ctx      CAMELLIA context to be initialized
  */
-void camellia_init( camellia_context *ctx );
+void mbedtls_camellia_init( mbedtls_camellia_context *ctx );
 
 /**
  * \brief          Clear CAMELLIA context
  *
  * \param ctx      CAMELLIA context to be cleared
  */
-void camellia_free( camellia_context *ctx );
+void mbedtls_camellia_free( mbedtls_camellia_context *ctx );
 
 /**
  * \brief          CAMELLIA key schedule (encryption)
@@ -84,9 +84,9 @@
  * \param key      encryption key
  * \param keysize  must be 128, 192 or 256
  *
- * \return         0 if successful, or POLARSSL_ERR_CAMELLIA_INVALID_KEY_LENGTH
+ * \return         0 if successful, or MBEDTLS_ERR_CAMELLIA_INVALID_KEY_LENGTH
  */
-int camellia_setkey_enc( camellia_context *ctx, const unsigned char *key,
+int mbedtls_camellia_setkey_enc( mbedtls_camellia_context *ctx, const unsigned char *key,
                          unsigned int keysize );
 
 /**
@@ -96,27 +96,27 @@
  * \param key      decryption key
  * \param keysize  must be 128, 192 or 256
  *
- * \return         0 if successful, or POLARSSL_ERR_CAMELLIA_INVALID_KEY_LENGTH
+ * \return         0 if successful, or MBEDTLS_ERR_CAMELLIA_INVALID_KEY_LENGTH
  */
-int camellia_setkey_dec( camellia_context *ctx, const unsigned char *key,
+int mbedtls_camellia_setkey_dec( mbedtls_camellia_context *ctx, const unsigned char *key,
                          unsigned int keysize );
 
 /**
  * \brief          CAMELLIA-ECB block encryption/decryption
  *
  * \param ctx      CAMELLIA context
- * \param mode     CAMELLIA_ENCRYPT or CAMELLIA_DECRYPT
+ * \param mode     MBEDTLS_CAMELLIA_ENCRYPT or MBEDTLS_CAMELLIA_DECRYPT
  * \param input    16-byte input block
  * \param output   16-byte output block
  *
  * \return         0 if successful
  */
-int camellia_crypt_ecb( camellia_context *ctx,
+int mbedtls_camellia_crypt_ecb( mbedtls_camellia_context *ctx,
                     int mode,
                     const unsigned char input[16],
                     unsigned char output[16] );
 
-#if defined(POLARSSL_CIPHER_MODE_CBC)
+#if defined(MBEDTLS_CIPHER_MODE_CBC)
 /**
  * \brief          CAMELLIA-CBC buffer encryption/decryption
  *                 Length should be a multiple of the block
@@ -131,30 +131,30 @@
  *                 module instead.
  *
  * \param ctx      CAMELLIA context
- * \param mode     CAMELLIA_ENCRYPT or CAMELLIA_DECRYPT
+ * \param mode     MBEDTLS_CAMELLIA_ENCRYPT or MBEDTLS_CAMELLIA_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_CAMELLIA_INVALID_INPUT_LENGTH
+ *                 MBEDTLS_ERR_CAMELLIA_INVALID_INPUT_LENGTH
  */
-int camellia_crypt_cbc( camellia_context *ctx,
+int mbedtls_camellia_crypt_cbc( mbedtls_camellia_context *ctx,
                     int mode,
                     size_t length,
                     unsigned char iv[16],
                     const unsigned char *input,
                     unsigned char *output );
-#endif /* POLARSSL_CIPHER_MODE_CBC */
+#endif /* MBEDTLS_CIPHER_MODE_CBC */
 
-#if defined(POLARSSL_CIPHER_MODE_CFB)
+#if defined(MBEDTLS_CIPHER_MODE_CFB)
 /**
  * \brief          CAMELLIA-CFB128 buffer encryption/decryption
  *
  * Note: Due to the nature of CFB you should use the same key schedule for
  * both encryption and decryption. So a context initialized with
- * camellia_setkey_enc() for both CAMELLIA_ENCRYPT and CAMELLIE_DECRYPT.
+ * mbedtls_camellia_setkey_enc() for both MBEDTLS_CAMELLIA_ENCRYPT and CAMELLIE_DECRYPT.
  *
  * \note           Upon exit, the content of the IV is updated so that you can
  *                 call the function same function again on the following
@@ -165,7 +165,7 @@
  *                 module instead.
  *
  * \param ctx      CAMELLIA context
- * \param mode     CAMELLIA_ENCRYPT or CAMELLIA_DECRYPT
+ * \param mode     MBEDTLS_CAMELLIA_ENCRYPT or MBEDTLS_CAMELLIA_DECRYPT
  * \param length   length of the input data
  * \param iv_off   offset in IV (updated after use)
  * \param iv       initialization vector (updated after use)
@@ -173,18 +173,18 @@
  * \param output   buffer holding the output data
  *
  * \return         0 if successful, or
- *                 POLARSSL_ERR_CAMELLIA_INVALID_INPUT_LENGTH
+ *                 MBEDTLS_ERR_CAMELLIA_INVALID_INPUT_LENGTH
  */
-int camellia_crypt_cfb128( camellia_context *ctx,
+int mbedtls_camellia_crypt_cfb128( mbedtls_camellia_context *ctx,
                        int mode,
                        size_t length,
                        size_t *iv_off,
                        unsigned char iv[16],
                        const unsigned char *input,
                        unsigned char *output );
-#endif /* POLARSSL_CIPHER_MODE_CFB */
+#endif /* MBEDTLS_CIPHER_MODE_CFB */
 
-#if defined(POLARSSL_CIPHER_MODE_CTR)
+#if defined(MBEDTLS_CIPHER_MODE_CTR)
 /**
  * \brief               CAMELLIA-CTR buffer encryption/decryption
  *
@@ -192,7 +192,7 @@
  *
  * Note: Due to the nature of CTR you should use the same key schedule for
  * both encryption and decryption. So a context initialized with
- * camellia_setkey_enc() for both CAMELLIA_ENCRYPT and CAMELLIA_DECRYPT.
+ * mbedtls_camellia_setkey_enc() for both MBEDTLS_CAMELLIA_ENCRYPT and MBEDTLS_CAMELLIA_DECRYPT.
  *
  * \param ctx           CAMELLIA context
  * \param length        The length of the data
@@ -207,22 +207,22 @@
  *
  * \return         0 if successful
  */
-int camellia_crypt_ctr( camellia_context *ctx,
+int mbedtls_camellia_crypt_ctr( mbedtls_camellia_context *ctx,
                        size_t length,
                        size_t *nc_off,
                        unsigned char nonce_counter[16],
                        unsigned char stream_block[16],
                        const unsigned char *input,
                        unsigned char *output );
-#endif /* POLARSSL_CIPHER_MODE_CTR */
+#endif /* MBEDTLS_CIPHER_MODE_CTR */
 
 #ifdef __cplusplus
 }
 #endif
 
-#else  /* POLARSSL_CAMELLIA_ALT */
+#else  /* MBEDTLS_CAMELLIA_ALT */
 #include "camellia_alt.h"
-#endif /* POLARSSL_CAMELLIA_ALT */
+#endif /* MBEDTLS_CAMELLIA_ALT */
 
 #ifdef __cplusplus
 extern "C" {
@@ -233,7 +233,7 @@
  *
  * \return         0 if successful, or 1 if the test failed
  */
-int camellia_self_test( int verbose );
+int mbedtls_camellia_self_test( int verbose );
 
 #ifdef __cplusplus
 }