#include "crypto_core.h"
#include "core/os/os.h"
#include <mbedtls/aes.h>
#include <mbedtls/base64.h>
#include <mbedtls/ctr_drbg.h>
#include <mbedtls/entropy.h>
#include <mbedtls/md5.h>
#include <mbedtls/sha1.h>
#include <mbedtls/sha256.h>
#if MBEDTLS_VERSION_MAJOR >= 3
#include <mbedtls/compat-2.x.h>
#endif
CryptoCore::RandomGenerator::RandomGenerator() { … }
CryptoCore::RandomGenerator::~RandomGenerator() { … }
int CryptoCore::RandomGenerator::_entropy_poll(void *p_data, unsigned char *r_buffer, size_t p_len, size_t *r_len) { … }
Error CryptoCore::RandomGenerator::init() { … }
Error CryptoCore::RandomGenerator::get_random_bytes(uint8_t *r_buffer, size_t p_bytes) { … }
CryptoCore::MD5Context::MD5Context() { … }
CryptoCore::MD5Context::~MD5Context() { … }
Error CryptoCore::MD5Context::start() { … }
Error CryptoCore::MD5Context::update(const uint8_t *p_src, size_t p_len) { … }
Error CryptoCore::MD5Context::finish(unsigned char r_hash[16]) { … }
CryptoCore::SHA1Context::SHA1Context() { … }
CryptoCore::SHA1Context::~SHA1Context() { … }
Error CryptoCore::SHA1Context::start() { … }
Error CryptoCore::SHA1Context::update(const uint8_t *p_src, size_t p_len) { … }
Error CryptoCore::SHA1Context::finish(unsigned char r_hash[20]) { … }
CryptoCore::SHA256Context::SHA256Context() { … }
CryptoCore::SHA256Context::~SHA256Context() { … }
Error CryptoCore::SHA256Context::start() { … }
Error CryptoCore::SHA256Context::update(const uint8_t *p_src, size_t p_len) { … }
Error CryptoCore::SHA256Context::finish(unsigned char r_hash[32]) { … }
CryptoCore::AESContext::AESContext() { … }
CryptoCore::AESContext::~AESContext() { … }
Error CryptoCore::AESContext::set_encode_key(const uint8_t *p_key, size_t p_bits) { … }
Error CryptoCore::AESContext::set_decode_key(const uint8_t *p_key, size_t p_bits) { … }
Error CryptoCore::AESContext::encrypt_ecb(const uint8_t p_src[16], uint8_t r_dst[16]) { … }
Error CryptoCore::AESContext::encrypt_cbc(size_t p_length, uint8_t r_iv[16], const uint8_t *p_src, uint8_t *r_dst) { … }
Error CryptoCore::AESContext::encrypt_cfb(size_t p_length, uint8_t p_iv[16], const uint8_t *p_src, uint8_t *r_dst) { … }
Error CryptoCore::AESContext::decrypt_ecb(const uint8_t p_src[16], uint8_t r_dst[16]) { … }
Error CryptoCore::AESContext::decrypt_cbc(size_t p_length, uint8_t r_iv[16], const uint8_t *p_src, uint8_t *r_dst) { … }
Error CryptoCore::AESContext::decrypt_cfb(size_t p_length, uint8_t p_iv[16], const uint8_t *p_src, uint8_t *r_dst) { … }
String CryptoCore::b64_encode_str(const uint8_t *p_src, int p_src_len) { … }
Error CryptoCore::b64_encode(uint8_t *r_dst, int p_dst_len, size_t *r_len, const uint8_t *p_src, int p_src_len) { … }
Error CryptoCore::b64_decode(uint8_t *r_dst, int p_dst_len, size_t *r_len, const uint8_t *p_src, int p_src_len) { … }
Error CryptoCore::md5(const uint8_t *p_src, int p_src_len, unsigned char r_hash[16]) { … }
Error CryptoCore::sha1(const uint8_t *p_src, int p_src_len, unsigned char r_hash[20]) { … }
Error CryptoCore::sha256(const uint8_t *p_src, int p_src_len, unsigned char r_hash[32]) { … }