mbed TLS v2.3.0
sha512.h
Go to the documentation of this file.
1 
25 #ifndef MBEDTLS_SHA512_H
26 #define MBEDTLS_SHA512_H
27 
28 #if !defined(MBEDTLS_CONFIG_FILE)
29 #include "config.h"
30 #else
31 #include MBEDTLS_CONFIG_FILE
32 #endif
33 
34 #include <stddef.h>
35 #include <stdint.h>
36 
37 #if !defined(MBEDTLS_SHA512_ALT)
38 // Regular implementation
39 //
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
48 typedef struct
49 {
50  uint64_t total[2];
51  uint64_t state[8];
52  unsigned char buffer[128];
53  int is384;
54 }
56 
63 
70 
78  const mbedtls_sha512_context *src );
79 
86 void mbedtls_sha512_starts( mbedtls_sha512_context *ctx, int is384 );
87 
95 void mbedtls_sha512_update( mbedtls_sha512_context *ctx, const unsigned char *input,
96  size_t ilen );
97 
104 void mbedtls_sha512_finish( mbedtls_sha512_context *ctx, unsigned char output[64] );
105 
106 #ifdef __cplusplus
107 }
108 #endif
109 
110 #else /* MBEDTLS_SHA512_ALT */
111 #include "sha512_alt.h"
112 #endif /* MBEDTLS_SHA512_ALT */
113 
114 #ifdef __cplusplus
115 extern "C" {
116 #endif
117 
126 void mbedtls_sha512( const unsigned char *input, size_t ilen,
127  unsigned char output[64], int is384 );
128 
134 int mbedtls_sha512_self_test( int verbose );
135 
136 /* Internal use */
137 void mbedtls_sha512_process( mbedtls_sha512_context *ctx, const unsigned char data[128] );
138 
139 #ifdef __cplusplus
140 }
141 #endif
142 
143 #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.
Configuration options (set of defines)
void mbedtls_sha512_starts(mbedtls_sha512_context *ctx, int is384)
SHA-512 context setup.
SHA-512 context structure.
Definition: sha512.h:48
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])