Rename cipher_init_ctx() to cipher_setup()
diff --git a/include/mbedtls/cipher.h b/include/mbedtls/cipher.h
index 084175d..58c974b 100644
--- a/include/mbedtls/cipher.h
+++ b/include/mbedtls/cipher.h
@@ -320,7 +320,7 @@
  *                      MBEDTLS_ERR_CIPHER_ALLOC_FAILED if allocation of the
  *                      cipher-specific context failed.
  */
-int mbedtls_cipher_init_ctx( mbedtls_cipher_context_t *ctx, const mbedtls_cipher_info_t *cipher_info );
+int mbedtls_cipher_setup( mbedtls_cipher_context_t *ctx, const mbedtls_cipher_info_t *cipher_info );
 
 /**
  * \brief               Returns the block size of the given cipher.
diff --git a/include/mbedtls/compat-1.3.h b/include/mbedtls/compat-1.3.h
index ae3e14e..9276eae 100644
--- a/include/mbedtls/compat-1.3.h
+++ b/include/mbedtls/compat-1.3.h
@@ -1871,7 +1871,7 @@
 #define cipher_info_from_values mbedtls_cipher_info_from_values
 #define cipher_info_t mbedtls_cipher_info_t
 #define cipher_init mbedtls_cipher_init
-#define cipher_init_ctx mbedtls_cipher_init_ctx
+#define cipher_init_ctx mbedtls_cipher_setup
 #define cipher_list mbedtls_cipher_list
 #define cipher_mode_t mbedtls_cipher_mode_t
 #define cipher_padding_t mbedtls_cipher_padding_t
diff --git a/library/ccm.c b/library/ccm.c
index 109927e..75de8cb 100644
--- a/library/ccm.c
+++ b/library/ccm.c
@@ -81,7 +81,7 @@
     if( cipher_info->block_size != 16 )
         return( MBEDTLS_ERR_CCM_BAD_INPUT );
 
-    if( ( ret = mbedtls_cipher_init_ctx( &ctx->cipher_ctx, cipher_info ) ) != 0 )
+    if( ( ret = mbedtls_cipher_setup( &ctx->cipher_ctx, cipher_info ) ) != 0 )
         return( ret );
 
     if( ( ret = mbedtls_cipher_setkey( &ctx->cipher_ctx, key, keysize,
diff --git a/library/cipher.c b/library/cipher.c
index d16893b..a558575 100644
--- a/library/cipher.c
+++ b/library/cipher.c
@@ -139,7 +139,7 @@
     mbedtls_zeroize( ctx, sizeof(mbedtls_cipher_context_t) );
 }
 
-int mbedtls_cipher_init_ctx( mbedtls_cipher_context_t *ctx, const mbedtls_cipher_info_t *cipher_info )
+int mbedtls_cipher_setup( mbedtls_cipher_context_t *ctx, const mbedtls_cipher_info_t *cipher_info )
 {
     if( NULL == cipher_info || NULL == ctx )
         return( MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA );
diff --git a/library/gcm.c b/library/gcm.c
index 39648b4..79d433a 100644
--- a/library/gcm.c
+++ b/library/gcm.c
@@ -174,7 +174,7 @@
     if( cipher_info->block_size != 16 )
         return( MBEDTLS_ERR_GCM_BAD_INPUT );
 
-    if( ( ret = mbedtls_cipher_init_ctx( &ctx->cipher_ctx, cipher_info ) ) != 0 )
+    if( ( ret = mbedtls_cipher_setup( &ctx->cipher_ctx, cipher_info ) ) != 0 )
         return( ret );
 
     if( ( ret = mbedtls_cipher_setkey( &ctx->cipher_ctx, key, keysize,
diff --git a/library/pkcs12.c b/library/pkcs12.c
index e3ca995..1baa95c 100644
--- a/library/pkcs12.c
+++ b/library/pkcs12.c
@@ -195,7 +195,7 @@
 
     mbedtls_cipher_init( &cipher_ctx );
 
-    if( ( ret = mbedtls_cipher_init_ctx( &cipher_ctx, cipher_info ) ) != 0 )
+    if( ( ret = mbedtls_cipher_setup( &cipher_ctx, cipher_info ) ) != 0 )
         goto exit;
 
     if( ( ret = mbedtls_cipher_setkey( &cipher_ctx, key, 8 * keylen, (mbedtls_operation_t) mode ) ) != 0 )
diff --git a/library/pkcs5.c b/library/pkcs5.c
index 6163e9a..7564733 100644
--- a/library/pkcs5.c
+++ b/library/pkcs5.c
@@ -198,7 +198,7 @@
         goto exit;
     }
 
-    if( ( ret = mbedtls_cipher_init_ctx( &cipher_ctx, cipher_info ) ) != 0 )
+    if( ( ret = mbedtls_cipher_setup( &cipher_ctx, cipher_info ) ) != 0 )
         goto exit;
 
     if( ( ret = mbedtls_cipher_setkey( &cipher_ctx, key, 8 * keylen, (mbedtls_operation_t) mode ) ) != 0 )
diff --git a/library/ssl_tls.c b/library/ssl_tls.c
index 19d359a..6cf9b74 100644
--- a/library/ssl_tls.c
+++ b/library/ssl_tls.c
@@ -867,17 +867,17 @@
     }
 #endif /* MBEDTLS_SSL_HW_RECORD_ACCEL */
 
-    if( ( ret = mbedtls_cipher_init_ctx( &transform->cipher_ctx_enc,
+    if( ( ret = mbedtls_cipher_setup( &transform->cipher_ctx_enc,
                                  cipher_info ) ) != 0 )
     {
-        MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_cipher_init_ctx", ret );
+        MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_cipher_setup", ret );
         return( ret );
     }
 
-    if( ( ret = mbedtls_cipher_init_ctx( &transform->cipher_ctx_dec,
+    if( ( ret = mbedtls_cipher_setup( &transform->cipher_ctx_dec,
                                  cipher_info ) ) != 0 )
     {
-        MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_cipher_init_ctx", ret );
+        MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_cipher_setup", ret );
         return( ret );
     }
 
diff --git a/programs/aes/crypt_and_hash.c b/programs/aes/crypt_and_hash.c
index 67f47c2..f64c341 100644
--- a/programs/aes/crypt_and_hash.c
+++ b/programs/aes/crypt_and_hash.c
@@ -173,9 +173,9 @@
         mbedtls_fprintf( stderr, "Cipher '%s' not found\n", argv[4] );
         goto exit;
     }
-    if( ( ret = mbedtls_cipher_init_ctx( &cipher_ctx, cipher_info) ) != 0 )
+    if( ( ret = mbedtls_cipher_setup( &cipher_ctx, cipher_info) ) != 0 )
     {
-        mbedtls_fprintf( stderr, "mbedtls_cipher_init_ctx failed\n" );
+        mbedtls_fprintf( stderr, "mbedtls_cipher_setup failed\n" );
         goto exit;
     }
 
diff --git a/scripts/data_files/rename-1.3-2.0.txt b/scripts/data_files/rename-1.3-2.0.txt
index c5c5d00..1bd8c3c 100644
--- a/scripts/data_files/rename-1.3-2.0.txt
+++ b/scripts/data_files/rename-1.3-2.0.txt
@@ -1400,7 +1400,7 @@
 cipher_info_from_values mbedtls_cipher_info_from_values
 cipher_info_t mbedtls_cipher_info_t
 cipher_init mbedtls_cipher_init
-cipher_init_ctx mbedtls_cipher_init_ctx
+cipher_init_ctx mbedtls_cipher_setup
 cipher_list mbedtls_cipher_list
 cipher_mode_t mbedtls_cipher_mode_t
 cipher_padding_t mbedtls_cipher_padding_t
diff --git a/tests/suites/test_suite_cipher.function b/tests/suites/test_suite_cipher.function
index 2d51019..30f154c 100644
--- a/tests/suites/test_suite_cipher.function
+++ b/tests/suites/test_suite_cipher.function
@@ -42,9 +42,9 @@
 
     TEST_ASSERT( mbedtls_cipher_info_from_string( NULL ) == NULL );
 
-    TEST_ASSERT( mbedtls_cipher_init_ctx( &ctx, NULL )
+    TEST_ASSERT( mbedtls_cipher_setup( &ctx, NULL )
                  == MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA );
-    TEST_ASSERT( mbedtls_cipher_init_ctx( NULL, info )
+    TEST_ASSERT( mbedtls_cipher_setup( NULL, info )
                  == MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA );
 
     TEST_ASSERT( mbedtls_cipher_setkey( NULL, buf, 0, MBEDTLS_ENCRYPT )
@@ -122,8 +122,8 @@
     TEST_ASSERT( mbedtls_cipher_info_from_string( cipher_string ) == cipher_info );
 
     /* Initialise enc and dec contexts */
-    TEST_ASSERT( 0 == mbedtls_cipher_init_ctx( &ctx_dec, cipher_info ) );
-    TEST_ASSERT( 0 == mbedtls_cipher_init_ctx( &ctx_enc, cipher_info ) );
+    TEST_ASSERT( 0 == mbedtls_cipher_setup( &ctx_dec, cipher_info ) );
+    TEST_ASSERT( 0 == mbedtls_cipher_setup( &ctx_enc, cipher_info ) );
 
     TEST_ASSERT( 0 == mbedtls_cipher_setkey( &ctx_dec, key, key_len, MBEDTLS_DECRYPT ) );
     TEST_ASSERT( 0 == mbedtls_cipher_setkey( &ctx_enc, key, key_len, MBEDTLS_ENCRYPT ) );
@@ -242,7 +242,7 @@
     TEST_ASSERT( NULL != cipher_info );
 
     /* Initialise context */
-    TEST_ASSERT( 0 == mbedtls_cipher_init_ctx( &ctx, cipher_info ) );
+    TEST_ASSERT( 0 == mbedtls_cipher_setup( &ctx, cipher_info ) );
     TEST_ASSERT( 0 == mbedtls_cipher_setkey( &ctx, key, key_len, MBEDTLS_ENCRYPT ) );
 #if defined(MBEDTLS_CIPHER_MODE_WITH_PADDING)
     TEST_ASSERT( 0 == mbedtls_cipher_set_padding_mode( &ctx, pad_mode ) );
@@ -291,7 +291,7 @@
     cipher_info = mbedtls_cipher_info_from_type( MBEDTLS_CIPHER_AES_128_CBC );
     TEST_ASSERT( NULL != cipher_info);
 
-    TEST_ASSERT( 0 == mbedtls_cipher_init_ctx( &ctx_dec, cipher_info ) );
+    TEST_ASSERT( 0 == mbedtls_cipher_setup( &ctx_dec, cipher_info ) );
 
     TEST_ASSERT( 0 == mbedtls_cipher_setkey( &ctx_dec, key, 128, MBEDTLS_DECRYPT ) );
 
@@ -350,8 +350,8 @@
     cipher_info = mbedtls_cipher_info_from_type( cipher_id );
     TEST_ASSERT( NULL != cipher_info);
 
-    TEST_ASSERT( 0 == mbedtls_cipher_init_ctx( &ctx_dec, cipher_info ) );
-    TEST_ASSERT( 0 == mbedtls_cipher_init_ctx( &ctx_enc, cipher_info ) );
+    TEST_ASSERT( 0 == mbedtls_cipher_setup( &ctx_dec, cipher_info ) );
+    TEST_ASSERT( 0 == mbedtls_cipher_setup( &ctx_enc, cipher_info ) );
 
     TEST_ASSERT( 0 == mbedtls_cipher_setkey( &ctx_dec, key, key_len, MBEDTLS_DECRYPT ) );
     TEST_ASSERT( 0 == mbedtls_cipher_setkey( &ctx_enc, key, key_len, MBEDTLS_ENCRYPT ) );
@@ -450,7 +450,7 @@
 #endif
 
     /* Prepare context */
-    TEST_ASSERT( 0 == mbedtls_cipher_init_ctx( &ctx,
+    TEST_ASSERT( 0 == mbedtls_cipher_setup( &ctx,
                                        mbedtls_cipher_info_from_type( cipher_id ) ) );
     TEST_ASSERT( 0 == mbedtls_cipher_setkey( &ctx, key, 8 * key_len, MBEDTLS_DECRYPT ) );
 #if defined(MBEDTLS_CIPHER_MODE_WITH_PADDING)
@@ -524,7 +524,7 @@
     tag_len     = unhexify( tag,    hex_tag     );
 
     /* Prepare context */
-    TEST_ASSERT( 0 == mbedtls_cipher_init_ctx( &ctx,
+    TEST_ASSERT( 0 == mbedtls_cipher_setup( &ctx,
                                        mbedtls_cipher_info_from_type( cipher_id ) ) );
     TEST_ASSERT( 0 == mbedtls_cipher_setkey( &ctx, key, 8 * key_len, MBEDTLS_DECRYPT ) );
 
@@ -597,7 +597,7 @@
     memset( output, 0x00, sizeof( output ) );
 
     /* Prepare context */
-    TEST_ASSERT( 0 == mbedtls_cipher_init_ctx( &ctx,
+    TEST_ASSERT( 0 == mbedtls_cipher_setup( &ctx,
                                        mbedtls_cipher_info_from_type( cipher_id ) ) );
 
     key_len = unhexify( key, hex_key );
@@ -636,7 +636,7 @@
 
     cipher_info = mbedtls_cipher_info_from_type( cipher_id );
     TEST_ASSERT( NULL != cipher_info );
-    TEST_ASSERT( 0 == mbedtls_cipher_init_ctx( &ctx, cipher_info ) );
+    TEST_ASSERT( 0 == mbedtls_cipher_setup( &ctx, cipher_info ) );
 
     TEST_ASSERT( ret == mbedtls_cipher_set_padding_mode( &ctx, pad_mode ) );