[botan-devel] error: ‘create’ is not a member of

Jeffrey Walton noloader at gmail.com
Wed Oct 9 09:57:32 EDT 2019


Hi Everyone,

I'm piecing together some sample code. I'm working from
https://botan.randombit.net/handbook/api_ref/cipher_modes.html.

test3.cxx: In function ‘int main(int, char**)’:
test3.cxx:21:45: error: ‘create’ is not a member of ‘Botan::XTS_Mode’
  std::unique_ptr<XTS_Mode> enc =  XTS_Mode::create("AES", ENCRYPTION);
                                             ^~~~~~

I'm encountering the error with Cipher_Mode::create and XTS_Mode::create.

Can someone point out what I am doing wrong.

Jeff

$ cat test3.cxx
#include <botan-2/botan/aes.h>
#include <botan-2/botan/xts.h>

#include <iostream>
#include <cstdint>
#include <cassert>
#include <cstring>
#include <sstream>
#include <iomanip>
#include <string>
#include <memory>

#if 0
    std::unique_ptr<Cipher_Mode> enc =
Cipher_Mode::create("AES-128/XTS", ENCRYPTION);
    enc->set_key(key);
#endif

int main (int argc, char* argv[])
{
    using namespace Botan;
    std::unique_ptr<XTS_Mode> enc =  XTS_Mode::create("AES", ENCRYPTION);

    return 0;
}


More information about the botan-devel mailing list