Topic: Decrypt with AES 256
I'm sure I'm overlooking something fundamental in the docs. I'm prototyping a method to decrypt a short password that was encrypted using AES 256. I suspect this is defaulting to AES 128 but I can't find how to change it. Can someone please point me in the right direction?
std::string WolfDec(std::string sPw)
{
Aes enc;
Aes dec;
const byte key[] = "Some32ByteKeyForTestingTheDecode";
const byte iv[] = "A16BitIVisNeeded";
byte plain[1024];
byte cipher[1024];
memset(plain, 0, 1024);
memset(cipher, 0, 1024);
// Decrypt cipher to plain
memmove(cipher, sPw.data(), sPw.length());
wc_AesSetKey(&dec, key, sizeof(key), iv, AES_DECRYPTION);
wc_AesCbcDecrypt(&dec, plain, cipher, sizeof(cipher));
std::string sRet;
sRet.append((const char*)plain);
return sRet;
}