Functions inside md_wrap.c now marked static
This commit is contained in:
parent
ac0fba5389
commit
d1df02a8a3
1 changed files with 74 additions and 74 deletions
|
@ -147,22 +147,22 @@ const md_info_t md2_info = {
|
||||||
|
|
||||||
#if defined(POLARSSL_MD4_C)
|
#if defined(POLARSSL_MD4_C)
|
||||||
|
|
||||||
void md4_starts_wrap( void *ctx )
|
static void md4_starts_wrap( void *ctx )
|
||||||
{
|
{
|
||||||
md4_starts( (md4_context *) ctx );
|
md4_starts( (md4_context *) ctx );
|
||||||
}
|
}
|
||||||
|
|
||||||
void md4_update_wrap( void *ctx, const unsigned char *input, size_t ilen )
|
static void md4_update_wrap( void *ctx, const unsigned char *input, size_t ilen )
|
||||||
{
|
{
|
||||||
md4_update( (md4_context *) ctx, input, ilen );
|
md4_update( (md4_context *) ctx, input, ilen );
|
||||||
}
|
}
|
||||||
|
|
||||||
void md4_finish_wrap( void *ctx, unsigned char *output )
|
static void md4_finish_wrap( void *ctx, unsigned char *output )
|
||||||
{
|
{
|
||||||
md4_finish( (md4_context *) ctx, output );
|
md4_finish( (md4_context *) ctx, output );
|
||||||
}
|
}
|
||||||
|
|
||||||
int md4_file_wrap( const char *path, unsigned char *output )
|
static int md4_file_wrap( const char *path, unsigned char *output )
|
||||||
{
|
{
|
||||||
#if defined(POLARSSL_FS_IO)
|
#if defined(POLARSSL_FS_IO)
|
||||||
return md4_file( path, output );
|
return md4_file( path, output );
|
||||||
|
@ -173,37 +173,37 @@ int md4_file_wrap( const char *path, unsigned char *output )
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void md4_hmac_starts_wrap( void *ctx, const unsigned char *key, size_t keylen )
|
static void md4_hmac_starts_wrap( void *ctx, const unsigned char *key, size_t keylen )
|
||||||
{
|
{
|
||||||
md4_hmac_starts( (md4_context *) ctx, key, keylen );
|
md4_hmac_starts( (md4_context *) ctx, key, keylen );
|
||||||
}
|
}
|
||||||
|
|
||||||
void md4_hmac_update_wrap( void *ctx, const unsigned char *input, size_t ilen )
|
static void md4_hmac_update_wrap( void *ctx, const unsigned char *input, size_t ilen )
|
||||||
{
|
{
|
||||||
md4_hmac_update( (md4_context *) ctx, input, ilen );
|
md4_hmac_update( (md4_context *) ctx, input, ilen );
|
||||||
}
|
}
|
||||||
|
|
||||||
void md4_hmac_finish_wrap( void *ctx, unsigned char *output )
|
static void md4_hmac_finish_wrap( void *ctx, unsigned char *output )
|
||||||
{
|
{
|
||||||
md4_hmac_finish( (md4_context *) ctx, output );
|
md4_hmac_finish( (md4_context *) ctx, output );
|
||||||
}
|
}
|
||||||
|
|
||||||
void md4_hmac_reset_wrap( void *ctx )
|
static void md4_hmac_reset_wrap( void *ctx )
|
||||||
{
|
{
|
||||||
md4_hmac_reset( (md4_context *) ctx );
|
md4_hmac_reset( (md4_context *) ctx );
|
||||||
}
|
}
|
||||||
|
|
||||||
void *md4_ctx_alloc( void )
|
static void *md4_ctx_alloc( void )
|
||||||
{
|
{
|
||||||
return malloc( sizeof( md4_context ) );
|
return malloc( sizeof( md4_context ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void md4_ctx_free( void *ctx )
|
static void md4_ctx_free( void *ctx )
|
||||||
{
|
{
|
||||||
free( ctx );
|
free( ctx );
|
||||||
}
|
}
|
||||||
|
|
||||||
void md4_process_wrap( void *ctx, const unsigned char *data )
|
static void md4_process_wrap( void *ctx, const unsigned char *data )
|
||||||
{
|
{
|
||||||
md4_process( (md4_context *) ctx, data );
|
md4_process( (md4_context *) ctx, data );
|
||||||
}
|
}
|
||||||
|
@ -315,22 +315,22 @@ const md_info_t md5_info = {
|
||||||
|
|
||||||
#if defined(POLARSSL_SHA1_C)
|
#if defined(POLARSSL_SHA1_C)
|
||||||
|
|
||||||
void sha1_starts_wrap( void *ctx )
|
static void sha1_starts_wrap( void *ctx )
|
||||||
{
|
{
|
||||||
sha1_starts( (sha1_context *) ctx );
|
sha1_starts( (sha1_context *) ctx );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha1_update_wrap( void *ctx, const unsigned char *input, size_t ilen )
|
static void sha1_update_wrap( void *ctx, const unsigned char *input, size_t ilen )
|
||||||
{
|
{
|
||||||
sha1_update( (sha1_context *) ctx, input, ilen );
|
sha1_update( (sha1_context *) ctx, input, ilen );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha1_finish_wrap( void *ctx, unsigned char *output )
|
static void sha1_finish_wrap( void *ctx, unsigned char *output )
|
||||||
{
|
{
|
||||||
sha1_finish( (sha1_context *) ctx, output );
|
sha1_finish( (sha1_context *) ctx, output );
|
||||||
}
|
}
|
||||||
|
|
||||||
int sha1_file_wrap( const char *path, unsigned char *output )
|
static int sha1_file_wrap( const char *path, unsigned char *output )
|
||||||
{
|
{
|
||||||
#if defined(POLARSSL_FS_IO)
|
#if defined(POLARSSL_FS_IO)
|
||||||
return sha1_file( path, output );
|
return sha1_file( path, output );
|
||||||
|
@ -341,37 +341,37 @@ int sha1_file_wrap( const char *path, unsigned char *output )
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha1_hmac_starts_wrap( void *ctx, const unsigned char *key, size_t keylen )
|
static void sha1_hmac_starts_wrap( void *ctx, const unsigned char *key, size_t keylen )
|
||||||
{
|
{
|
||||||
sha1_hmac_starts( (sha1_context *) ctx, key, keylen );
|
sha1_hmac_starts( (sha1_context *) ctx, key, keylen );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha1_hmac_update_wrap( void *ctx, const unsigned char *input, size_t ilen )
|
static void sha1_hmac_update_wrap( void *ctx, const unsigned char *input, size_t ilen )
|
||||||
{
|
{
|
||||||
sha1_hmac_update( (sha1_context *) ctx, input, ilen );
|
sha1_hmac_update( (sha1_context *) ctx, input, ilen );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha1_hmac_finish_wrap( void *ctx, unsigned char *output )
|
static void sha1_hmac_finish_wrap( void *ctx, unsigned char *output )
|
||||||
{
|
{
|
||||||
sha1_hmac_finish( (sha1_context *) ctx, output );
|
sha1_hmac_finish( (sha1_context *) ctx, output );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha1_hmac_reset_wrap( void *ctx )
|
static void sha1_hmac_reset_wrap( void *ctx )
|
||||||
{
|
{
|
||||||
sha1_hmac_reset( (sha1_context *) ctx );
|
sha1_hmac_reset( (sha1_context *) ctx );
|
||||||
}
|
}
|
||||||
|
|
||||||
void * sha1_ctx_alloc( void )
|
static void * sha1_ctx_alloc( void )
|
||||||
{
|
{
|
||||||
return malloc( sizeof( sha1_context ) );
|
return malloc( sizeof( sha1_context ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha1_ctx_free( void *ctx )
|
static void sha1_ctx_free( void *ctx )
|
||||||
{
|
{
|
||||||
free( ctx );
|
free( ctx );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha1_process_wrap( void *ctx, const unsigned char *data )
|
static void sha1_process_wrap( void *ctx, const unsigned char *data )
|
||||||
{
|
{
|
||||||
sha1_process( (sha1_context *) ctx, data );
|
sha1_process( (sha1_context *) ctx, data );
|
||||||
}
|
}
|
||||||
|
@ -402,28 +402,28 @@ const md_info_t sha1_info = {
|
||||||
*/
|
*/
|
||||||
#if defined(POLARSSL_SHA2_C)
|
#if defined(POLARSSL_SHA2_C)
|
||||||
|
|
||||||
void sha224_starts_wrap( void *ctx )
|
static void sha224_starts_wrap( void *ctx )
|
||||||
{
|
{
|
||||||
sha2_starts( (sha2_context *) ctx, 1 );
|
sha2_starts( (sha2_context *) ctx, 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha224_update_wrap( void *ctx, const unsigned char *input, size_t ilen )
|
static void sha224_update_wrap( void *ctx, const unsigned char *input, size_t ilen )
|
||||||
{
|
{
|
||||||
sha2_update( (sha2_context *) ctx, input, ilen );
|
sha2_update( (sha2_context *) ctx, input, ilen );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha224_finish_wrap( void *ctx, unsigned char *output )
|
static void sha224_finish_wrap( void *ctx, unsigned char *output )
|
||||||
{
|
{
|
||||||
sha2_finish( (sha2_context *) ctx, output );
|
sha2_finish( (sha2_context *) ctx, output );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha224_wrap( const unsigned char *input, size_t ilen,
|
static void sha224_wrap( const unsigned char *input, size_t ilen,
|
||||||
unsigned char *output )
|
unsigned char *output )
|
||||||
{
|
{
|
||||||
sha2( input, ilen, output, 1 );
|
sha2( input, ilen, output, 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
int sha224_file_wrap( const char *path, unsigned char *output )
|
static int sha224_file_wrap( const char *path, unsigned char *output )
|
||||||
{
|
{
|
||||||
#if defined(POLARSSL_FS_IO)
|
#if defined(POLARSSL_FS_IO)
|
||||||
return sha2_file( path, output, 1 );
|
return sha2_file( path, output, 1 );
|
||||||
|
@ -434,44 +434,44 @@ int sha224_file_wrap( const char *path, unsigned char *output )
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha224_hmac_starts_wrap( void *ctx, const unsigned char *key, size_t keylen )
|
static void sha224_hmac_starts_wrap( void *ctx, const unsigned char *key, size_t keylen )
|
||||||
{
|
{
|
||||||
sha2_hmac_starts( (sha2_context *) ctx, key, keylen, 1 );
|
sha2_hmac_starts( (sha2_context *) ctx, key, keylen, 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha224_hmac_update_wrap( void *ctx, const unsigned char *input, size_t ilen )
|
static void sha224_hmac_update_wrap( void *ctx, const unsigned char *input, size_t ilen )
|
||||||
{
|
{
|
||||||
sha2_hmac_update( (sha2_context *) ctx, input, ilen );
|
sha2_hmac_update( (sha2_context *) ctx, input, ilen );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha224_hmac_finish_wrap( void *ctx, unsigned char *output )
|
static void sha224_hmac_finish_wrap( void *ctx, unsigned char *output )
|
||||||
{
|
{
|
||||||
sha2_hmac_finish( (sha2_context *) ctx, output );
|
sha2_hmac_finish( (sha2_context *) ctx, output );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha224_hmac_reset_wrap( void *ctx )
|
static void sha224_hmac_reset_wrap( void *ctx )
|
||||||
{
|
{
|
||||||
sha2_hmac_reset( (sha2_context *) ctx );
|
sha2_hmac_reset( (sha2_context *) ctx );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha224_hmac_wrap( const unsigned char *key, size_t keylen,
|
static void sha224_hmac_wrap( const unsigned char *key, size_t keylen,
|
||||||
const unsigned char *input, size_t ilen,
|
const unsigned char *input, size_t ilen,
|
||||||
unsigned char *output )
|
unsigned char *output )
|
||||||
{
|
{
|
||||||
sha2_hmac( key, keylen, input, ilen, output, 1 );
|
sha2_hmac( key, keylen, input, ilen, output, 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void * sha224_ctx_alloc( void )
|
static void * sha224_ctx_alloc( void )
|
||||||
{
|
{
|
||||||
return malloc( sizeof( sha2_context ) );
|
return malloc( sizeof( sha2_context ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha224_ctx_free( void *ctx )
|
static void sha224_ctx_free( void *ctx )
|
||||||
{
|
{
|
||||||
free( ctx );
|
free( ctx );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha224_process_wrap( void *ctx, const unsigned char *data )
|
static void sha224_process_wrap( void *ctx, const unsigned char *data )
|
||||||
{
|
{
|
||||||
sha2_process( (sha2_context *) ctx, data );
|
sha2_process( (sha2_context *) ctx, data );
|
||||||
}
|
}
|
||||||
|
@ -495,28 +495,28 @@ const md_info_t sha224_info = {
|
||||||
sha224_process_wrap,
|
sha224_process_wrap,
|
||||||
};
|
};
|
||||||
|
|
||||||
void sha256_starts_wrap( void *ctx )
|
static void sha256_starts_wrap( void *ctx )
|
||||||
{
|
{
|
||||||
sha2_starts( (sha2_context *) ctx, 0 );
|
sha2_starts( (sha2_context *) ctx, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha256_update_wrap( void *ctx, const unsigned char *input, size_t ilen )
|
static void sha256_update_wrap( void *ctx, const unsigned char *input, size_t ilen )
|
||||||
{
|
{
|
||||||
sha2_update( (sha2_context *) ctx, input, ilen );
|
sha2_update( (sha2_context *) ctx, input, ilen );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha256_finish_wrap( void *ctx, unsigned char *output )
|
static void sha256_finish_wrap( void *ctx, unsigned char *output )
|
||||||
{
|
{
|
||||||
sha2_finish( (sha2_context *) ctx, output );
|
sha2_finish( (sha2_context *) ctx, output );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha256_wrap( const unsigned char *input, size_t ilen,
|
static void sha256_wrap( const unsigned char *input, size_t ilen,
|
||||||
unsigned char *output )
|
unsigned char *output )
|
||||||
{
|
{
|
||||||
sha2( input, ilen, output, 0 );
|
sha2( input, ilen, output, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
int sha256_file_wrap( const char *path, unsigned char *output )
|
static int sha256_file_wrap( const char *path, unsigned char *output )
|
||||||
{
|
{
|
||||||
#if defined(POLARSSL_FS_IO)
|
#if defined(POLARSSL_FS_IO)
|
||||||
return sha2_file( path, output, 0 );
|
return sha2_file( path, output, 0 );
|
||||||
|
@ -527,44 +527,44 @@ int sha256_file_wrap( const char *path, unsigned char *output )
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha256_hmac_starts_wrap( void *ctx, const unsigned char *key, size_t keylen )
|
static void sha256_hmac_starts_wrap( void *ctx, const unsigned char *key, size_t keylen )
|
||||||
{
|
{
|
||||||
sha2_hmac_starts( (sha2_context *) ctx, key, keylen, 0 );
|
sha2_hmac_starts( (sha2_context *) ctx, key, keylen, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha256_hmac_update_wrap( void *ctx, const unsigned char *input, size_t ilen )
|
static void sha256_hmac_update_wrap( void *ctx, const unsigned char *input, size_t ilen )
|
||||||
{
|
{
|
||||||
sha2_hmac_update( (sha2_context *) ctx, input, ilen );
|
sha2_hmac_update( (sha2_context *) ctx, input, ilen );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha256_hmac_finish_wrap( void *ctx, unsigned char *output )
|
static void sha256_hmac_finish_wrap( void *ctx, unsigned char *output )
|
||||||
{
|
{
|
||||||
sha2_hmac_finish( (sha2_context *) ctx, output );
|
sha2_hmac_finish( (sha2_context *) ctx, output );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha256_hmac_reset_wrap( void *ctx )
|
static void sha256_hmac_reset_wrap( void *ctx )
|
||||||
{
|
{
|
||||||
sha2_hmac_reset( (sha2_context *) ctx );
|
sha2_hmac_reset( (sha2_context *) ctx );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha256_hmac_wrap( const unsigned char *key, size_t keylen,
|
static void sha256_hmac_wrap( const unsigned char *key, size_t keylen,
|
||||||
const unsigned char *input, size_t ilen,
|
const unsigned char *input, size_t ilen,
|
||||||
unsigned char *output )
|
unsigned char *output )
|
||||||
{
|
{
|
||||||
sha2_hmac( key, keylen, input, ilen, output, 0 );
|
sha2_hmac( key, keylen, input, ilen, output, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void * sha256_ctx_alloc( void )
|
static void * sha256_ctx_alloc( void )
|
||||||
{
|
{
|
||||||
return malloc( sizeof( sha2_context ) );
|
return malloc( sizeof( sha2_context ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha256_ctx_free( void *ctx )
|
static void sha256_ctx_free( void *ctx )
|
||||||
{
|
{
|
||||||
free( ctx );
|
free( ctx );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha256_process_wrap( void *ctx, const unsigned char *data )
|
static void sha256_process_wrap( void *ctx, const unsigned char *data )
|
||||||
{
|
{
|
||||||
sha2_process( (sha2_context *) ctx, data );
|
sha2_process( (sha2_context *) ctx, data );
|
||||||
}
|
}
|
||||||
|
@ -592,28 +592,28 @@ const md_info_t sha256_info = {
|
||||||
|
|
||||||
#if defined(POLARSSL_SHA4_C)
|
#if defined(POLARSSL_SHA4_C)
|
||||||
|
|
||||||
void sha384_starts_wrap( void *ctx )
|
static void sha384_starts_wrap( void *ctx )
|
||||||
{
|
{
|
||||||
sha4_starts( (sha4_context *) ctx, 1 );
|
sha4_starts( (sha4_context *) ctx, 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha384_update_wrap( void *ctx, const unsigned char *input, size_t ilen )
|
static void sha384_update_wrap( void *ctx, const unsigned char *input, size_t ilen )
|
||||||
{
|
{
|
||||||
sha4_update( (sha4_context *) ctx, input, ilen );
|
sha4_update( (sha4_context *) ctx, input, ilen );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha384_finish_wrap( void *ctx, unsigned char *output )
|
static void sha384_finish_wrap( void *ctx, unsigned char *output )
|
||||||
{
|
{
|
||||||
sha4_finish( (sha4_context *) ctx, output );
|
sha4_finish( (sha4_context *) ctx, output );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha384_wrap( const unsigned char *input, size_t ilen,
|
static void sha384_wrap( const unsigned char *input, size_t ilen,
|
||||||
unsigned char *output )
|
unsigned char *output )
|
||||||
{
|
{
|
||||||
sha4( input, ilen, output, 1 );
|
sha4( input, ilen, output, 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
int sha384_file_wrap( const char *path, unsigned char *output )
|
static int sha384_file_wrap( const char *path, unsigned char *output )
|
||||||
{
|
{
|
||||||
#if defined(POLARSSL_FS_IO)
|
#if defined(POLARSSL_FS_IO)
|
||||||
return sha4_file( path, output, 1 );
|
return sha4_file( path, output, 1 );
|
||||||
|
@ -624,44 +624,44 @@ int sha384_file_wrap( const char *path, unsigned char *output )
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha384_hmac_starts_wrap( void *ctx, const unsigned char *key, size_t keylen )
|
static void sha384_hmac_starts_wrap( void *ctx, const unsigned char *key, size_t keylen )
|
||||||
{
|
{
|
||||||
sha4_hmac_starts( (sha4_context *) ctx, key, keylen, 1 );
|
sha4_hmac_starts( (sha4_context *) ctx, key, keylen, 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha384_hmac_update_wrap( void *ctx, const unsigned char *input, size_t ilen )
|
static void sha384_hmac_update_wrap( void *ctx, const unsigned char *input, size_t ilen )
|
||||||
{
|
{
|
||||||
sha4_hmac_update( (sha4_context *) ctx, input, ilen );
|
sha4_hmac_update( (sha4_context *) ctx, input, ilen );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha384_hmac_finish_wrap( void *ctx, unsigned char *output )
|
static void sha384_hmac_finish_wrap( void *ctx, unsigned char *output )
|
||||||
{
|
{
|
||||||
sha4_hmac_finish( (sha4_context *) ctx, output );
|
sha4_hmac_finish( (sha4_context *) ctx, output );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha384_hmac_reset_wrap( void *ctx )
|
static void sha384_hmac_reset_wrap( void *ctx )
|
||||||
{
|
{
|
||||||
sha4_hmac_reset( (sha4_context *) ctx );
|
sha4_hmac_reset( (sha4_context *) ctx );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha384_hmac_wrap( const unsigned char *key, size_t keylen,
|
static void sha384_hmac_wrap( const unsigned char *key, size_t keylen,
|
||||||
const unsigned char *input, size_t ilen,
|
const unsigned char *input, size_t ilen,
|
||||||
unsigned char *output )
|
unsigned char *output )
|
||||||
{
|
{
|
||||||
sha4_hmac( key, keylen, input, ilen, output, 1 );
|
sha4_hmac( key, keylen, input, ilen, output, 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void * sha384_ctx_alloc( void )
|
static void * sha384_ctx_alloc( void )
|
||||||
{
|
{
|
||||||
return malloc( sizeof( sha4_context ) );
|
return malloc( sizeof( sha4_context ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha384_ctx_free( void *ctx )
|
static void sha384_ctx_free( void *ctx )
|
||||||
{
|
{
|
||||||
free( ctx );
|
free( ctx );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha384_process_wrap( void *ctx, const unsigned char *data )
|
static void sha384_process_wrap( void *ctx, const unsigned char *data )
|
||||||
{
|
{
|
||||||
sha4_process( (sha4_context *) ctx, data );
|
sha4_process( (sha4_context *) ctx, data );
|
||||||
}
|
}
|
||||||
|
@ -685,28 +685,28 @@ const md_info_t sha384_info = {
|
||||||
sha384_process_wrap,
|
sha384_process_wrap,
|
||||||
};
|
};
|
||||||
|
|
||||||
void sha512_starts_wrap( void *ctx )
|
static void sha512_starts_wrap( void *ctx )
|
||||||
{
|
{
|
||||||
sha4_starts( (sha4_context *) ctx, 0 );
|
sha4_starts( (sha4_context *) ctx, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha512_update_wrap( void *ctx, const unsigned char *input, size_t ilen )
|
static void sha512_update_wrap( void *ctx, const unsigned char *input, size_t ilen )
|
||||||
{
|
{
|
||||||
sha4_update( (sha4_context *) ctx, input, ilen );
|
sha4_update( (sha4_context *) ctx, input, ilen );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha512_finish_wrap( void *ctx, unsigned char *output )
|
static void sha512_finish_wrap( void *ctx, unsigned char *output )
|
||||||
{
|
{
|
||||||
sha4_finish( (sha4_context *) ctx, output );
|
sha4_finish( (sha4_context *) ctx, output );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha512_wrap( const unsigned char *input, size_t ilen,
|
static void sha512_wrap( const unsigned char *input, size_t ilen,
|
||||||
unsigned char *output )
|
unsigned char *output )
|
||||||
{
|
{
|
||||||
sha4( input, ilen, output, 0 );
|
sha4( input, ilen, output, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
int sha512_file_wrap( const char *path, unsigned char *output )
|
static int sha512_file_wrap( const char *path, unsigned char *output )
|
||||||
{
|
{
|
||||||
#if defined(POLARSSL_FS_IO)
|
#if defined(POLARSSL_FS_IO)
|
||||||
return sha4_file( path, output, 0 );
|
return sha4_file( path, output, 0 );
|
||||||
|
@ -717,44 +717,44 @@ int sha512_file_wrap( const char *path, unsigned char *output )
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha512_hmac_starts_wrap( void *ctx, const unsigned char *key, size_t keylen )
|
static void sha512_hmac_starts_wrap( void *ctx, const unsigned char *key, size_t keylen )
|
||||||
{
|
{
|
||||||
sha4_hmac_starts( (sha4_context *) ctx, key, keylen, 0 );
|
sha4_hmac_starts( (sha4_context *) ctx, key, keylen, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha512_hmac_update_wrap( void *ctx, const unsigned char *input, size_t ilen )
|
static void sha512_hmac_update_wrap( void *ctx, const unsigned char *input, size_t ilen )
|
||||||
{
|
{
|
||||||
sha4_hmac_update( (sha4_context *) ctx, input, ilen );
|
sha4_hmac_update( (sha4_context *) ctx, input, ilen );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha512_hmac_finish_wrap( void *ctx, unsigned char *output )
|
static void sha512_hmac_finish_wrap( void *ctx, unsigned char *output )
|
||||||
{
|
{
|
||||||
sha4_hmac_finish( (sha4_context *) ctx, output );
|
sha4_hmac_finish( (sha4_context *) ctx, output );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha512_hmac_reset_wrap( void *ctx )
|
static void sha512_hmac_reset_wrap( void *ctx )
|
||||||
{
|
{
|
||||||
sha4_hmac_reset( (sha4_context *) ctx );
|
sha4_hmac_reset( (sha4_context *) ctx );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha512_hmac_wrap( const unsigned char *key, size_t keylen,
|
static void sha512_hmac_wrap( const unsigned char *key, size_t keylen,
|
||||||
const unsigned char *input, size_t ilen,
|
const unsigned char *input, size_t ilen,
|
||||||
unsigned char *output )
|
unsigned char *output )
|
||||||
{
|
{
|
||||||
sha4_hmac( key, keylen, input, ilen, output, 0 );
|
sha4_hmac( key, keylen, input, ilen, output, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void * sha512_ctx_alloc( void )
|
static void * sha512_ctx_alloc( void )
|
||||||
{
|
{
|
||||||
return malloc( sizeof( sha4_context ) );
|
return malloc( sizeof( sha4_context ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha512_ctx_free( void *ctx )
|
static void sha512_ctx_free( void *ctx )
|
||||||
{
|
{
|
||||||
free( ctx );
|
free( ctx );
|
||||||
}
|
}
|
||||||
|
|
||||||
void sha512_process_wrap( void *ctx, const unsigned char *data )
|
static void sha512_process_wrap( void *ctx, const unsigned char *data )
|
||||||
{
|
{
|
||||||
sha4_process( (sha4_context *) ctx, data );
|
sha4_process( (sha4_context *) ctx, data );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue