#ifndef _MBEDTLS_UTIL_H_
#define _MBEDTLS_UTIL_H_
#include "stm32f10x.h"

void utils_hmac_sha1_str(const char *msg, int msg_len, char *digest, const char *key, int key_len);

void utils_sha256(const char *msg, int msg_len, char *digest);

void utils_sha256_str(const char *msg, int msg_len, char *digest);

int utils_aes128_cbc_enc(char *aes_key, char *iv, char *plaintext, char *ciphertext);

int utils_aes128_cbc_dec(char *aes_key, char *iv, char *ciphertext, int len, char *plaintext);

int utils_aes128_cbc_base64_enc(char *aes_key, char *iv, uint8_t *src,int dataLen, char *ciphertext);

int utils_aes128_cbc_base64_dec(char *aes_key, char *iv, char *ciphertext, int dataLen, char *buffer,int buflen);

#endif
