mbed TLS v2.0.0
sha512.h
Go to the documentation of this file.
1 
24 #ifndef MBEDTLS_SHA512_H
25 #define MBEDTLS_SHA512_H
26 
27 #if !defined(MBEDTLS_CONFIG_FILE)
28 #include "config.h"
29 #else
30 #include MBEDTLS_CONFIG_FILE
31 #endif
32 
33 #include <stddef.h>
34 #include <stdint.h>
35 
36 #if !defined(MBEDTLS_SHA512_ALT)
37 // Regular implementation
38 //
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
47 typedef struct
48 {
49  uint64_t total[2];
50  uint64_t state[8];
51  unsigned char buffer[128];
52  int is384;
53 }
55 
62 
69 
77  const mbedtls_sha512_context *src );
78 
85 void mbedtls_sha512_starts( mbedtls_sha512_context *ctx, int is384 );
86 
94 void mbedtls_sha512_update( mbedtls_sha512_context *ctx, const unsigned char *input,
95  size_t ilen );
96 
103 void mbedtls_sha512_finish( mbedtls_sha512_context *ctx, unsigned char output[64] );
104 
105 #ifdef __cplusplus
106 }
107 #endif
108 
109 #else /* MBEDTLS_SHA512_ALT */
110 #include "sha512_alt.h"
111 #endif /* MBEDTLS_SHA512_ALT */
112 
113 #ifdef __cplusplus
114 extern "C" {
115 #endif
116 
125 void mbedtls_sha512( const unsigned char *input, size_t ilen,
126  unsigned char output[64], int is384 );
127 
133 int mbedtls_sha512_self_test( int verbose );
134 
135 /* Internal use */
136 void mbedtls_sha512_process( mbedtls_sha512_context *ctx, const unsigned char data[128] );
137 
138 #ifdef __cplusplus
139 }
140 #endif
141 
142 #endif /* mbedtls_sha512.h */
void mbedtls_sha512_update(mbedtls_sha512_context *ctx, const unsigned char *input, size_t ilen)
SHA-512 process buffer.
void mbedtls_sha512_clone(mbedtls_sha512_context *dst, const mbedtls_sha512_context *src)
Clone (the state of) a SHA-512 context.
void mbedtls_sha512_init(mbedtls_sha512_context *ctx)
Initialize SHA-512 context.
Compatibility names (set of defines)
void mbedtls_sha512_starts(mbedtls_sha512_context *ctx, int is384)
SHA-512 context setup.
SHA-512 context structure.
Definition: sha512.h:47
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_finish(mbedtls_sha512_context *ctx, unsigned char output[64])
SHA-512 final digest.
void mbedtls_sha512_free(mbedtls_sha512_context *ctx)
Clear SHA-512 context.
void mbedtls_sha512_process(mbedtls_sha512_context *ctx, const unsigned char data[128])