00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051 #ifndef MBEDTLS_SHA512_H
00052 #define MBEDTLS_SHA512_H
00053
00054 #if !defined(MBEDTLS_CONFIG_FILE)
00055 #include "config.h"
00056 #else
00057 #include MBEDTLS_CONFIG_FILE
00058 #endif
00059
00060 #include <stddef.h>
00061 #include <stdint.h>
00062
00063 #define MBEDTLS_ERR_SHA512_HW_ACCEL_FAILED -0x0039
00065 #if !defined(MBEDTLS_SHA512_ALT)
00066
00067
00068
00069 #ifdef __cplusplus
00070 extern "C" {
00071 #endif
00072
00080 typedef struct
00081 {
00082 uint64_t total[2];
00083 uint64_t state[8];
00084 unsigned char buffer[128];
00085 int is384;
00088 }
00089 mbedtls_sha512_context;
00090
00096 void mbedtls_sha512_init( mbedtls_sha512_context *ctx );
00097
00103 void mbedtls_sha512_free( mbedtls_sha512_context *ctx );
00104
00111 void mbedtls_sha512_clone( mbedtls_sha512_context *dst,
00112 const mbedtls_sha512_context *src );
00113
00125 int mbedtls_sha512_starts_ret( mbedtls_sha512_context *ctx, int is384 );
00126
00137 int mbedtls_sha512_update_ret( mbedtls_sha512_context *ctx,
00138 const unsigned char *input,
00139 size_t ilen );
00140
00151 int mbedtls_sha512_finish_ret( mbedtls_sha512_context *ctx,
00152 unsigned char output[64] );
00153
00163 int mbedtls_internal_sha512_process( mbedtls_sha512_context *ctx,
00164 const unsigned char data[128] );
00165 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
00166 #if defined(MBEDTLS_DEPRECATED_WARNING)
00167 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
00168 #else
00169 #define MBEDTLS_DEPRECATED
00170 #endif
00171
00182 MBEDTLS_DEPRECATED void mbedtls_sha512_starts( mbedtls_sha512_context *ctx,
00183 int is384 );
00184
00195 MBEDTLS_DEPRECATED void mbedtls_sha512_update( mbedtls_sha512_context *ctx,
00196 const unsigned char *input,
00197 size_t ilen );
00198
00208 MBEDTLS_DEPRECATED void mbedtls_sha512_finish( mbedtls_sha512_context *ctx,
00209 unsigned char output[64] );
00210
00221 MBEDTLS_DEPRECATED void mbedtls_sha512_process(
00222 mbedtls_sha512_context *ctx,
00223 const unsigned char data[128] );
00224
00225 #undef MBEDTLS_DEPRECATED
00226 #endif
00227
00228 #ifdef __cplusplus
00229 }
00230 #endif
00231
00232 #else
00233 #include "sha512_alt.h"
00234 #endif
00235
00236 #ifdef __cplusplus
00237 extern "C" {
00238 #endif
00239
00259 int mbedtls_sha512_ret( const unsigned char *input,
00260 size_t ilen,
00261 unsigned char output[64],
00262 int is384 );
00263
00264 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
00265 #if defined(MBEDTLS_DEPRECATED_WARNING)
00266 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
00267 #else
00268 #define MBEDTLS_DEPRECATED
00269 #endif
00270
00289 MBEDTLS_DEPRECATED void mbedtls_sha512( const unsigned char *input,
00290 size_t ilen,
00291 unsigned char output[64],
00292 int is384 );
00293
00294 #undef MBEDTLS_DEPRECATED
00295 #endif
00296
00301 int mbedtls_sha512_self_test( int verbose );
00302
00303 #ifdef __cplusplus
00304 }
00305 #endif
00306
00307 #endif