fix linux

This commit is contained in:
Kevin Hester 2021-02-23 16:56:28 +08:00
parent 4b07f9e160
commit ada05a1374

View File

@ -27,13 +27,13 @@ class CrossPlatformCryptoEngine : public CryptoEngine
virtual void setKey(const CryptoKey &k) virtual void setKey(const CryptoKey &k)
{ {
CryptoEngine::setKey(k); CryptoEngine::setKey(k);
DEBUG_MSG("Installing AES%d key!\n", numBytes * 8); DEBUG_MSG("Installing AES%d key!\n", key.length * 8);
if (ctr) { if (ctr) {
delete ctr; delete ctr;
ctr = NULL; ctr = NULL;
} }
if (numBytes != 0) { if (key.length != 0) {
if (numBytes == 16) if (key.length == 16)
ctr = new CTR<AES128>(); ctr = new CTR<AES128>();
else else
ctr = new CTR<AES256>(); ctr = new CTR<AES256>();