mbed TLS v2.2.0
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 }
54 
61 
68 
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 */
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:46
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])