[core] Use void instead of MD5 context struct
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#if 0 // maybe simply using void* is easier? this is not C++ so it will link anyway
|
||||
// available built-in implementations
|
||||
#if LT_ARD_MD5_POLARSSL
|
||||
#include "MD5PolarSSLImpl.h"
|
||||
@@ -14,6 +15,7 @@
|
||||
#if LT_ARD_MD5_HOSTAPD
|
||||
#include "MD5HostapdImpl.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// common API
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -2,20 +2,20 @@
|
||||
|
||||
#if LT_ARD_MD5_MBEDTLS
|
||||
|
||||
#include "MD5.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
void MD5Init(LT_MD5_CTX_T *context) {
|
||||
#include <mbedtls/md5.h>
|
||||
|
||||
void MD5Init(mbedtls_md5_context *context) {
|
||||
mbedtls_md5_init(context);
|
||||
mbedtls_md5_starts(context);
|
||||
}
|
||||
|
||||
void MD5Update(LT_MD5_CTX_T *context, const unsigned char *buf, unsigned len) {
|
||||
void MD5Update(mbedtls_md5_context *context, const unsigned char *buf, unsigned len) {
|
||||
mbedtls_md5_update(context, buf, len);
|
||||
}
|
||||
|
||||
void MD5Final(unsigned char digest[16], LT_MD5_CTX_T *context) {
|
||||
void MD5Final(unsigned char digest[16], mbedtls_md5_context *context) {
|
||||
mbedtls_md5_finish(context, digest);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,20 +2,20 @@
|
||||
|
||||
#if LT_ARD_MD5_POLARSSL
|
||||
|
||||
#include "MD5.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
void MD5Init(LT_MD5_CTX_T *context) {
|
||||
#include <polarssl/md5.h>
|
||||
|
||||
void MD5Init(md5_context *context) {
|
||||
md5_init(context);
|
||||
md5_starts(context);
|
||||
}
|
||||
|
||||
void MD5Update(LT_MD5_CTX_T *context, const unsigned char *buf, unsigned len) {
|
||||
void MD5Update(md5_context *context, const unsigned char *buf, unsigned len) {
|
||||
md5_update(context, buf, len);
|
||||
}
|
||||
|
||||
void MD5Final(unsigned char digest[16], LT_MD5_CTX_T *context) {
|
||||
void MD5Final(unsigned char digest[16], md5_context *context) {
|
||||
md5_finish(context, digest);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user