mbed TLS v2.3.0
sha1.h
Go to the documentation of this file.
1 
25 #ifndef MBEDTLS_SHA1_H
26 #define MBEDTLS_SHA1_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_SHA1_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[5];
52  unsigned char buffer[64];
53 }
55 
62 
69 
77  const mbedtls_sha1_context *src );
78 
85 
93 void mbedtls_sha1_update( mbedtls_sha1_context *ctx, const unsigned char *input, size_t ilen );
94 
101 void mbedtls_sha1_finish( mbedtls_sha1_context *ctx, unsigned char output[20] );
102 
103 /* Internal use */
104 void mbedtls_sha1_process( mbedtls_sha1_context *ctx, const unsigned char data[64] );
105 
106 #ifdef __cplusplus
107 }
108 #endif
109 
110 #else /* MBEDTLS_SHA1_ALT */
111 #include "sha1_alt.h"
112 #endif /* MBEDTLS_SHA1_ALT */
113 
114 #ifdef __cplusplus
115 extern "C" {
116 #endif
117 
125 void mbedtls_sha1( const unsigned char *input, size_t ilen, unsigned char output[20] );
126 
132 int mbedtls_sha1_self_test( int verbose );
133 
134 #ifdef __cplusplus
135 }
136 #endif
137 
138 #endif /* mbedtls_sha1.h */
void mbedtls_sha1_clone(mbedtls_sha1_context *dst, const mbedtls_sha1_context *src)
Clone (the state of) a SHA-1 context.
int mbedtls_sha1_self_test(int verbose)
Checkup routine.
void mbedtls_sha1_update(mbedtls_sha1_context *ctx, const unsigned char *input, size_t ilen)
SHA-1 process buffer.
void mbedtls_sha1_init(mbedtls_sha1_context *ctx)
Initialize SHA-1 context.
void mbedtls_sha1_process(mbedtls_sha1_context *ctx, const unsigned char data[64])
void mbedtls_sha1_starts(mbedtls_sha1_context *ctx)
SHA-1 context setup.
Configuration options (set of defines)
void mbedtls_sha1_finish(mbedtls_sha1_context *ctx, unsigned char output[20])
SHA-1 final digest.
void mbedtls_sha1_free(mbedtls_sha1_context *ctx)
Clear SHA-1 context.
SHA-1 context structure.
Definition: sha1.h:48
void mbedtls_sha1(const unsigned char *input, size_t ilen, unsigned char output[20])
Output = SHA-1( input buffer )