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.

-- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cryptopp-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/cryptopp-users/a1d218dd-f541-46ad-adb0-984c593b3d55n%40googlegroups.com.

Reply via email to