New MD API: rename functions from _ext to _ret
The _ext suffix suggests "new arguments", but the new functions have
the same arguments. Use _ret instead, to convey that the difference is
that the new functions return a value.
diff --git a/include/mbedtls/md2.h b/include/mbedtls/md2.h
index 23145de..0df6b36 100644
--- a/include/mbedtls/md2.h
+++ b/include/mbedtls/md2.h
@@ -86,7 +86,7 @@
*
* \return 0 if successful
*/
-int mbedtls_md2_starts_ext( mbedtls_md2_context *ctx );
+int mbedtls_md2_starts_ret( mbedtls_md2_context *ctx );
/**
* \brief MD2 process buffer
@@ -97,7 +97,7 @@
*
* \return 0 if successful
*/
-int mbedtls_md2_update_ext( mbedtls_md2_context *ctx,
+int mbedtls_md2_update_ret( mbedtls_md2_context *ctx,
const unsigned char *input,
size_t ilen );
@@ -109,7 +109,7 @@
*
* \return 0 if successful
*/
-int mbedtls_md2_finish_ext( mbedtls_md2_context *ctx,
+int mbedtls_md2_finish_ret( mbedtls_md2_context *ctx,
unsigned char output[16] );
/**
@@ -130,20 +130,20 @@
/**
* \brief MD2 context setup
*
- * \deprecated Superseded by mbedtls_md2_starts_ext() in 2.5.0
+ * \deprecated Superseded by mbedtls_md2_starts_ret() in 2.5.0
*
* \param ctx context to be initialized
*/
MBEDTLS_DEPRECATED static inline void mbedtls_md2_starts(
mbedtls_md2_context *ctx )
{
- mbedtls_md2_starts_ext( ctx );
+ mbedtls_md2_starts_ret( ctx );
}
/**
* \brief MD2 process buffer
*
- * \deprecated Superseded by mbedtls_md2_update_ext() in 2.5.0
+ * \deprecated Superseded by mbedtls_md2_update_ret() in 2.5.0
*
* \param ctx MD2 context
* \param input buffer holding the data
@@ -154,13 +154,13 @@
const unsigned char *input,
size_t ilen )
{
- mbedtls_md2_update_ext( ctx, input, ilen );
+ mbedtls_md2_update_ret( ctx, input, ilen );
}
/**
* \brief MD2 final digest
*
- * \deprecated Superseded by mbedtls_md2_finish_ext() in 2.5.0
+ * \deprecated Superseded by mbedtls_md2_finish_ret() in 2.5.0
*
* \param ctx MD2 context
* \param output MD2 checksum result
@@ -169,7 +169,7 @@
mbedtls_md2_context *ctx,
unsigned char output[16] )
{
- mbedtls_md2_finish_ext( ctx, output );
+ mbedtls_md2_finish_ret( ctx, output );
}
/**
@@ -207,7 +207,7 @@
* \param ilen length of the input data
* \param output MD2 checksum result
*/
-int mbedtls_md2_ext( const unsigned char *input,
+int mbedtls_md2_ret( const unsigned char *input,
size_t ilen,
unsigned char output[16] );
@@ -220,7 +220,7 @@
/**
* \brief Output = MD2( input buffer )
*
- * \deprecated Superseded by mbedtls_md2_ext() in 2.5.0
+ * \deprecated Superseded by mbedtls_md2_ret() in 2.5.0
*
* \param input buffer holding the data
* \param ilen length of the input data
@@ -230,7 +230,7 @@
size_t ilen,
unsigned char output[16] )
{
- mbedtls_md2_ext( input, ilen, output );
+ mbedtls_md2_ret( input, ilen, output );
}
#undef MBEDTLS_DEPRECATED
diff --git a/include/mbedtls/md4.h b/include/mbedtls/md4.h
index f5d335d..acd09bd 100644
--- a/include/mbedtls/md4.h
+++ b/include/mbedtls/md4.h
@@ -86,7 +86,7 @@
*
* \return 0 if successful
*/
-int mbedtls_md4_starts_ext( mbedtls_md4_context *ctx );
+int mbedtls_md4_starts_ret( mbedtls_md4_context *ctx );
/**
* \brief MD4 process buffer
@@ -97,7 +97,7 @@
*
* \return 0 if successful
*/
-int mbedtls_md4_update_ext( mbedtls_md4_context *ctx,
+int mbedtls_md4_update_ret( mbedtls_md4_context *ctx,
const unsigned char *input,
size_t ilen );
@@ -109,7 +109,7 @@
*
* \return 0 if successful
*/
-int mbedtls_md4_finish_ext( mbedtls_md4_context *ctx,
+int mbedtls_md4_finish_ret( mbedtls_md4_context *ctx,
unsigned char output[16] );
/**
@@ -132,20 +132,20 @@
/**
* \brief MD4 context setup
*
- * \deprecated Superseded by mbedtls_md4_starts_ext() in 2.5.0
+ * \deprecated Superseded by mbedtls_md4_starts_ret() in 2.5.0
*
* \param ctx context to be initialized
*/
MBEDTLS_DEPRECATED static inline void mbedtls_md4_starts(
mbedtls_md4_context *ctx )
{
- mbedtls_md4_starts_ext( ctx );
+ mbedtls_md4_starts_ret( ctx );
}
/**
* \brief MD4 process buffer
*
- * \deprecated Superseded by mbedtls_md4_update_ext() in 2.5.0
+ * \deprecated Superseded by mbedtls_md4_update_ret() in 2.5.0
*
* \param ctx MD4 context
* \param input buffer holding the data
@@ -156,13 +156,13 @@
const unsigned char *input,
size_t ilen )
{
- mbedtls_md4_update_ext( ctx, input, ilen );
+ mbedtls_md4_update_ret( ctx, input, ilen );
}
/**
* \brief MD4 final digest
*
- * \deprecated Superseded by mbedtls_md4_finish_ext() in 2.5.0
+ * \deprecated Superseded by mbedtls_md4_finish_ret() in 2.5.0
*
* \param ctx MD4 context
* \param output MD4 checksum result
@@ -171,7 +171,7 @@
mbedtls_md4_context *ctx,
unsigned char output[16] )
{
- mbedtls_md4_finish_ext( ctx, output );
+ mbedtls_md4_finish_ret( ctx, output );
}
/**
@@ -213,7 +213,7 @@
*
* \return 0 if successful
*/
-int mbedtls_md4_ext( const unsigned char *input,
+int mbedtls_md4_ret( const unsigned char *input,
size_t ilen,
unsigned char output[16] );
@@ -226,7 +226,7 @@
/**
* \brief Output = MD4( input buffer )
*
- * \deprecated Superseded by mbedtls_md4_ext() in 2.5.0
+ * \deprecated Superseded by mbedtls_md4_ret() in 2.5.0
*
* \param input buffer holding the data
* \param ilen length of the input data
@@ -236,7 +236,7 @@
size_t ilen,
unsigned char output[16] )
{
- mbedtls_md4_ext( input, ilen, output );
+ mbedtls_md4_ret( input, ilen, output );
}
#undef MBEDTLS_DEPRECATED
diff --git a/include/mbedtls/md5.h b/include/mbedtls/md5.h
index 5a7a00a..18db8b7 100644
--- a/include/mbedtls/md5.h
+++ b/include/mbedtls/md5.h
@@ -81,7 +81,7 @@
*
* \return 0 if successful
*/
-int mbedtls_md5_starts_ext( mbedtls_md5_context *ctx );
+int mbedtls_md5_starts_ret( mbedtls_md5_context *ctx );
/**
* \brief MD5 process buffer
@@ -92,7 +92,7 @@
*
* \return 0 if successful
*/
-int mbedtls_md5_update_ext( mbedtls_md5_context *ctx,
+int mbedtls_md5_update_ret( mbedtls_md5_context *ctx,
const unsigned char *input,
size_t ilen );
@@ -104,7 +104,7 @@
*
* \return 0 if successful
*/
-int mbedtls_md5_finish_ext( mbedtls_md5_context *ctx,
+int mbedtls_md5_finish_ret( mbedtls_md5_context *ctx,
unsigned char output[16] );
/**
@@ -127,20 +127,20 @@
/**
* \brief MD5 context setup
*
- * \deprecated Superseded by mbedtls_md5_starts_ext() in 2.5.0
+ * \deprecated Superseded by mbedtls_md5_starts_ret() in 2.5.0
*
* \param ctx context to be initialized
*/
MBEDTLS_DEPRECATED static inline void mbedtls_md5_starts(
mbedtls_md5_context *ctx )
{
- mbedtls_md5_starts_ext( ctx );
+ mbedtls_md5_starts_ret( ctx );
}
/**
* \brief MD5 process buffer
*
- * \deprecated Superseded by mbedtls_md5_update_ext() in 2.5.0
+ * \deprecated Superseded by mbedtls_md5_update_ret() in 2.5.0
*
* \param ctx MD5 context
* \param input buffer holding the data
@@ -151,13 +151,13 @@
const unsigned char *input,
size_t ilen )
{
- mbedtls_md5_update_ext( ctx, input, ilen );
+ mbedtls_md5_update_ret( ctx, input, ilen );
}
/**
* \brief MD5 final digest
*
- * \deprecated Superseded by mbedtls_md5_finish_ext() in 2.5.0
+ * \deprecated Superseded by mbedtls_md5_finish_ret() in 2.5.0
*
* \param ctx MD5 context
* \param output MD5 checksum result
@@ -166,7 +166,7 @@
mbedtls_md5_context *ctx,
unsigned char output[16] )
{
- mbedtls_md5_finish_ext( ctx, output );
+ mbedtls_md5_finish_ret( ctx, output );
}
/**
@@ -208,7 +208,7 @@
*
* \return 0 if successful
*/
-int mbedtls_md5_ext( const unsigned char *input,
+int mbedtls_md5_ret( const unsigned char *input,
size_t ilen,
unsigned char output[16] );
@@ -221,7 +221,7 @@
/**
* \brief Output = MD5( input buffer )
*
- * \deprecated Superseded by mbedtls_md5_ext() in 2.5.0
+ * \deprecated Superseded by mbedtls_md5_ret() in 2.5.0
*
* \param input buffer holding the data
* \param ilen length of the input data
@@ -231,7 +231,7 @@
size_t ilen,
unsigned char output[16] )
{
- mbedtls_md5_ext( input, ilen, output );
+ mbedtls_md5_ret( input, ilen, output );
}
#undef MBEDTLS_DEPRECATED
diff --git a/include/mbedtls/ripemd160.h b/include/mbedtls/ripemd160.h
index 3186359..ea67981 100644
--- a/include/mbedtls/ripemd160.h
+++ b/include/mbedtls/ripemd160.h
@@ -86,7 +86,7 @@
*
* \return 0 if successful
*/
-int mbedtls_ripemd160_starts_ext( mbedtls_ripemd160_context *ctx );
+int mbedtls_ripemd160_starts_ret( mbedtls_ripemd160_context *ctx );
/**
* \brief RIPEMD-160 process buffer
@@ -97,7 +97,7 @@
*
* \return 0 if successful
*/
-int mbedtls_ripemd160_update_ext( mbedtls_ripemd160_context *ctx,
+int mbedtls_ripemd160_update_ret( mbedtls_ripemd160_context *ctx,
const unsigned char *input,
size_t ilen );
@@ -109,7 +109,7 @@
*
* \return 0 if successful
*/
-int mbedtls_ripemd160_finish_ext( mbedtls_ripemd160_context *ctx,
+int mbedtls_ripemd160_finish_ret( mbedtls_ripemd160_context *ctx,
unsigned char output[20] );
/**
@@ -132,20 +132,20 @@
/**
* \brief RIPEMD-160 context setup
*
- * \deprecated Superseded by mbedtls_ripemd160_starts_ext() in 2.5.0
+ * \deprecated Superseded by mbedtls_ripemd160_starts_ret() in 2.5.0
*
* \param ctx context to be initialized
*/
MBEDTLS_DEPRECATED static inline void mbedtls_ripemd160_starts(
mbedtls_ripemd160_context *ctx )
{
- mbedtls_ripemd160_starts_ext( ctx );
+ mbedtls_ripemd160_starts_ret( ctx );
}
/**
* \brief RIPEMD-160 process buffer
*
- * \deprecated Superseded by mbedtls_ripemd160_update_ext() in 2.5.0
+ * \deprecated Superseded by mbedtls_ripemd160_update_ret() in 2.5.0
*
* \param ctx RIPEMD-160 context
* \param input buffer holding the data
@@ -156,13 +156,13 @@
const unsigned char *input,
size_t ilen )
{
- mbedtls_ripemd160_update_ext( ctx, input, ilen );
+ mbedtls_ripemd160_update_ret( ctx, input, ilen );
}
/**
* \brief RIPEMD-160 final digest
*
- * \deprecated Superseded by mbedtls_ripemd160_finish_ext() in 2.5.0
+ * \deprecated Superseded by mbedtls_ripemd160_finish_ret() in 2.5.0
*
* \param ctx RIPEMD-160 context
* \param output RIPEMD-160 checksum result
@@ -171,7 +171,7 @@
mbedtls_ripemd160_context *ctx,
unsigned char output[20] )
{
- mbedtls_ripemd160_finish_ext( ctx, output );
+ mbedtls_ripemd160_finish_ret( ctx, output );
}
/**
@@ -213,7 +213,7 @@
*
* \return 0 if successful
*/
-int mbedtls_ripemd160_ext( const unsigned char *input,
+int mbedtls_ripemd160_ret( const unsigned char *input,
size_t ilen,
unsigned char output[20] );
@@ -226,7 +226,7 @@
/**
* \brief Output = RIPEMD-160( input buffer )
*
- * \deprecated Superseded by mbedtls_ripemd160_ext() in 2.5.0
+ * \deprecated Superseded by mbedtls_ripemd160_ret() in 2.5.0
*
* \param input buffer holding the data
* \param ilen length of the input data
@@ -237,7 +237,7 @@
size_t ilen,
unsigned char output[20] )
{
- mbedtls_ripemd160_ext( input, ilen, output );
+ mbedtls_ripemd160_ret( input, ilen, output );
}
#undef MBEDTLS_DEPRECATED
diff --git a/include/mbedtls/sha1.h b/include/mbedtls/sha1.h
index e18e6ac..57bfea4 100644
--- a/include/mbedtls/sha1.h
+++ b/include/mbedtls/sha1.h
@@ -86,7 +86,7 @@
*
* \return 0 if successful
*/
-int mbedtls_sha1_starts_ext( mbedtls_sha1_context *ctx );
+int mbedtls_sha1_starts_ret( mbedtls_sha1_context *ctx );
/**
* \brief SHA-1 process buffer
@@ -97,7 +97,7 @@
*
* \return 0 if successful
*/
-int mbedtls_sha1_update_ext( mbedtls_sha1_context *ctx,
+int mbedtls_sha1_update_ret( mbedtls_sha1_context *ctx,
const unsigned char *input,
size_t ilen );
@@ -109,7 +109,7 @@
*
* \return 0 if successful
*/
-int mbedtls_sha1_finish_ext( mbedtls_sha1_context *ctx,
+int mbedtls_sha1_finish_ret( mbedtls_sha1_context *ctx,
unsigned char output[20] );
/**
@@ -132,20 +132,20 @@
/**
* \brief SHA-1 context setup
*
- * \deprecated Superseded by mbedtls_sha1_starts_ext() in 2.5.0
+ * \deprecated Superseded by mbedtls_sha1_starts_ret() in 2.5.0
*
* \param ctx context to be initialized
*/
MBEDTLS_DEPRECATED static inline void mbedtls_sha1_starts(
mbedtls_sha1_context *ctx )
{
- mbedtls_sha1_starts_ext( ctx );
+ mbedtls_sha1_starts_ret( ctx );
}
/**
* \brief SHA-1 process buffer
*
- * \deprecated Superseded by mbedtls_sha1_update_ext() in 2.5.0
+ * \deprecated Superseded by mbedtls_sha1_update_ret() in 2.5.0
*
* \param ctx SHA-1 context
* \param input buffer holding the data
@@ -156,13 +156,13 @@
const unsigned char *input,
size_t ilen )
{
- mbedtls_sha1_update_ext( ctx, input, ilen );
+ mbedtls_sha1_update_ret( ctx, input, ilen );
}
/**
* \brief SHA-1 final digest
*
- * \deprecated Superseded by mbedtls_sha1_finish_ext() in 2.5.0
+ * \deprecated Superseded by mbedtls_sha1_finish_ret() in 2.5.0
*
* \param ctx SHA-1 context
* \param output SHA-1 checksum result
@@ -171,7 +171,7 @@
mbedtls_sha1_context *ctx,
unsigned char output[20] )
{
- mbedtls_sha1_finish_ext( ctx, output );
+ mbedtls_sha1_finish_ret( ctx, output );
}
/**
@@ -213,7 +213,7 @@
*
* \return 0 if successful
*/
-int mbedtls_sha1_ext( const unsigned char *input,
+int mbedtls_sha1_ret( const unsigned char *input,
size_t ilen,
unsigned char output[20] );
@@ -226,7 +226,7 @@
/**
* \brief Output = SHA-1( input buffer )
*
- * \deprecated Superseded by mbedtls_sha1_ext() in 2.5.0
+ * \deprecated Superseded by mbedtls_sha1_ret() in 2.5.0
*
* \param input buffer holding the data
* \param ilen length of the input data
@@ -236,7 +236,7 @@
size_t ilen,
unsigned char output[20] )
{
- mbedtls_sha1_ext( input, ilen, output );
+ mbedtls_sha1_ret( input, ilen, output );
}
#undef MBEDTLS_DEPRECATED
diff --git a/include/mbedtls/sha256.h b/include/mbedtls/sha256.h
index 5fce7ee..be5ef79 100644
--- a/include/mbedtls/sha256.h
+++ b/include/mbedtls/sha256.h
@@ -88,7 +88,7 @@
*
* \return 0 if successful
*/
-int mbedtls_sha256_starts_ext( mbedtls_sha256_context *ctx, int is224 );
+int mbedtls_sha256_starts_ret( mbedtls_sha256_context *ctx, int is224 );
/**
* \brief SHA-256 process buffer
@@ -99,7 +99,7 @@
*
* \return 0 if successful
*/
-int mbedtls_sha256_update_ext( mbedtls_sha256_context *ctx,
+int mbedtls_sha256_update_ret( mbedtls_sha256_context *ctx,
const unsigned char *input,
size_t ilen );
@@ -111,7 +111,7 @@
*
* \return 0 if successful
*/
-int mbedtls_sha256_finish_ext( mbedtls_sha256_context *ctx,
+int mbedtls_sha256_finish_ret( mbedtls_sha256_context *ctx,
unsigned char output[32] );
/**
@@ -134,7 +134,7 @@
/**
* \brief SHA-256 context setup
*
- * \deprecated Superseded by mbedtls_sha256_starts_ext() in 2.5.0
+ * \deprecated Superseded by mbedtls_sha256_starts_ret() in 2.5.0
*
* \param ctx context to be initialized
* \param is224 0 = use SHA256, 1 = use SHA224
@@ -143,13 +143,13 @@
mbedtls_sha256_context *ctx,
int is224 )
{
- mbedtls_sha256_starts_ext( ctx, is224 );
+ mbedtls_sha256_starts_ret( ctx, is224 );
}
/**
* \brief SHA-256 process buffer
*
- * \deprecated Superseded by mbedtls_sha256_update_ext() in 2.5.0
+ * \deprecated Superseded by mbedtls_sha256_update_ret() in 2.5.0
*
* \param ctx SHA-256 context
* \param input buffer holding the data
@@ -160,13 +160,13 @@
const unsigned char *input,
size_t ilen )
{
- mbedtls_sha256_update_ext( ctx, input, ilen );
+ mbedtls_sha256_update_ret( ctx, input, ilen );
}
/**
* \brief SHA-256 final digest
*
- * \deprecated Superseded by mbedtls_sha256_finish_ext() in 2.5.0
+ * \deprecated Superseded by mbedtls_sha256_finish_ret() in 2.5.0
*
* \param ctx SHA-256 context
* \param output SHA-224/256 checksum result
@@ -175,7 +175,7 @@
mbedtls_sha256_context *ctx,
unsigned char output[32] )
{
- mbedtls_sha256_finish_ext( ctx, output );
+ mbedtls_sha256_finish_ret( ctx, output );
}
/**
@@ -218,7 +218,7 @@
*
* \return 0 if successful
*/
-int mbedtls_sha256_ext( const unsigned char *input,
+int mbedtls_sha256_ret( const unsigned char *input,
size_t ilen,
unsigned char output[32],
int is224 );
@@ -232,7 +232,7 @@
/**
* \brief Output = SHA-256( input buffer )
*
- * \deprecated Superseded by mbedtls_sha256_ext() in 2.5.0
+ * \deprecated Superseded by mbedtls_sha256_ret() in 2.5.0
*
* \param input buffer holding the data
* \param ilen length of the input data
@@ -245,7 +245,7 @@
unsigned char output[32],
int is224 )
{
- mbedtls_sha256_ext( input, ilen, output, is224 );
+ mbedtls_sha256_ret( input, ilen, output, is224 );
}
#undef MBEDTLS_DEPRECATED
diff --git a/include/mbedtls/sha512.h b/include/mbedtls/sha512.h
index 7cba3f6..0fadb4c 100644
--- a/include/mbedtls/sha512.h
+++ b/include/mbedtls/sha512.h
@@ -88,7 +88,7 @@
*
* \return 0 if successful
*/
-int mbedtls_sha512_starts_ext( mbedtls_sha512_context *ctx, int is384 );
+int mbedtls_sha512_starts_ret( mbedtls_sha512_context *ctx, int is384 );
/**
* \brief SHA-512 process buffer
@@ -99,7 +99,7 @@
*
* \return 0 if successful
*/
-int mbedtls_sha512_update_ext( mbedtls_sha512_context *ctx,
+int mbedtls_sha512_update_ret( mbedtls_sha512_context *ctx,
const unsigned char *input,
size_t ilen );
@@ -111,7 +111,7 @@
*
* \return 0 if successful
*/
-int mbedtls_sha512_finish_ext( mbedtls_sha512_context *ctx,
+int mbedtls_sha512_finish_ret( mbedtls_sha512_context *ctx,
unsigned char output[64] );
/**
@@ -134,7 +134,7 @@
/**
* \brief SHA-512 context setup
*
- * \deprecated Superseded by mbedtls_sha512_starts_ext() in 2.5.0
+ * \deprecated Superseded by mbedtls_sha512_starts_ret() in 2.5.0
*
* \param ctx context to be initialized
* \param is384 0 = use SHA512, 1 = use SHA384
@@ -143,13 +143,13 @@
mbedtls_sha512_context *ctx,
int is384 )
{
- mbedtls_sha512_starts_ext( ctx, is384 );
+ mbedtls_sha512_starts_ret( ctx, is384 );
}
/**
* \brief SHA-512 process buffer
*
- * \deprecated Superseded by mbedtls_sha512_update_ext() in 2.5.0
+ * \deprecated Superseded by mbedtls_sha512_update_ret() in 2.5.0
*
* \param ctx SHA-512 context
* \param input buffer holding the data
@@ -160,13 +160,13 @@
const unsigned char *input,
size_t ilen )
{
- mbedtls_sha512_update_ext( ctx, input, ilen );
+ mbedtls_sha512_update_ret( ctx, input, ilen );
}
/**
* \brief SHA-512 final digest
*
- * \deprecated Superseded by mbedtls_sha512_finish_ext() in 2.5.0
+ * \deprecated Superseded by mbedtls_sha512_finish_ret() in 2.5.0
*
* \param ctx SHA-512 context
* \param output SHA-384/512 checksum result
@@ -175,7 +175,7 @@
mbedtls_sha512_context *ctx,
unsigned char output[64] )
{
- mbedtls_sha512_finish_ext( ctx, output );
+ mbedtls_sha512_finish_ret( ctx, output );
}
/**
@@ -218,7 +218,7 @@
*
* \return 0 if successful
*/
-int mbedtls_sha512_ext( const unsigned char *input,
+int mbedtls_sha512_ret( const unsigned char *input,
size_t ilen,
unsigned char output[64],
int is384 );
@@ -232,7 +232,7 @@
/**
* \brief Output = SHA-512( input buffer )
*
- * \deprecated Superseded by mbedtls_sha512_ext() in 2.5.0
+ * \deprecated Superseded by mbedtls_sha512_ret() in 2.5.0
*
* \param input buffer holding the data
* \param ilen length of the input data
@@ -245,7 +245,7 @@
unsigned char output[64],
int is384 )
{
- mbedtls_sha512_ext( input, ilen, output, is384 );
+ mbedtls_sha512_ret( input, ilen, output, is384 );
}
#undef MBEDTLS_DEPRECATED
diff --git a/library/entropy.c b/library/entropy.c
index 45b2f2b..20b24ff 100644
--- a/library/entropy.c
+++ b/library/entropy.c
@@ -193,10 +193,10 @@
if( use_len > MBEDTLS_ENTROPY_BLOCK_SIZE )
{
#if defined(MBEDTLS_ENTROPY_SHA512_ACCUMULATOR)
- if( ( ret = mbedtls_sha512_ext( data, len, tmp, 0 ) ) != 0 )
+ if( ( ret = mbedtls_sha512_ret( data, len, tmp, 0 ) ) != 0 )
return( ret );
#else
- if( ( ret = mbedtls_sha256_ext( data, len, tmp, 0 ) ) != 0 )
+ if( ( ret = mbedtls_sha256_ret( data, len, tmp, 0 ) ) != 0 )
return( ret );
#endif
p = tmp;
@@ -213,22 +213,22 @@
*/
#if defined(MBEDTLS_ENTROPY_SHA512_ACCUMULATOR)
if( ctx->accumulator_started == 0 &&
- ( ret = mbedtls_sha512_starts_ext( &ctx->accumulator, 0 ) ) != 0 )
+ ( ret = mbedtls_sha512_starts_ret( &ctx->accumulator, 0 ) ) != 0 )
return( ret );
else
ctx->accumulator_started = 1;
- if( ( ret = mbedtls_sha512_update_ext( &ctx->accumulator, header, 2 ) ) != 0 )
+ if( ( ret = mbedtls_sha512_update_ret( &ctx->accumulator, header, 2 ) ) != 0 )
return( ret );
- return( mbedtls_sha512_update_ext( &ctx->accumulator, p, use_len ) );
+ return( mbedtls_sha512_update_ret( &ctx->accumulator, p, use_len ) );
#else
if( ctx->accumulator_started == 0 &&
- ( ret = mbedtls_sha256_starts_ext( &ctx->accumulator, 0 ) ) != 0 )
+ ( ret = mbedtls_sha256_starts_ret( &ctx->accumulator, 0 ) ) != 0 )
return( ret );
else
ctx->accumulator_started = 1;
- if( ( ret = mbedtls_sha256_update_ext( &ctx->accumulator, header, 2 ) ) != 0 )
+ if( ( ret = mbedtls_sha256_update_ret( &ctx->accumulator, header, 2 ) ) != 0 )
return( ret );
- return( mbedtls_sha256_update_ext( &ctx->accumulator, p, use_len ) );
+ return( mbedtls_sha256_update_ret( &ctx->accumulator, p, use_len ) );
#endif
}
@@ -374,7 +374,7 @@
* in a previous call to entropy_update(). If this is not guaranteed, the
* code below will fail.
*/
- if( ( ret = mbedtls_sha512_finish_ext( &ctx->accumulator, buf ) ) != 0 )
+ if( ( ret = mbedtls_sha512_finish_ret( &ctx->accumulator, buf ) ) != 0 )
goto exit;
/*
@@ -382,20 +382,20 @@
*/
mbedtls_sha512_free( &ctx->accumulator );
mbedtls_sha512_init( &ctx->accumulator );
- if( ( ret = mbedtls_sha512_starts_ext( &ctx->accumulator, 0 ) ) != 0 )
+ if( ( ret = mbedtls_sha512_starts_ret( &ctx->accumulator, 0 ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_sha512_update_ext( &ctx->accumulator, buf,
+ if( ( ret = mbedtls_sha512_update_ret( &ctx->accumulator, buf,
MBEDTLS_ENTROPY_BLOCK_SIZE ) ) != 0 )
goto exit;
/*
* Perform second SHA-512 on entropy
*/
- if( ( ret = mbedtls_sha512_ext( buf, MBEDTLS_ENTROPY_BLOCK_SIZE,
+ if( ( ret = mbedtls_sha512_ret( buf, MBEDTLS_ENTROPY_BLOCK_SIZE,
buf, 0 ) ) != 0 )
goto exit;
#else /* MBEDTLS_ENTROPY_SHA512_ACCUMULATOR */
- if( ( ret = mbedtls_sha256_finish_ext( &ctx->accumulator, buf ) ) != 0 )
+ if( ( ret = mbedtls_sha256_finish_ret( &ctx->accumulator, buf ) ) != 0 )
goto exit;
/*
@@ -403,16 +403,16 @@
*/
mbedtls_sha256_free( &ctx->accumulator );
mbedtls_sha256_init( &ctx->accumulator );
- if( ( ret = mbedtls_sha256_starts_ext( &ctx->accumulator, 0 ) ) != 0 )
+ if( ( ret = mbedtls_sha256_starts_ret( &ctx->accumulator, 0 ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_sha256_update_ext( &ctx->accumulator, buf,
+ if( ( ret = mbedtls_sha256_update_ret( &ctx->accumulator, buf,
MBEDTLS_ENTROPY_BLOCK_SIZE ) ) != 0 )
goto exit;
/*
* Perform second SHA-256 on entropy
*/
- if( ( ret = mbedtls_sha256_ext( buf, MBEDTLS_ENTROPY_BLOCK_SIZE,
+ if( ( ret = mbedtls_sha256_ret( buf, MBEDTLS_ENTROPY_BLOCK_SIZE,
buf, 0 ) ) != 0 )
goto exit;
#endif /* MBEDTLS_ENTROPY_SHA512_ACCUMULATOR */
diff --git a/library/md2.c b/library/md2.c
index 06d6ac2..5028e8c 100644
--- a/library/md2.c
+++ b/library/md2.c
@@ -105,7 +105,7 @@
/*
* MD2 context setup
*/
-int mbedtls_md2_starts_ext( mbedtls_md2_context *ctx )
+int mbedtls_md2_starts_ret( mbedtls_md2_context *ctx )
{
memset( ctx->cksum, 0, 16 );
memset( ctx->state, 0, 46 );
@@ -156,7 +156,7 @@
/*
* MD2 process buffer
*/
-int mbedtls_md2_update_ext( mbedtls_md2_context *ctx,
+int mbedtls_md2_update_ret( mbedtls_md2_context *ctx,
const unsigned char *input,
size_t ilen )
{
@@ -190,7 +190,7 @@
/*
* MD2 final digest
*/
-int mbedtls_md2_finish_ext( mbedtls_md2_context *ctx,
+int mbedtls_md2_finish_ret( mbedtls_md2_context *ctx,
unsigned char output[16] )
{
int ret;
@@ -219,7 +219,7 @@
/*
* output = MD2( input buffer )
*/
-int mbedtls_md2_ext( const unsigned char *input,
+int mbedtls_md2_ret( const unsigned char *input,
size_t ilen,
unsigned char output[16] )
{
@@ -228,13 +228,13 @@
mbedtls_md2_init( &ctx );
- if( ( ret = mbedtls_md2_starts_ext( &ctx ) ) != 0 )
+ if( ( ret = mbedtls_md2_starts_ret( &ctx ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_md2_update_ext( &ctx, input, ilen ) ) != 0 )
+ if( ( ret = mbedtls_md2_update_ret( &ctx, input, ilen ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_md2_finish_ext( &ctx, output ) ) != 0 )
+ if( ( ret = mbedtls_md2_finish_ret( &ctx, output ) ) != 0 )
goto exit;
exit:
@@ -296,7 +296,7 @@
if( verbose != 0 )
mbedtls_printf( " MD2 test #%d: ", i + 1 );
- ret = mbedtls_md2_ext( md2_test_str[i], md2_test_strlen[i], md2sum );
+ ret = mbedtls_md2_ret( md2_test_str[i], md2_test_strlen[i], md2sum );
if( ret != 0 )
goto fail;
diff --git a/library/md4.c b/library/md4.c
index f5972eb..34a4b0e 100644
--- a/library/md4.c
+++ b/library/md4.c
@@ -98,7 +98,7 @@
/*
* MD4 context setup
*/
-int mbedtls_md4_starts_ext( mbedtls_md4_context *ctx )
+int mbedtls_md4_starts_ret( mbedtls_md4_context *ctx )
{
ctx->total[0] = 0;
ctx->total[1] = 0;
@@ -222,7 +222,7 @@
/*
* MD4 process buffer
*/
-int mbedtls_md4_update_ext( mbedtls_md4_context *ctx,
+int mbedtls_md4_update_ret( mbedtls_md4_context *ctx,
const unsigned char *input,
size_t ilen )
{
@@ -284,7 +284,7 @@
/*
* MD4 final digest
*/
-int mbedtls_md4_finish_ext( mbedtls_md4_context *ctx,
+int mbedtls_md4_finish_ret( mbedtls_md4_context *ctx,
unsigned char output[16] )
{
int ret;
@@ -302,11 +302,11 @@
last = ctx->total[0] & 0x3F;
padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last );
- ret = mbedtls_md4_update_ext( ctx, (unsigned char *)md4_padding, padn );
+ ret = mbedtls_md4_update_ret( ctx, (unsigned char *)md4_padding, padn );
if( ret != 0 )
return( ret );
- if( ( ret = mbedtls_md4_update_ext( ctx, msglen, 8 ) ) != 0 )
+ if( ( ret = mbedtls_md4_update_ret( ctx, msglen, 8 ) ) != 0 )
return( ret );
@@ -323,7 +323,7 @@
/*
* output = MD4( input buffer )
*/
-int mbedtls_md4_ext( const unsigned char *input,
+int mbedtls_md4_ret( const unsigned char *input,
size_t ilen,
unsigned char output[16] )
{
@@ -332,13 +332,13 @@
mbedtls_md4_init( &ctx );
- if( ( ret = mbedtls_md4_starts_ext( &ctx ) ) != 0 )
+ if( ( ret = mbedtls_md4_starts_ret( &ctx ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_md4_update_ext( &ctx, input, ilen ) ) != 0 )
+ if( ( ret = mbedtls_md4_update_ret( &ctx, input, ilen ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_md4_finish_ext( &ctx, output ) ) != 0 )
+ if( ( ret = mbedtls_md4_finish_ret( &ctx, output ) ) != 0 )
goto exit;
exit:
@@ -400,7 +400,7 @@
if( verbose != 0 )
mbedtls_printf( " MD4 test #%d: ", i + 1 );
- ret = mbedtls_md4_ext( md4_test_str[i], md4_test_strlen[i], md4sum );
+ ret = mbedtls_md4_ret( md4_test_str[i], md4_test_strlen[i], md4sum );
if( ret != 0 )
goto fail;
diff --git a/library/md5.c b/library/md5.c
index 68a112a..8872dc4 100644
--- a/library/md5.c
+++ b/library/md5.c
@@ -97,7 +97,7 @@
/*
* MD5 context setup
*/
-int mbedtls_md5_starts_ext( mbedtls_md5_context *ctx )
+int mbedtls_md5_starts_ret( mbedtls_md5_context *ctx )
{
ctx->total[0] = 0;
ctx->total[1] = 0;
@@ -241,7 +241,7 @@
/*
* MD5 process buffer
*/
-int mbedtls_md5_update_ext( mbedtls_md5_context *ctx,
+int mbedtls_md5_update_ret( mbedtls_md5_context *ctx,
const unsigned char *input,
size_t ilen )
{
@@ -300,7 +300,7 @@
/*
* MD5 final digest
*/
-int mbedtls_md5_finish_ext( mbedtls_md5_context *ctx,
+int mbedtls_md5_finish_ret( mbedtls_md5_context *ctx,
unsigned char output[16] )
{
int ret;
@@ -318,10 +318,10 @@
last = ctx->total[0] & 0x3F;
padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last );
- if( ( ret = mbedtls_md5_update_ext( ctx, md5_padding, padn ) ) != 0 )
+ if( ( ret = mbedtls_md5_update_ret( ctx, md5_padding, padn ) ) != 0 )
return( ret );
- if( ( ret = mbedtls_md5_update_ext( ctx, msglen, 8 ) ) != 0 )
+ if( ( ret = mbedtls_md5_update_ret( ctx, msglen, 8 ) ) != 0 )
return( ret );
PUT_UINT32_LE( ctx->state[0], output, 0 );
@@ -337,7 +337,7 @@
/*
* output = MD5( input buffer )
*/
-int mbedtls_md5_ext( const unsigned char *input,
+int mbedtls_md5_ret( const unsigned char *input,
size_t ilen,
unsigned char output[16] )
{
@@ -346,13 +346,13 @@
mbedtls_md5_init( &ctx );
- if( ( ret = mbedtls_md5_starts_ext( &ctx ) ) != 0 )
+ if( ( ret = mbedtls_md5_starts_ret( &ctx ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_md5_update_ext( &ctx, input, ilen ) ) != 0 )
+ if( ( ret = mbedtls_md5_update_ret( &ctx, input, ilen ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_md5_finish_ext( &ctx, output ) ) != 0 )
+ if( ( ret = mbedtls_md5_finish_ret( &ctx, output ) ) != 0 )
goto exit;
exit:
@@ -413,7 +413,7 @@
if( verbose != 0 )
mbedtls_printf( " MD5 test #%d: ", i + 1 );
- ret = mbedtls_md5_ext( md5_test_buf[i], md5_test_buflen[i], md5sum );
+ ret = mbedtls_md5_ret( md5_test_buf[i], md5_test_buflen[i], md5sum );
if( ret != 0 )
goto fail;
diff --git a/library/md_wrap.c b/library/md_wrap.c
index bfd4927..32f0871 100644
--- a/library/md_wrap.c
+++ b/library/md_wrap.c
@@ -73,18 +73,18 @@
static int md2_starts_wrap( void *ctx )
{
- return( mbedtls_md2_starts_ext( (mbedtls_md2_context *) ctx ) );
+ return( mbedtls_md2_starts_ret( (mbedtls_md2_context *) ctx ) );
}
static int md2_update_wrap( void *ctx, const unsigned char *input,
size_t ilen )
{
- return( mbedtls_md2_update_ext( (mbedtls_md2_context *) ctx, input, ilen ) );
+ return( mbedtls_md2_update_ret( (mbedtls_md2_context *) ctx, input, ilen ) );
}
static int md2_finish_wrap( void *ctx, unsigned char *output )
{
- return( mbedtls_md2_finish_ext( (mbedtls_md2_context *) ctx, output ) );
+ return( mbedtls_md2_finish_ret( (mbedtls_md2_context *) ctx, output ) );
}
static void *md2_ctx_alloc( void )
@@ -124,7 +124,7 @@
md2_starts_wrap,
md2_update_wrap,
md2_finish_wrap,
- mbedtls_md2_ext,
+ mbedtls_md2_ret,
md2_ctx_alloc,
md2_ctx_free,
md2_clone_wrap,
@@ -137,18 +137,18 @@
static int md4_starts_wrap( void *ctx )
{
- return( mbedtls_md4_starts_ext( (mbedtls_md4_context *) ctx ) );
+ return( mbedtls_md4_starts_ret( (mbedtls_md4_context *) ctx ) );
}
static int md4_update_wrap( void *ctx, const unsigned char *input,
size_t ilen )
{
- return( mbedtls_md4_update_ext( (mbedtls_md4_context *) ctx, input, ilen ) );
+ return( mbedtls_md4_update_ret( (mbedtls_md4_context *) ctx, input, ilen ) );
}
static int md4_finish_wrap( void *ctx, unsigned char *output )
{
- return( mbedtls_md4_finish_ext( (mbedtls_md4_context *) ctx, output ) );
+ return( mbedtls_md4_finish_ret( (mbedtls_md4_context *) ctx, output ) );
}
static void *md4_ctx_alloc( void )
@@ -186,7 +186,7 @@
md4_starts_wrap,
md4_update_wrap,
md4_finish_wrap,
- mbedtls_md4_ext,
+ mbedtls_md4_ret,
md4_ctx_alloc,
md4_ctx_free,
md4_clone_wrap,
@@ -199,18 +199,18 @@
static int md5_starts_wrap( void *ctx )
{
- return( mbedtls_md5_starts_ext( (mbedtls_md5_context *) ctx ) );
+ return( mbedtls_md5_starts_ret( (mbedtls_md5_context *) ctx ) );
}
static int md5_update_wrap( void *ctx, const unsigned char *input,
size_t ilen )
{
- return( mbedtls_md5_update_ext( (mbedtls_md5_context *) ctx, input, ilen ) );
+ return( mbedtls_md5_update_ret( (mbedtls_md5_context *) ctx, input, ilen ) );
}
static int md5_finish_wrap( void *ctx, unsigned char *output )
{
- return( mbedtls_md5_finish_ext( (mbedtls_md5_context *) ctx, output ) );
+ return( mbedtls_md5_finish_ret( (mbedtls_md5_context *) ctx, output ) );
}
static void *md5_ctx_alloc( void )
@@ -248,7 +248,7 @@
md5_starts_wrap,
md5_update_wrap,
md5_finish_wrap,
- mbedtls_md5_ext,
+ mbedtls_md5_ret,
md5_ctx_alloc,
md5_ctx_free,
md5_clone_wrap,
@@ -261,19 +261,19 @@
static int ripemd160_starts_wrap( void *ctx )
{
- return( mbedtls_ripemd160_starts_ext( (mbedtls_ripemd160_context *) ctx ) );
+ return( mbedtls_ripemd160_starts_ret( (mbedtls_ripemd160_context *) ctx ) );
}
static int ripemd160_update_wrap( void *ctx, const unsigned char *input,
size_t ilen )
{
- return( mbedtls_ripemd160_update_ext( (mbedtls_ripemd160_context *) ctx,
+ return( mbedtls_ripemd160_update_ret( (mbedtls_ripemd160_context *) ctx,
input, ilen ) );
}
static int ripemd160_finish_wrap( void *ctx, unsigned char *output )
{
- return( mbedtls_ripemd160_finish_ext( (mbedtls_ripemd160_context *) ctx,
+ return( mbedtls_ripemd160_finish_ret( (mbedtls_ripemd160_context *) ctx,
output ) );
}
@@ -313,7 +313,7 @@
ripemd160_starts_wrap,
ripemd160_update_wrap,
ripemd160_finish_wrap,
- mbedtls_ripemd160_ext,
+ mbedtls_ripemd160_ret,
ripemd160_ctx_alloc,
ripemd160_ctx_free,
ripemd160_clone_wrap,
@@ -326,19 +326,19 @@
static int sha1_starts_wrap( void *ctx )
{
- return( mbedtls_sha1_starts_ext( (mbedtls_sha1_context *) ctx ) );
+ return( mbedtls_sha1_starts_ret( (mbedtls_sha1_context *) ctx ) );
}
static int sha1_update_wrap( void *ctx, const unsigned char *input,
size_t ilen )
{
- return( mbedtls_sha1_update_ext( (mbedtls_sha1_context *) ctx,
+ return( mbedtls_sha1_update_ret( (mbedtls_sha1_context *) ctx,
input, ilen ) );
}
static int sha1_finish_wrap( void *ctx, unsigned char *output )
{
- return( mbedtls_sha1_finish_ext( (mbedtls_sha1_context *) ctx, output ) );
+ return( mbedtls_sha1_finish_ret( (mbedtls_sha1_context *) ctx, output ) );
}
static void *sha1_ctx_alloc( void )
@@ -377,7 +377,7 @@
sha1_starts_wrap,
sha1_update_wrap,
sha1_finish_wrap,
- mbedtls_sha1_ext,
+ mbedtls_sha1_ret,
sha1_ctx_alloc,
sha1_ctx_free,
sha1_clone_wrap,
@@ -393,26 +393,26 @@
static int sha224_starts_wrap( void *ctx )
{
- return( mbedtls_sha256_starts_ext( (mbedtls_sha256_context *) ctx, 1 ) );
+ return( mbedtls_sha256_starts_ret( (mbedtls_sha256_context *) ctx, 1 ) );
}
static int sha224_update_wrap( void *ctx, const unsigned char *input,
size_t ilen )
{
- return( mbedtls_sha256_update_ext( (mbedtls_sha256_context *) ctx,
+ return( mbedtls_sha256_update_ret( (mbedtls_sha256_context *) ctx,
input, ilen ) );
}
static int sha224_finish_wrap( void *ctx, unsigned char *output )
{
- return( mbedtls_sha256_finish_ext( (mbedtls_sha256_context *) ctx,
+ return( mbedtls_sha256_finish_ret( (mbedtls_sha256_context *) ctx,
output ) );
}
static int sha224_wrap( const unsigned char *input, size_t ilen,
unsigned char *output )
{
- return( mbedtls_sha256_ext( input, ilen, output, 1 ) );
+ return( mbedtls_sha256_ret( input, ilen, output, 1 ) );
}
static void *sha224_ctx_alloc( void )
@@ -460,13 +460,13 @@
static int sha256_starts_wrap( void *ctx )
{
- return( mbedtls_sha256_starts_ext( (mbedtls_sha256_context *) ctx, 0 ) );
+ return( mbedtls_sha256_starts_ret( (mbedtls_sha256_context *) ctx, 0 ) );
}
static int sha256_wrap( const unsigned char *input, size_t ilen,
unsigned char *output )
{
- return( mbedtls_sha256_ext( input, ilen, output, 0 ) );
+ return( mbedtls_sha256_ret( input, ilen, output, 0 ) );
}
const mbedtls_md_info_t mbedtls_sha256_info = {
@@ -490,26 +490,26 @@
static int sha384_starts_wrap( void *ctx )
{
- return( mbedtls_sha512_starts_ext( (mbedtls_sha512_context *) ctx, 1 ) );
+ return( mbedtls_sha512_starts_ret( (mbedtls_sha512_context *) ctx, 1 ) );
}
static int sha384_update_wrap( void *ctx, const unsigned char *input,
size_t ilen )
{
- return( mbedtls_sha512_update_ext( (mbedtls_sha512_context *) ctx,
+ return( mbedtls_sha512_update_ret( (mbedtls_sha512_context *) ctx,
input, ilen ) );
}
static int sha384_finish_wrap( void *ctx, unsigned char *output )
{
- return( mbedtls_sha512_finish_ext( (mbedtls_sha512_context *) ctx,
+ return( mbedtls_sha512_finish_ret( (mbedtls_sha512_context *) ctx,
output ) );
}
static int sha384_wrap( const unsigned char *input, size_t ilen,
unsigned char *output )
{
- return( mbedtls_sha512_ext( input, ilen, output, 1 ) );
+ return( mbedtls_sha512_ret( input, ilen, output, 1 ) );
}
static void *sha384_ctx_alloc( void )
@@ -557,13 +557,13 @@
static int sha512_starts_wrap( void *ctx )
{
- return( mbedtls_sha512_starts_ext( (mbedtls_sha512_context *) ctx, 0 ) );
+ return( mbedtls_sha512_starts_ret( (mbedtls_sha512_context *) ctx, 0 ) );
}
static int sha512_wrap( const unsigned char *input, size_t ilen,
unsigned char *output )
{
- return( mbedtls_sha512_ext( input, ilen, output, 0 ) );
+ return( mbedtls_sha512_ret( input, ilen, output, 0 ) );
}
const mbedtls_md_info_t mbedtls_sha512_info = {
diff --git a/library/pem.c b/library/pem.c
index dea6f99..bbcfd9b 100644
--- a/library/pem.c
+++ b/library/pem.c
@@ -96,13 +96,13 @@
/*
* key[ 0..15] = MD5(pwd || IV)
*/
- if( ( ret = mbedtls_md5_starts_ext( &md5_ctx ) ) != 0 )
+ if( ( ret = mbedtls_md5_starts_ret( &md5_ctx ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_md5_update_ext( &md5_ctx, pwd, pwdlen ) ) != 0 )
+ if( ( ret = mbedtls_md5_update_ret( &md5_ctx, pwd, pwdlen ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_md5_update_ext( &md5_ctx, iv, 8 ) ) != 0 )
+ if( ( ret = mbedtls_md5_update_ret( &md5_ctx, iv, 8 ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_md5_finish_ext( &md5_ctx, md5sum ) ) != 0 )
+ if( ( ret = mbedtls_md5_finish_ret( &md5_ctx, md5sum ) ) != 0 )
goto exit;
if( keylen <= 16 )
@@ -116,15 +116,15 @@
/*
* key[16..23] = MD5(key[ 0..15] || pwd || IV])
*/
- if( ( ret = mbedtls_md5_starts_ext( &md5_ctx ) ) != 0 )
+ if( ( ret = mbedtls_md5_starts_ret( &md5_ctx ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_md5_update_ext( &md5_ctx, md5sum, 16 ) ) != 0 )
+ if( ( ret = mbedtls_md5_update_ret( &md5_ctx, md5sum, 16 ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_md5_update_ext( &md5_ctx, pwd, pwdlen ) ) != 0 )
+ if( ( ret = mbedtls_md5_update_ret( &md5_ctx, pwd, pwdlen ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_md5_update_ext( &md5_ctx, iv, 8 ) ) != 0 )
+ if( ( ret = mbedtls_md5_update_ret( &md5_ctx, iv, 8 ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_md5_finish_ext( &md5_ctx, md5sum ) ) != 0 )
+ if( ( ret = mbedtls_md5_finish_ret( &md5_ctx, md5sum ) ) != 0 )
goto exit;
use_len = 16;
diff --git a/library/ripemd160.c b/library/ripemd160.c
index 274a7c9..260fee6 100644
--- a/library/ripemd160.c
+++ b/library/ripemd160.c
@@ -96,7 +96,7 @@
/*
* RIPEMD-160 context setup
*/
-int mbedtls_ripemd160_starts_ext( mbedtls_ripemd160_context *ctx )
+int mbedtls_ripemd160_starts_ret( mbedtls_ripemd160_context *ctx )
{
ctx->total[0] = 0;
ctx->total[1] = 0;
@@ -298,7 +298,7 @@
/*
* RIPEMD-160 process buffer
*/
-int mbedtls_ripemd160_update_ext( mbedtls_ripemd160_context *ctx,
+int mbedtls_ripemd160_update_ret( mbedtls_ripemd160_context *ctx,
const unsigned char *input,
size_t ilen )
{
@@ -358,7 +358,7 @@
/*
* RIPEMD-160 final digest
*/
-int mbedtls_ripemd160_finish_ext( mbedtls_ripemd160_context *ctx,
+int mbedtls_ripemd160_finish_ret( mbedtls_ripemd160_context *ctx,
unsigned char output[20] )
{
int ret;
@@ -376,11 +376,11 @@
last = ctx->total[0] & 0x3F;
padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last );
- ret = mbedtls_ripemd160_update_ext( ctx, ripemd160_padding, padn );
+ ret = mbedtls_ripemd160_update_ret( ctx, ripemd160_padding, padn );
if( ret != 0 )
return( ret );
- ret = mbedtls_ripemd160_update_ext( ctx, msglen, 8 );
+ ret = mbedtls_ripemd160_update_ret( ctx, msglen, 8 );
if( ret != 0 )
return( ret );
@@ -396,7 +396,7 @@
/*
* output = RIPEMD-160( input buffer )
*/
-int mbedtls_ripemd160_ext( const unsigned char *input,
+int mbedtls_ripemd160_ret( const unsigned char *input,
size_t ilen,
unsigned char output[20] )
{
@@ -405,13 +405,13 @@
mbedtls_ripemd160_init( &ctx );
- if( ( ret = mbedtls_ripemd160_starts_ext( &ctx ) ) != 0 )
+ if( ( ret = mbedtls_ripemd160_starts_ret( &ctx ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_ripemd160_update_ext( &ctx, input, ilen ) ) != 0 )
+ if( ( ret = mbedtls_ripemd160_update_ret( &ctx, input, ilen ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_ripemd160_finish_ext( &ctx, output ) ) != 0 )
+ if( ( ret = mbedtls_ripemd160_finish_ret( &ctx, output ) ) != 0 )
goto exit;
exit:
@@ -479,7 +479,7 @@
if( verbose != 0 )
mbedtls_printf( " RIPEMD-160 test #%d: ", i + 1 );
- ret = mbedtls_ripemd160_ext( ripemd160_test_str[i],
+ ret = mbedtls_ripemd160_ret( ripemd160_test_str[i],
ripemd160_test_strlen[i], output );
if( ret != 0 )
goto fail;
diff --git a/library/rsa.c b/library/rsa.c
index ab0bd67..1909744 100644
--- a/library/rsa.c
+++ b/library/rsa.c
@@ -2259,7 +2259,7 @@
if( verbose != 0 )
mbedtls_printf( " PKCS#1 data sign : " );
- if( mbedtls_sha1_ext( rsa_plaintext, PT_LEN, sha1sum ) != 0 )
+ if( mbedtls_sha1_ret( rsa_plaintext, PT_LEN, sha1sum ) != 0 )
{
if( verbose != 0 )
mbedtls_printf( "failed\n" );
diff --git a/library/sha1.c b/library/sha1.c
index 8d38950..8432eba 100644
--- a/library/sha1.c
+++ b/library/sha1.c
@@ -97,7 +97,7 @@
/*
* SHA-1 context setup
*/
-int mbedtls_sha1_starts_ext( mbedtls_sha1_context *ctx )
+int mbedtls_sha1_starts_ret( mbedtls_sha1_context *ctx )
{
ctx->total[0] = 0;
ctx->total[1] = 0;
@@ -275,7 +275,7 @@
/*
* SHA-1 process buffer
*/
-int mbedtls_sha1_update_ext( mbedtls_sha1_context *ctx,
+int mbedtls_sha1_update_ret( mbedtls_sha1_context *ctx,
const unsigned char *input,
size_t ilen )
{
@@ -333,7 +333,7 @@
/*
* SHA-1 final digest
*/
-int mbedtls_sha1_finish_ext( mbedtls_sha1_context *ctx,
+int mbedtls_sha1_finish_ret( mbedtls_sha1_context *ctx,
unsigned char output[20] )
{
int ret;
@@ -351,9 +351,9 @@
last = ctx->total[0] & 0x3F;
padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last );
- if( ( ret = mbedtls_sha1_update_ext( ctx, sha1_padding, padn ) ) != 0 )
+ if( ( ret = mbedtls_sha1_update_ret( ctx, sha1_padding, padn ) ) != 0 )
return( ret );
- if( ( ret = mbedtls_sha1_update_ext( ctx, msglen, 8 ) ) != 0 )
+ if( ( ret = mbedtls_sha1_update_ret( ctx, msglen, 8 ) ) != 0 )
return( ret );
PUT_UINT32_BE( ctx->state[0], output, 0 );
@@ -370,7 +370,7 @@
/*
* output = SHA-1( input buffer )
*/
-int mbedtls_sha1_ext( const unsigned char *input,
+int mbedtls_sha1_ret( const unsigned char *input,
size_t ilen,
unsigned char output[20] )
{
@@ -379,13 +379,13 @@
mbedtls_sha1_init( &ctx );
- if( ( ret = mbedtls_sha1_starts_ext( &ctx ) ) != 0 )
+ if( ( ret = mbedtls_sha1_starts_ret( &ctx ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_sha1_update_ext( &ctx, input, ilen ) ) != 0 )
+ if( ( ret = mbedtls_sha1_update_ret( &ctx, input, ilen ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_sha1_finish_ext( &ctx, output ) ) != 0 )
+ if( ( ret = mbedtls_sha1_finish_ret( &ctx, output ) ) != 0 )
goto exit;
exit:
@@ -440,7 +440,7 @@
if( verbose != 0 )
mbedtls_printf( " SHA-1 test #%d: ", i + 1 );
- if( ( ret = mbedtls_sha1_starts_ext( &ctx ) ) != 0 )
+ if( ( ret = mbedtls_sha1_starts_ret( &ctx ) ) != 0 )
goto fail;
if( i == 2 )
@@ -449,20 +449,20 @@
for( j = 0; j < 1000; j++ )
{
- ret = mbedtls_sha1_update_ext( &ctx, buf, buflen );
+ ret = mbedtls_sha1_update_ret( &ctx, buf, buflen );
if( ret != 0 )
goto fail;
}
}
else
{
- ret = mbedtls_sha1_update_ext( &ctx, sha1_test_buf[i],
+ ret = mbedtls_sha1_update_ret( &ctx, sha1_test_buf[i],
sha1_test_buflen[i] );
if( ret != 0 )
goto fail;
}
- if( ( ret = mbedtls_sha1_finish_ext( &ctx, sha1sum ) ) != 0 )
+ if( ( ret = mbedtls_sha1_finish_ret( &ctx, sha1sum ) ) != 0 )
goto fail;
if( memcmp( sha1sum, sha1_test_sum[i], 20 ) != 0 )
diff --git a/library/sha256.c b/library/sha256.c
index b765697..abcd64d 100644
--- a/library/sha256.c
+++ b/library/sha256.c
@@ -100,7 +100,7 @@
/*
* SHA-256 context setup
*/
-int mbedtls_sha256_starts_ext( mbedtls_sha256_context *ctx, int is224 )
+int mbedtls_sha256_starts_ret( mbedtls_sha256_context *ctx, int is224 )
{
ctx->total[0] = 0;
ctx->total[1] = 0;
@@ -243,7 +243,7 @@
/*
* SHA-256 process buffer
*/
-int mbedtls_sha256_update_ext( mbedtls_sha256_context *ctx,
+int mbedtls_sha256_update_ret( mbedtls_sha256_context *ctx,
const unsigned char *input,
size_t ilen )
{
@@ -301,7 +301,7 @@
/*
* SHA-256 final digest
*/
-int mbedtls_sha256_finish_ext( mbedtls_sha256_context *ctx,
+int mbedtls_sha256_finish_ret( mbedtls_sha256_context *ctx,
unsigned char output[32] )
{
int ret;
@@ -319,10 +319,10 @@
last = ctx->total[0] & 0x3F;
padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last );
- if( ( ret = mbedtls_sha256_update_ext( ctx, sha256_padding, padn ) ) != 0 )
+ if( ( ret = mbedtls_sha256_update_ret( ctx, sha256_padding, padn ) ) != 0 )
return( ret );
- if( ( ret = mbedtls_sha256_update_ext( ctx, msglen, 8 ) ) != 0 )
+ if( ( ret = mbedtls_sha256_update_ret( ctx, msglen, 8 ) ) != 0 )
return( ret );
PUT_UINT32_BE( ctx->state[0], output, 0 );
@@ -344,7 +344,7 @@
/*
* output = SHA-256( input buffer )
*/
-int mbedtls_sha256_ext( const unsigned char *input,
+int mbedtls_sha256_ret( const unsigned char *input,
size_t ilen,
unsigned char output[32],
int is224 )
@@ -354,13 +354,13 @@
mbedtls_sha256_init( &ctx );
- if( ( ret = mbedtls_sha256_starts_ext( &ctx, is224 ) ) != 0 )
+ if( ( ret = mbedtls_sha256_starts_ret( &ctx, is224 ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_sha256_update_ext( &ctx, input, ilen ) ) != 0 )
+ if( ( ret = mbedtls_sha256_update_ret( &ctx, input, ilen ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_sha256_finish_ext( &ctx, output ) ) != 0 )
+ if( ( ret = mbedtls_sha256_finish_ret( &ctx, output ) ) != 0 )
goto exit;
exit:
@@ -449,7 +449,7 @@
if( verbose != 0 )
mbedtls_printf( " SHA-%d test #%d: ", 256 - k * 32, j + 1 );
- if( ( ret = mbedtls_sha256_starts_ext( &ctx, k ) ) != 0 )
+ if( ( ret = mbedtls_sha256_starts_ret( &ctx, k ) ) != 0 )
goto fail;
if( j == 2 )
@@ -458,7 +458,7 @@
for( j = 0; j < 1000; j++ )
{
- ret = mbedtls_sha256_update_ext( &ctx, buf, buflen );
+ ret = mbedtls_sha256_update_ret( &ctx, buf, buflen );
if( ret != 0 )
goto fail;
}
@@ -466,13 +466,13 @@
}
else
{
- ret = mbedtls_sha256_update_ext( &ctx, sha256_test_buf[j],
+ ret = mbedtls_sha256_update_ret( &ctx, sha256_test_buf[j],
sha256_test_buflen[j] );
if( ret != 0 )
goto fail;
}
- if( ( ret = mbedtls_sha256_finish_ext( &ctx, sha256sum ) ) != 0 )
+ if( ( ret = mbedtls_sha256_finish_ret( &ctx, sha256sum ) ) != 0 )
goto fail;
diff --git a/library/sha512.c b/library/sha512.c
index d0faba9..c99b6da 100644
--- a/library/sha512.c
+++ b/library/sha512.c
@@ -114,7 +114,7 @@
/*
* SHA-512 context setup
*/
-int mbedtls_sha512_starts_ext( mbedtls_sha512_context *ctx, int is384 )
+int mbedtls_sha512_starts_ret( mbedtls_sha512_context *ctx, int is384 )
{
ctx->total[0] = 0;
ctx->total[1] = 0;
@@ -274,7 +274,7 @@
/*
* SHA-512 process buffer
*/
-int mbedtls_sha512_update_ext( mbedtls_sha512_context *ctx,
+int mbedtls_sha512_update_ret( mbedtls_sha512_context *ctx,
const unsigned char *input,
size_t ilen )
{
@@ -335,7 +335,7 @@
/*
* SHA-512 final digest
*/
-int mbedtls_sha512_finish_ext( mbedtls_sha512_context *ctx,
+int mbedtls_sha512_finish_ret( mbedtls_sha512_context *ctx,
unsigned char output[64] )
{
int ret;
@@ -353,10 +353,10 @@
last = (size_t)( ctx->total[0] & 0x7F );
padn = ( last < 112 ) ? ( 112 - last ) : ( 240 - last );
- if( ( ret = mbedtls_sha512_update_ext( ctx, sha512_padding, padn ) ) != 0 )
+ if( ( ret = mbedtls_sha512_update_ret( ctx, sha512_padding, padn ) ) != 0 )
return( ret );
- if( ( ret = mbedtls_sha512_update_ext( ctx, msglen, 16 ) ) != 0 )
+ if( ( ret = mbedtls_sha512_update_ret( ctx, msglen, 16 ) ) != 0 )
return( ret );
PUT_UINT64_BE( ctx->state[0], output, 0 );
@@ -380,7 +380,7 @@
/*
* output = SHA-512( input buffer )
*/
-int mbedtls_sha512_ext( const unsigned char *input,
+int mbedtls_sha512_ret( const unsigned char *input,
size_t ilen,
unsigned char output[64],
int is384 )
@@ -390,13 +390,13 @@
mbedtls_sha512_init( &ctx );
- if( ( ret = mbedtls_sha512_starts_ext( &ctx, is384 ) ) != 0 )
+ if( ( ret = mbedtls_sha512_starts_ret( &ctx, is384 ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_sha512_update_ext( &ctx, input, ilen ) ) != 0 )
+ if( ( ret = mbedtls_sha512_update_ret( &ctx, input, ilen ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_sha512_finish_ext( &ctx, output ) ) != 0 )
+ if( ( ret = mbedtls_sha512_finish_ret( &ctx, output ) ) != 0 )
goto exit;
exit:
@@ -505,7 +505,7 @@
if( verbose != 0 )
mbedtls_printf( " SHA-%d test #%d: ", 512 - k * 128, j + 1 );
- if( ( ret = mbedtls_sha512_starts_ext( &ctx, k ) ) != 0 )
+ if( ( ret = mbedtls_sha512_starts_ret( &ctx, k ) ) != 0 )
goto fail;
if( j == 2 )
@@ -514,20 +514,20 @@
for( j = 0; j < 1000; j++ )
{
- ret = mbedtls_sha512_update_ext( &ctx, buf, buflen );
+ ret = mbedtls_sha512_update_ret( &ctx, buf, buflen );
if( ret != 0 )
goto fail;
}
}
else
{
- ret = mbedtls_sha512_update_ext( &ctx, sha512_test_buf[j],
+ ret = mbedtls_sha512_update_ret( &ctx, sha512_test_buf[j],
sha512_test_buflen[j] );
if( ret != 0 )
goto fail;
}
- if( ( ret = mbedtls_sha512_finish_ext( &ctx, sha512sum ) ) != 0 )
+ if( ( ret = mbedtls_sha512_finish_ret( &ctx, sha512sum ) ) != 0 )
goto fail;
if( memcmp( sha512sum, sha512_test_sum[i], 64 - k * 16 ) != 0 )
diff --git a/library/ssl_tls.c b/library/ssl_tls.c
index 7bee4e8..4f9a084 100644
--- a/library/ssl_tls.c
+++ b/library/ssl_tls.c
@@ -244,24 +244,24 @@
{
memset( padding, (unsigned char) ('A' + i), 1 + i );
- if( ( ret = mbedtls_sha1_starts_ext( &sha1 ) ) != 0 )
+ if( ( ret = mbedtls_sha1_starts_ret( &sha1 ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_sha1_update_ext( &sha1, padding, 1 + i ) ) != 0 )
+ if( ( ret = mbedtls_sha1_update_ret( &sha1, padding, 1 + i ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_sha1_update_ext( &sha1, secret, slen ) ) != 0 )
+ if( ( ret = mbedtls_sha1_update_ret( &sha1, secret, slen ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_sha1_update_ext( &sha1, random, rlen ) ) != 0 )
+ if( ( ret = mbedtls_sha1_update_ret( &sha1, random, rlen ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_sha1_finish_ext( &sha1, sha1sum ) ) != 0 )
+ if( ( ret = mbedtls_sha1_finish_ret( &sha1, sha1sum ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_md5_starts_ext( &md5 ) ) != 0 )
+ if( ( ret = mbedtls_md5_starts_ret( &md5 ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_md5_update_ext( &md5, secret, slen ) ) != 0 )
+ if( ( ret = mbedtls_md5_update_ret( &md5, secret, slen ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_md5_update_ext( &md5, sha1sum, 20 ) ) != 0 )
+ if( ( ret = mbedtls_md5_update_ret( &md5, sha1sum, 20 ) ) != 0 )
goto exit;
- if( ( ret = mbedtls_md5_finish_ext( &md5, dstbuf + i * 16 ) ) != 0 )
+ if( ( ret = mbedtls_md5_finish_ret( &md5, dstbuf + i * 16 ) ) != 0 )
goto exit;
}
@@ -989,25 +989,25 @@
memset( pad_1, 0x36, 48 );
memset( pad_2, 0x5C, 48 );
- mbedtls_md5_update_ext( &md5, ssl->session_negotiate->master, 48 );
- mbedtls_md5_update_ext( &md5, pad_1, 48 );
- mbedtls_md5_finish_ext( &md5, hash );
+ mbedtls_md5_update_ret( &md5, ssl->session_negotiate->master, 48 );
+ mbedtls_md5_update_ret( &md5, pad_1, 48 );
+ mbedtls_md5_finish_ret( &md5, hash );
- mbedtls_md5_starts_ext( &md5 );
- mbedtls_md5_update_ext( &md5, ssl->session_negotiate->master, 48 );
- mbedtls_md5_update_ext( &md5, pad_2, 48 );
- mbedtls_md5_update_ext( &md5, hash, 16 );
- mbedtls_md5_finish_ext( &md5, hash );
+ mbedtls_md5_starts_ret( &md5 );
+ mbedtls_md5_update_ret( &md5, ssl->session_negotiate->master, 48 );
+ mbedtls_md5_update_ret( &md5, pad_2, 48 );
+ mbedtls_md5_update_ret( &md5, hash, 16 );
+ mbedtls_md5_finish_ret( &md5, hash );
- mbedtls_sha1_update_ext( &sha1, ssl->session_negotiate->master, 48 );
- mbedtls_sha1_update_ext( &sha1, pad_1, 40 );
- mbedtls_sha1_finish_ext( &sha1, hash + 16 );
+ mbedtls_sha1_update_ret( &sha1, ssl->session_negotiate->master, 48 );
+ mbedtls_sha1_update_ret( &sha1, pad_1, 40 );
+ mbedtls_sha1_finish_ret( &sha1, hash + 16 );
- mbedtls_sha1_starts_ext( &sha1 );
- mbedtls_sha1_update_ext( &sha1, ssl->session_negotiate->master, 48 );
- mbedtls_sha1_update_ext( &sha1, pad_2, 40 );
- mbedtls_sha1_update_ext( &sha1, hash + 16, 20 );
- mbedtls_sha1_finish_ext( &sha1, hash + 16 );
+ mbedtls_sha1_starts_ret( &sha1 );
+ mbedtls_sha1_update_ret( &sha1, ssl->session_negotiate->master, 48 );
+ mbedtls_sha1_update_ret( &sha1, pad_2, 40 );
+ mbedtls_sha1_update_ret( &sha1, hash + 16, 20 );
+ mbedtls_sha1_finish_ret( &sha1, hash + 16 );
MBEDTLS_SSL_DEBUG_BUF( 3, "calculated verify result", hash, 36 );
MBEDTLS_SSL_DEBUG_MSG( 2, ( "<= calc verify" ) );
@@ -1033,8 +1033,8 @@
mbedtls_md5_clone( &md5, &ssl->handshake->fin_md5 );
mbedtls_sha1_clone( &sha1, &ssl->handshake->fin_sha1 );
- mbedtls_md5_finish_ext( &md5, hash );
- mbedtls_sha1_finish_ext( &sha1, hash + 16 );
+ mbedtls_md5_finish_ret( &md5, hash );
+ mbedtls_sha1_finish_ret( &sha1, hash + 16 );
MBEDTLS_SSL_DEBUG_BUF( 3, "calculated verify result", hash, 36 );
MBEDTLS_SSL_DEBUG_MSG( 2, ( "<= calc verify" ) );
@@ -1057,7 +1057,7 @@
MBEDTLS_SSL_DEBUG_MSG( 2, ( "=> calc verify sha256" ) );
mbedtls_sha256_clone( &sha256, &ssl->handshake->fin_sha256 );
- mbedtls_sha256_finish_ext( &sha256, hash );
+ mbedtls_sha256_finish_ret( &sha256, hash );
MBEDTLS_SSL_DEBUG_BUF( 3, "calculated verify result", hash, 32 );
MBEDTLS_SSL_DEBUG_MSG( 2, ( "<= calc verify" ) );
@@ -1078,7 +1078,7 @@
MBEDTLS_SSL_DEBUG_MSG( 2, ( "=> calc verify sha384" ) );
mbedtls_sha512_clone( &sha512, &ssl->handshake->fin_sha512 );
- mbedtls_sha512_finish_ext( &sha512, hash );
+ mbedtls_sha512_finish_ret( &sha512, hash );
MBEDTLS_SSL_DEBUG_BUF( 3, "calculated verify result", hash, 48 );
MBEDTLS_SSL_DEBUG_MSG( 2, ( "<= calc verify" ) );
@@ -4854,15 +4854,15 @@
{
#if defined(MBEDTLS_SSL_PROTO_SSL3) || defined(MBEDTLS_SSL_PROTO_TLS1) || \
defined(MBEDTLS_SSL_PROTO_TLS1_1)
- mbedtls_md5_starts_ext( &ssl->handshake->fin_md5 );
- mbedtls_sha1_starts_ext( &ssl->handshake->fin_sha1 );
+ mbedtls_md5_starts_ret( &ssl->handshake->fin_md5 );
+ mbedtls_sha1_starts_ret( &ssl->handshake->fin_sha1 );
#endif
#if defined(MBEDTLS_SSL_PROTO_TLS1_2)
#if defined(MBEDTLS_SHA256_C)
- mbedtls_sha256_starts_ext( &ssl->handshake->fin_sha256, 0 );
+ mbedtls_sha256_starts_ret( &ssl->handshake->fin_sha256, 0 );
#endif
#if defined(MBEDTLS_SHA512_C)
- mbedtls_sha512_starts_ext( &ssl->handshake->fin_sha512, 1 );
+ mbedtls_sha512_starts_ret( &ssl->handshake->fin_sha512, 1 );
#endif
#endif /* MBEDTLS_SSL_PROTO_TLS1_2 */
}
@@ -4872,15 +4872,15 @@
{
#if defined(MBEDTLS_SSL_PROTO_SSL3) || defined(MBEDTLS_SSL_PROTO_TLS1) || \
defined(MBEDTLS_SSL_PROTO_TLS1_1)
- mbedtls_md5_update_ext( &ssl->handshake->fin_md5 , buf, len );
- mbedtls_sha1_update_ext( &ssl->handshake->fin_sha1, buf, len );
+ mbedtls_md5_update_ret( &ssl->handshake->fin_md5 , buf, len );
+ mbedtls_sha1_update_ret( &ssl->handshake->fin_sha1, buf, len );
#endif
#if defined(MBEDTLS_SSL_PROTO_TLS1_2)
#if defined(MBEDTLS_SHA256_C)
- mbedtls_sha256_update_ext( &ssl->handshake->fin_sha256, buf, len );
+ mbedtls_sha256_update_ret( &ssl->handshake->fin_sha256, buf, len );
#endif
#if defined(MBEDTLS_SHA512_C)
- mbedtls_sha512_update_ext( &ssl->handshake->fin_sha512, buf, len );
+ mbedtls_sha512_update_ret( &ssl->handshake->fin_sha512, buf, len );
#endif
#endif /* MBEDTLS_SSL_PROTO_TLS1_2 */
}
@@ -4890,8 +4890,8 @@
static void ssl_update_checksum_md5sha1( mbedtls_ssl_context *ssl,
const unsigned char *buf, size_t len )
{
- mbedtls_md5_update_ext( &ssl->handshake->fin_md5 , buf, len );
- mbedtls_sha1_update_ext( &ssl->handshake->fin_sha1, buf, len );
+ mbedtls_md5_update_ret( &ssl->handshake->fin_md5 , buf, len );
+ mbedtls_sha1_update_ret( &ssl->handshake->fin_sha1, buf, len );
}
#endif
@@ -4900,7 +4900,7 @@
static void ssl_update_checksum_sha256( mbedtls_ssl_context *ssl,
const unsigned char *buf, size_t len )
{
- mbedtls_sha256_update_ext( &ssl->handshake->fin_sha256, buf, len );
+ mbedtls_sha256_update_ret( &ssl->handshake->fin_sha256, buf, len );
}
#endif
@@ -4908,7 +4908,7 @@
static void ssl_update_checksum_sha384( mbedtls_ssl_context *ssl,
const unsigned char *buf, size_t len )
{
- mbedtls_sha512_update_ext( &ssl->handshake->fin_sha512, buf, len );
+ mbedtls_sha512_update_ret( &ssl->handshake->fin_sha512, buf, len );
}
#endif
#endif /* MBEDTLS_SSL_PROTO_TLS1_2 */
@@ -4961,29 +4961,29 @@
memset( padbuf, 0x36, 48 );
- mbedtls_md5_update_ext( &md5, (const unsigned char *) sender, 4 );
- mbedtls_md5_update_ext( &md5, session->master, 48 );
- mbedtls_md5_update_ext( &md5, padbuf, 48 );
- mbedtls_md5_finish_ext( &md5, md5sum );
+ mbedtls_md5_update_ret( &md5, (const unsigned char *) sender, 4 );
+ mbedtls_md5_update_ret( &md5, session->master, 48 );
+ mbedtls_md5_update_ret( &md5, padbuf, 48 );
+ mbedtls_md5_finish_ret( &md5, md5sum );
- mbedtls_sha1_update_ext( &sha1, (const unsigned char *) sender, 4 );
- mbedtls_sha1_update_ext( &sha1, session->master, 48 );
- mbedtls_sha1_update_ext( &sha1, padbuf, 40 );
- mbedtls_sha1_finish_ext( &sha1, sha1sum );
+ mbedtls_sha1_update_ret( &sha1, (const unsigned char *) sender, 4 );
+ mbedtls_sha1_update_ret( &sha1, session->master, 48 );
+ mbedtls_sha1_update_ret( &sha1, padbuf, 40 );
+ mbedtls_sha1_finish_ret( &sha1, sha1sum );
memset( padbuf, 0x5C, 48 );
- mbedtls_md5_starts_ext( &md5 );
- mbedtls_md5_update_ext( &md5, session->master, 48 );
- mbedtls_md5_update_ext( &md5, padbuf, 48 );
- mbedtls_md5_update_ext( &md5, md5sum, 16 );
- mbedtls_md5_finish_ext( &md5, buf );
+ mbedtls_md5_starts_ret( &md5 );
+ mbedtls_md5_update_ret( &md5, session->master, 48 );
+ mbedtls_md5_update_ret( &md5, padbuf, 48 );
+ mbedtls_md5_update_ret( &md5, md5sum, 16 );
+ mbedtls_md5_finish_ret( &md5, buf );
- mbedtls_sha1_starts_ext( &sha1 );
- mbedtls_sha1_update_ext( &sha1, session->master, 48 );
- mbedtls_sha1_update_ext( &sha1, padbuf , 40 );
- mbedtls_sha1_update_ext( &sha1, sha1sum, 20 );
- mbedtls_sha1_finish_ext( &sha1, buf + 16 );
+ mbedtls_sha1_starts_ret( &sha1 );
+ mbedtls_sha1_update_ret( &sha1, session->master, 48 );
+ mbedtls_sha1_update_ret( &sha1, padbuf , 40 );
+ mbedtls_sha1_update_ret( &sha1, sha1sum, 20 );
+ mbedtls_sha1_finish_ret( &sha1, buf + 16 );
MBEDTLS_SSL_DEBUG_BUF( 3, "calc finished result", buf, 36 );
@@ -5040,8 +5040,8 @@
? "client finished"
: "server finished";
- mbedtls_md5_finish_ext( &md5, padbuf );
- mbedtls_sha1_finish_ext( &sha1, padbuf + 16 );
+ mbedtls_md5_finish_ret( &md5, padbuf );
+ mbedtls_sha1_finish_ret( &sha1, padbuf + 16 );
ssl->handshake->tls_prf( session->master, 48, sender,
padbuf, 36, buf, len );
@@ -5092,7 +5092,7 @@
? "client finished"
: "server finished";
- mbedtls_sha256_finish_ext( &sha256, padbuf );
+ mbedtls_sha256_finish_ret( &sha256, padbuf );
ssl->handshake->tls_prf( session->master, 48, sender,
padbuf, 32, buf, len );
@@ -5141,7 +5141,7 @@
? "client finished"
: "server finished";
- mbedtls_sha512_finish_ext( &sha512, padbuf );
+ mbedtls_sha512_finish_ret( &sha512, padbuf );
ssl->handshake->tls_prf( session->master, 48, sender,
padbuf, 48, buf, len );
@@ -5455,17 +5455,17 @@
defined(MBEDTLS_SSL_PROTO_TLS1_1)
mbedtls_md5_init( &handshake->fin_md5 );
mbedtls_sha1_init( &handshake->fin_sha1 );
- mbedtls_md5_starts_ext( &handshake->fin_md5 );
- mbedtls_sha1_starts_ext( &handshake->fin_sha1 );
+ mbedtls_md5_starts_ret( &handshake->fin_md5 );
+ mbedtls_sha1_starts_ret( &handshake->fin_sha1 );
#endif
#if defined(MBEDTLS_SSL_PROTO_TLS1_2)
#if defined(MBEDTLS_SHA256_C)
mbedtls_sha256_init( &handshake->fin_sha256 );
- mbedtls_sha256_starts_ext( &handshake->fin_sha256, 0 );
+ mbedtls_sha256_starts_ret( &handshake->fin_sha256, 0 );
#endif
#if defined(MBEDTLS_SHA512_C)
mbedtls_sha512_init( &handshake->fin_sha512 );
- mbedtls_sha512_starts_ext( &handshake->fin_sha512, 1 );
+ mbedtls_sha512_starts_ret( &handshake->fin_sha512, 1 );
#endif
#endif /* MBEDTLS_SSL_PROTO_TLS1_2 */
@@ -8095,49 +8095,49 @@
* SHA(ClientHello.random + ServerHello.random
* + ServerParams);
*/
- if( ( ret = mbedtls_md5_starts_ext( &mbedtls_md5 ) ) != 0 )
+ if( ( ret = mbedtls_md5_starts_ret( &mbedtls_md5 ) ) != 0 )
{
- MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_md5_starts_ext", ret );
+ MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_md5_starts_ret", ret );
goto exit;
}
- if( ( ret = mbedtls_md5_update_ext( &mbedtls_md5,
+ if( ( ret = mbedtls_md5_update_ret( &mbedtls_md5,
ssl->handshake->randbytes, 64 ) ) != 0 )
{
- MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_md5_update_ext", ret );
+ MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_md5_update_ret", ret );
goto exit;
}
- if( ( ret = mbedtls_md5_update_ext( &mbedtls_md5, data, data_len ) ) != 0 )
+ if( ( ret = mbedtls_md5_update_ret( &mbedtls_md5, data, data_len ) ) != 0 )
{
- MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_md5_update_ext", ret );
+ MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_md5_update_ret", ret );
goto exit;
}
- if( ( ret = mbedtls_md5_finish_ext( &mbedtls_md5, output ) ) != 0 )
+ if( ( ret = mbedtls_md5_finish_ret( &mbedtls_md5, output ) ) != 0 )
{
- MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_md5_finish_ext", ret );
+ MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_md5_finish_ret", ret );
goto exit;
}
- if( ( ret = mbedtls_sha1_starts_ext( &mbedtls_sha1 ) ) != 0 )
+ if( ( ret = mbedtls_sha1_starts_ret( &mbedtls_sha1 ) ) != 0 )
{
- MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_sha1_starts_ext", ret );
+ MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_sha1_starts_ret", ret );
goto exit;
}
- if( ( ret = mbedtls_sha1_update_ext( &mbedtls_sha1,
+ if( ( ret = mbedtls_sha1_update_ret( &mbedtls_sha1,
ssl->handshake->randbytes, 64 ) ) != 0 )
{
- MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_sha1_update_ext", ret );
+ MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_sha1_update_ret", ret );
goto exit;
}
- if( ( ret = mbedtls_sha1_update_ext( &mbedtls_sha1, data,
+ if( ( ret = mbedtls_sha1_update_ret( &mbedtls_sha1, data,
data_len ) ) != 0 )
{
- MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_sha1_update_ext", ret );
+ MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_sha1_update_ret", ret );
goto exit;
}
- if( ( ret = mbedtls_sha1_finish_ext( &mbedtls_sha1,
+ if( ( ret = mbedtls_sha1_finish_ret( &mbedtls_sha1,
output + 16 ) ) != 0 )
{
- MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_sha1_finish_ext", ret );
+ MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_sha1_finish_ret", ret );
goto exit;
}
diff --git a/library/x509write_crt.c b/library/x509write_crt.c
index 3ec55a5..41dfe87 100644
--- a/library/x509write_crt.c
+++ b/library/x509write_crt.c
@@ -177,7 +177,7 @@
memset( buf, 0, sizeof(buf) );
MBEDTLS_ASN1_CHK_ADD( len, mbedtls_pk_write_pubkey( &c, buf, ctx->subject_key ) );
- ret = mbedtls_sha1_ext( buf + sizeof( buf ) - len, len,
+ ret = mbedtls_sha1_ret( buf + sizeof( buf ) - len, len,
buf + sizeof( buf ) - 20 );
if( ret != 0 )
return( ret );
@@ -202,7 +202,7 @@
memset( buf, 0, sizeof(buf) );
MBEDTLS_ASN1_CHK_ADD( len, mbedtls_pk_write_pubkey( &c, buf, ctx->issuer_key ) );
- ret = mbedtls_sha1_ext( buf + sizeof( buf ) - len, len,
+ ret = mbedtls_sha1_ret( buf + sizeof( buf ) - len, len,
buf + sizeof( buf ) - 20 );
if( ret != 0 )
return( ret );
diff --git a/programs/hash/hello.c b/programs/hash/hello.c
index a0c08c7..2e8c224 100644
--- a/programs/hash/hello.c
+++ b/programs/hash/hello.c
@@ -54,7 +54,7 @@
mbedtls_printf( "\n MD5('%s') = ", str );
- if( ( ret = mbedtls_md5_ext( (unsigned char *) str, 13, digest ) ) != 0 )
+ if( ( ret = mbedtls_md5_ret( (unsigned char *) str, 13, digest ) ) != 0 )
return( MBEDTLS_EXIT_FAILURE );
for( i = 0; i < 16; i++ )
diff --git a/programs/pkey/dh_client.c b/programs/pkey/dh_client.c
index 21c4a81..0978408 100644
--- a/programs/pkey/dh_client.c
+++ b/programs/pkey/dh_client.c
@@ -212,9 +212,9 @@
goto exit;
}
- if( ( ret = mbedtls_sha1_ext( buf, (int)( p - 2 - buf ), hash ) ) != 0 )
+ if( ( ret = mbedtls_sha1_ret( buf, (int)( p - 2 - buf ), hash ) ) != 0 )
{
- mbedtls_printf( " failed\n ! mbedtls_sha1_ext returned %d\n\n", ret );
+ mbedtls_printf( " failed\n ! mbedtls_sha1_ret returned %d\n\n", ret );
goto exit;
}
diff --git a/programs/pkey/dh_server.c b/programs/pkey/dh_server.c
index f1d3be3..4d8632b 100644
--- a/programs/pkey/dh_server.c
+++ b/programs/pkey/dh_server.c
@@ -217,9 +217,9 @@
/*
* 5. Sign the parameters and send them
*/
- if( ( ret = mbedtls_sha1_ext( buf, n, hash ) ) != 0 )
+ if( ( ret = mbedtls_sha1_ret( buf, n, hash ) ) != 0 )
{
- mbedtls_printf( " failed\n ! mbedtls_sha1_ext returned %d\n\n", ret );
+ mbedtls_printf( " failed\n ! mbedtls_sha1_ret returned %d\n\n", ret );
goto exit;
}
diff --git a/programs/pkey/ecdsa.c b/programs/pkey/ecdsa.c
index ecb6c22..b474060 100644
--- a/programs/pkey/ecdsa.c
+++ b/programs/pkey/ecdsa.c
@@ -163,9 +163,9 @@
mbedtls_printf( " . Computing message hash..." );
fflush( stdout );
- if( ( ret = mbedtls_sha256_ext( message, sizeof( message ), hash, 0 ) ) != 0 )
+ if( ( ret = mbedtls_sha256_ret( message, sizeof( message ), hash, 0 ) ) != 0 )
{
- mbedtls_printf( " failed\n ! mbedtls_sha256_ext returned %d\n", ret );
+ mbedtls_printf( " failed\n ! mbedtls_sha256_ret returned %d\n", ret );
goto exit;
}
diff --git a/programs/test/benchmark.c b/programs/test/benchmark.c
index 539d9ad..419557d 100644
--- a/programs/test/benchmark.c
+++ b/programs/test/benchmark.c
@@ -327,32 +327,32 @@
#if defined(MBEDTLS_MD4_C)
if( todo.md4 )
- TIME_AND_TSC( "MD4", mbedtls_md4_ext( buf, BUFSIZE, tmp ) );
+ TIME_AND_TSC( "MD4", mbedtls_md4_ret( buf, BUFSIZE, tmp ) );
#endif
#if defined(MBEDTLS_MD5_C)
if( todo.md5 )
- TIME_AND_TSC( "MD5", mbedtls_md5_ext( buf, BUFSIZE, tmp ) );
+ TIME_AND_TSC( "MD5", mbedtls_md5_ret( buf, BUFSIZE, tmp ) );
#endif
#if defined(MBEDTLS_RIPEMD160_C)
if( todo.ripemd160 )
- TIME_AND_TSC( "RIPEMD160", mbedtls_ripemd160_ext( buf, BUFSIZE, tmp ) );
+ TIME_AND_TSC( "RIPEMD160", mbedtls_ripemd160_ret( buf, BUFSIZE, tmp ) );
#endif
#if defined(MBEDTLS_SHA1_C)
if( todo.sha1 )
- TIME_AND_TSC( "SHA-1", mbedtls_sha1_ext( buf, BUFSIZE, tmp ) );
+ TIME_AND_TSC( "SHA-1", mbedtls_sha1_ret( buf, BUFSIZE, tmp ) );
#endif
#if defined(MBEDTLS_SHA256_C)
if( todo.sha256 )
- TIME_AND_TSC( "SHA-256", mbedtls_sha256_ext( buf, BUFSIZE, tmp, 0 ) );
+ TIME_AND_TSC( "SHA-256", mbedtls_sha256_ret( buf, BUFSIZE, tmp, 0 ) );
#endif
#if defined(MBEDTLS_SHA512_C)
if( todo.sha512 )
- TIME_AND_TSC( "SHA-512", mbedtls_sha512_ext( buf, BUFSIZE, tmp, 0 ) );
+ TIME_AND_TSC( "SHA-512", mbedtls_sha512_ret( buf, BUFSIZE, tmp, 0 ) );
#endif
#if defined(MBEDTLS_ARC4_C)
diff --git a/tests/suites/test_suite_mdx.function b/tests/suites/test_suite_mdx.function
index 387e7ee..648a9cc 100644
--- a/tests/suites/test_suite_mdx.function
+++ b/tests/suites/test_suite_mdx.function
@@ -19,7 +19,7 @@
strncpy( (char *) src_str, text_src_string, sizeof(src_str) - 1 );
- ret = mbedtls_md2_ext( src_str, strlen( (char *) src_str ), output );
+ ret = mbedtls_md2_ret( src_str, strlen( (char *) src_str ), output );
TEST_ASSERT( ret == 0 ) ;
hexify( hash_str, output, sizeof output );
@@ -41,7 +41,7 @@
strncpy( (char *) src_str, text_src_string, sizeof(src_str) - 1 );
- ret = mbedtls_md4_ext( src_str, strlen( (char *) src_str ), output );
+ ret = mbedtls_md4_ret( src_str, strlen( (char *) src_str ), output );
TEST_ASSERT( ret == 0 );
hexify( hash_str, output, sizeof output );
@@ -63,7 +63,7 @@
strncpy( (char *) src_str, text_src_string, sizeof(src_str) - 1 );
- ret = mbedtls_md5_ext( src_str, strlen( (char *) src_str ), output );
+ ret = mbedtls_md5_ret( src_str, strlen( (char *) src_str ), output );
TEST_ASSERT( ret == 0 );
hexify( hash_str, output, sizeof output );
@@ -85,7 +85,7 @@
strncpy( (char *) src_str, text_src_string, sizeof(src_str) - 1 );
- ret = mbedtls_ripemd160_ext( src_str, strlen( (char *) src_str ), output );
+ ret = mbedtls_ripemd160_ret( src_str, strlen( (char *) src_str ), output );
TEST_ASSERT( ret == 0 );
hexify( hash_str, output, sizeof output );
diff --git a/tests/suites/test_suite_shax.function b/tests/suites/test_suite_shax.function
index b6f8f51..d704b38 100644
--- a/tests/suites/test_suite_shax.function
+++ b/tests/suites/test_suite_shax.function
@@ -18,7 +18,7 @@
src_len = unhexify( src_str, hex_src_string );
- TEST_ASSERT( mbedtls_sha1_ext( src_str, src_len, output ) == 0 );
+ TEST_ASSERT( mbedtls_sha1_ret( src_str, src_len, output ) == 0 );
hexify( hash_str, output, 20 );
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
@@ -39,7 +39,7 @@
src_len = unhexify( src_str, hex_src_string );
- TEST_ASSERT( mbedtls_sha256_ext( src_str, src_len, output, 1 ) == 0 );
+ TEST_ASSERT( mbedtls_sha256_ret( src_str, src_len, output, 1 ) == 0 );
hexify( hash_str, output, 28 );
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
@@ -60,7 +60,7 @@
src_len = unhexify( src_str, hex_src_string );
- TEST_ASSERT( mbedtls_sha256_ext( src_str, src_len, output, 0 ) == 0 );
+ TEST_ASSERT( mbedtls_sha256_ret( src_str, src_len, output, 0 ) == 0 );
hexify( hash_str, output, 32 );
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
@@ -81,7 +81,7 @@
src_len = unhexify( src_str, hex_src_string );
- TEST_ASSERT( mbedtls_sha512_ext( src_str, src_len, output, 1 ) == 0 );
+ TEST_ASSERT( mbedtls_sha512_ret( src_str, src_len, output, 1 ) == 0 );
hexify( hash_str, output, 48 );
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
@@ -102,7 +102,7 @@
src_len = unhexify( src_str, hex_src_string );
- TEST_ASSERT( mbedtls_sha512_ext( src_str, src_len, output, 0 ) == 0 );
+ TEST_ASSERT( mbedtls_sha512_ret( src_str, src_len, output, 0 ) == 0 );
hexify( hash_str, output, 64 );
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );