123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156 |
- #ifndef MBEDTLS_SHA256_H
- #define MBEDTLS_SHA256_H
- #include <stddef.h>
- #include <stdint.h>
- #define MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED -0x0037
- #define MBEDTLS_ERR_SHA256_BAD_INPUT_DATA -0x0074
- #define mbedtls_printf(...) printf(__VA_ARGS__)
- #ifdef __cplusplus
- extern "C" {
- #endif
- typedef struct mbedtls_sha256_context
- {
- uint32_t total[2];
- uint32_t state[8];
- unsigned char buffer[64];
- int is224;
- }
- mbedtls_sha256_context;
- void mbedtls_sha256_init( mbedtls_sha256_context *ctx );
- void mbedtls_sha256_free( mbedtls_sha256_context *ctx );
- void mbedtls_sha256_clone( mbedtls_sha256_context *dst,
- const mbedtls_sha256_context *src );
- int mbedtls_sha256_starts_ret( mbedtls_sha256_context *ctx, int is224 );
- int mbedtls_sha256_update_ret( mbedtls_sha256_context *ctx,
- const unsigned char *input,
- size_t ilen );
- int mbedtls_sha256_finish_ret( mbedtls_sha256_context *ctx,
- unsigned char output[32] );
- int mbedtls_internal_sha256_process( mbedtls_sha256_context *ctx,
- const unsigned char data[64] );
- #ifdef __cplusplus
- }
- #endif
- #endif
|