mbed TLS v2.0.0
sha256.h
Go to the documentation of this file.
1 
24 #ifndef MBEDTLS_SHA256_H
25 #define MBEDTLS_SHA256_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_SHA256_ALT)
37 // Regular implementation
38 //
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
47 typedef struct
48 {
49  uint32_t total[2];
50  uint32_t state[8];
51  unsigned char buffer[64];
52  int is224;
53 }
55 
62 
69 
77  const mbedtls_sha256_context *src );
78 
85 void mbedtls_sha256_starts( mbedtls_sha256_context *ctx, int is224 );
86 
94 void mbedtls_sha256_update( mbedtls_sha256_context *ctx, const unsigned char *input,
95  size_t ilen );
96 
103 void mbedtls_sha256_finish( mbedtls_sha256_context *ctx, unsigned char output[32] );
104 
105 /* Internal use */
106 void mbedtls_sha256_process( mbedtls_sha256_context *ctx, const unsigned char data[64] );
107 
108 #ifdef __cplusplus
109 }
110 #endif
111 
112 #else /* MBEDTLS_SHA256_ALT */
113 #include "sha256_alt.h"
114 #endif /* MBEDTLS_SHA256_ALT */
115 
116 #ifdef __cplusplus
117 extern "C" {
118 #endif
119 
128 void mbedtls_sha256( const unsigned char *input, size_t ilen,
129  unsigned char output[32], int is224 );
130 
136 int mbedtls_sha256_self_test( int verbose );
137 
138 #ifdef __cplusplus
139 }
140 #endif
141 
142 #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.
Compatibility names (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:47
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.