AuroraRuntime/Include/Aurora/Crypto/AES/AES.hpp

35 lines
1.4 KiB
C++
Raw Normal View History

2021-06-27 21:25:29 +00:00
/***
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: AES.hpp
Date: 2021-6-11
Author: Reece
***/
#pragma once
namespace Aurora::Crypto::AES
{
AUKN_SYM AuUInt GetSafeCipherPadding(const void* plainText,
AuUInt plainTextLength);
// Remember: AES works in chunks of 128 bits
// IVS are 16 bytes long
// Chunks are 16 bytes long
// Keys are 16, 24, or 32 bytes long
// Initialization vectors must never be constant
// Initialization vectors should be determined by a handshaake
// It is not the end of the world if an IV is made public by design
// Keys must be random
// Initialization vectors could be derived from SHA1, Tiger, or SHA2 digests
AUKN_SYM bool Encrypt(const void* plainText, AuUInt plainTextLength,
const void* iv, void* outIv, AuUInt ivLength,
const void* key, AuUInt keyLength,
AuList<AuUInt8>& out,
2021-09-06 10:58:08 +00:00
bool auCoolCodePadding);
2021-06-27 21:25:29 +00:00
AUKN_SYM bool Decrypt(const void* cipherText, AuUInt cipherTextLength,
const void* iv, void* outIv, AuUInt ivLength,
const void* key, AuUInt keyLength,
AuList<AuUInt8>& plainText,
2021-09-06 10:58:08 +00:00
bool auCoolCodePadding);
2021-06-27 21:25:29 +00:00
}