Hi all,
Is this a valid method of using AES CTR mode? I am unsure how to
properly pass in the initial counter value and am having trouble
working it out from the doxygen documentation.
I am passing in the counter as a 16-byte array, and the counterLength
is meant to indicate how many of the LSB bytes of the counter may be
incremented and will roll over back to zero.
Is this right?
bool AES::CreateNewCTR(const unsigned char* key, unsigned int
keyLength,
bool encrypt, const unsigned char* counter, unsigned int
counterLength)
{
/// Shortened to remove validation checking. m_aes will be NULL at
this point
if (encrypt)
{
m_aes = new CryptoPP::CTR_Mode<CryptoPP::AES>::
Encryption(key, keyLength, counter, counterLength);
} else {//decrypt
m_aes = new CryptoPP::CTR_Mode<CryptoPP::AES>::
Decryption(key, keyLength, counter, counterLength);
}
return true;
}
I am then using ProcessData to input my data and get a result.
Regards,
Matthew
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the "Crypto++ Users"
Google Group.
To unsubscribe, send an email to [EMAIL PROTECTED]
More information about Crypto++ and this group is available at
http://www.cryptopp.com.
-~----------~----~----~----~------~----~------~--~---