mbed TLS v2.2.1
sha512.h
Go to the documentation of this file.
1 
23 #ifndef MBEDTLS_SHA512_H
24 #define MBEDTLS_SHA512_H
25 
26 #if !defined(MBEDTLS_CONFIG_FILE)
27 #include "config.h"
28 #else
29 #include MBEDTLS_CONFIG_FILE
30 #endif
31 
32 #include <stddef.h>
33 #include <stdint.h>
34 
35 #if !defined(MBEDTLS_SHA512_ALT)
36 // Regular implementation
37 //
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
46 typedef struct
47 {
48  uint64_t total[2];
49  uint64_t state[8];
50  unsigned char buffer[128];
51  int is384;
52 }
53 mbedtls_sha512_context;
54 
60 void mbedtls_sha512_init( mbedtls_sha512_context *ctx );
61 
67 void mbedtls_sha512_free( mbedtls_sha512_context *ctx );
68 
75 void mbedtls_sha512_clone( mbedtls_sha512_context *dst,
76  const mbedtls_sha512_context *src );
77 
84 void mbedtls_sha512_starts( mbedtls_sha512_context *ctx, int is384 );
85 
93 void mbedtls_sha512_update( mbedtls_sha512_context *ctx, const unsigned char *input,
94  size_t ilen );
95 
102 void mbedtls_sha512_finish( mbedtls_sha512_context *ctx, unsigned char output[64] );
103 
104 #ifdef __cplusplus
105 }
106 #endif
107 
108 #else /* MBEDTLS_SHA512_ALT */
109 #include "sha512_alt.h"
110 #endif /* MBEDTLS_SHA512_ALT */
111 
112 #ifdef __cplusplus
113 extern "C" {
114 #endif
115 
124 void mbedtls_sha512( const unsigned char *input, size_t ilen,
125  unsigned char output[64], int is384 );
126 
132 int mbedtls_sha512_self_test( int verbose );
133 
134 /* Internal use */
135 void mbedtls_sha512_process( mbedtls_sha512_context *ctx, const unsigned char data[128] );
136 
137 #ifdef __cplusplus
138 }
139 #endif
140 
141 #endif /* mbedtls_sha512.h */
Configuration options (set of defines)
int mbedtls_sha512_self_test(int verbose)
Checkup routine.
void mbedtls_sha512(const unsigned char *input, size_t ilen, unsigned char output[64], int is384)
Output = SHA-512( input buffer )
void mbedtls_sha512_process(mbedtls_sha512_context *ctx, const unsigned char data[128])