Confusing Crypto++ errors with which I can make no progress.

48 views
Skip to first unread message

Bill Ford

unread,
Jun 24, 2022, 9:18:10 PM6/24/22
to Crypto++ Users
I am developing a Linux, MacOS, and Windows application that involves AES encryption
using cryptopp and have been stuck on a statement that generates confusing errors I do
not understand:

byte key[AES::DEFAULT_KEYLENGTH];
byte iv[AES::BLOCKSIZE];
CFB_Mode<AES>::Encryption e;

e.SetKeyWithIV (key, sizeof (key), iv);
// StreamTransformationFilter
StringSource (dataToEncrypt, true,
        new StreamTransformationFilter (e, new StringSink (cipher)));
); // StringSource

Lines 9-13 generate
 
no matching function for call to 'CryptoPP::CipherModeFinalTemplate_CipherHolder<CryptoPP::BlockCipherFinal<CryptoPP::ENCRYPTION, CryptoPP::Rijndael::Enc>, CryptoPP::ConcretePolicyHolder<CryptoPP::Empty,       CryptoPP::CFB_EncryptionTemplate<CryptoPP::AbstractPolicyHolder<CryptoPP::CFB_CipherAbstractPolicy, CryptoPP::CFB_ModePolicy> > > >::SetKeyWithIV(std::byte [16], long unsigned int, std::byte [16])'

and anothers errors include

expected primary-expression before ')' token
d.SetKeyWithIV (key, sizeof (key), (byte *)iv,);
      |                                       ^

error: cannot convert 'std::byte [16]' to 'CryptoPP::byte*' {aka 'unsigned char*'}
  479 |         prng.GenerateBlock (key, sizeof (key) );
      |                             ^~~
      |                             |
      |                             std::byte [16]

I would appreciate it if someone can help with this.

Jeffrey Walton

unread,
Jun 26, 2022, 2:02:49 PM6/26/22
to Crypto++ Users List
Please add a small program that demonstrates the problem. Please state
which platform you are using. Please show the command line you are
using.

Jeff
Reply all
Reply to author
Forward
0 new messages