mbed TLS v2.6.0
sha256.h
Go to the documentation of this file.
1 
25 #ifndef MBEDTLS_SHA256_H
26 #define MBEDTLS_SHA256_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_SHA256_ALT)
38 // Regular implementation
39 //
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
48 typedef struct
49 {
50  uint32_t total[2];
51  uint32_t state[8];
52  unsigned char buffer[64];
53  int is224;
54 }
56 
63 
70 
78  const mbedtls_sha256_context *src );
79 
86 void mbedtls_sha256_starts( mbedtls_sha256_context *ctx, int is224 );
87 
95 void mbedtls_sha256_update( mbedtls_sha256_context *ctx, const unsigned char *input,
96  size_t ilen );
97 
104 void mbedtls_sha256_finish( mbedtls_sha256_context *ctx, unsigned char output[32] );
105 
106 /* Internal use */
107 void mbedtls_sha256_process( mbedtls_sha256_context *ctx, const unsigned char data[64] );
108 
109 #ifdef __cplusplus
110 }
111 #endif
112 
113 #else /* MBEDTLS_SHA256_ALT */
114 #include "sha256_alt.h"
115 #endif /* MBEDTLS_SHA256_ALT */
116 
117 #ifdef __cplusplus
118 extern "C" {
119 #endif
120 
129 void mbedtls_sha256( const unsigned char *input, size_t ilen,
130  unsigned char output[32], int is224 );
131 
137 int mbedtls_sha256_self_test( int verbose );
138 
139 #ifdef __cplusplus
140 }
141 #endif
142 
143 #endif /* mbedtls_sha256.h */
void mbedtls_sha256_init(mbedtls_sha256_context *ctx)
Initialize SHA-256 context.
void mbedtls_sha256_process(mbedtls_sha256_context *ctx, const unsigned char data[64])
void mbedtls_sha256_free(mbedtls_sha256_context *ctx)
Clear SHA-256 context.
Configuration options (set of defines)
void mbedtls_sha256_finish(mbedtls_sha256_context *ctx, unsigned char output[32])
SHA-256 final digest.
void mbedtls_sha256_update(mbedtls_sha256_context *ctx, const unsigned char *input, size_t ilen)
SHA-256 process buffer.
void mbedtls_sha256(const unsigned char *input, size_t ilen, unsigned char output[32], int is224)
Output = SHA-256( input buffer )
SHA-256 context structure.
Definition: sha256.h:48
void mbedtls_sha256_starts(mbedtls_sha256_context *ctx, int is224)
SHA-256 context setup.
void mbedtls_sha256_clone(mbedtls_sha256_context *dst, const mbedtls_sha256_context *src)
Clone (the state of) a SHA-256 context.
int mbedtls_sha256_self_test(int verbose)
Checkup routine.