I am trying to find out the error for two days but still haven't got this unknown reason figure out.
I have configured and compiled Botan library. Everything goes ok but when try to write this sample code to be run..
S2K* s2k = get_s2k("PBKDF2(SHA-256)");
s2k->set_iterations(4049);
SecureVector<byte> key_and_IV = s2k->derive_key(48, passphrase).bits_of();
SymmetricKey key(key_and_IV, 32);
it says error: 'class Botan::PBKDF' has no member named 'set_iterations'
How can I solve this problem ?
The Botan docs for v1.11.1 report that the function
get_s2k()
has been deprecated, recommending that you useget_pbkdf()
instead.According to the docs,
get_sdk(algospec)
just returns the result of a call toget_pbkdf(algo_spec)
which will give you a pointer to an instance of theclass
Botan::PBKDF
.First things first then, your code needs to be something more like:
Unfortunately without knowing what you want to do with
s2k
I can't help any further, as the docs have no reference to a public member function ofPBKDF
calledset_iterations()
. You're getting the error you mention becauseBotan::PBKDF
really does have no member namedset_iterations
. You need to read the docs, work out what the purpose ofset_iterations()
was in your now deprecated example and hence how to achieve that purpose in the newer version of the library.