2

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 ?

alexisdm
  • 29,448
  • 6
  • 64
  • 99
muktoshuvro
  • 440
  • 1
  • 7
  • 26
  • I don't use the Botan library, but looking at [the documentation](http://botan.randombit.net/doxygen/namespaceBotan.html#a5612cc6316fbfb5d5a5b100c9cf7064e), it looks like `get_s2k()` has been deprecated in favour of `get_pbkdf()`. What version of the library are you using? – sam-w Aug 10 '12 at 11:01
  • i am using current stable version 1.10....should I use old version than ?? – muktoshuvro Aug 10 '12 at 18:01

2 Answers2

1

The Botan docs for v1.11.1 report that the function get_s2k() has been deprecated, recommending that you use get_pbkdf() instead.

According to the docs, get_sdk(algospec) just returns the result of a call to get_pbkdf(algo_spec) which will give you a pointer to an instance of the class Botan::PBKDF.

First things first then, your code needs to be something more like:

PBKDF *s2k = getpbkdf("PBKDF2(SHA-256)");

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 of PBKDF called set_iterations(). You're getting the error you mention because Botan::PBKDF really does have no member named set_iterations. You need to read the docs, work out what the purpose of set_iterations() was in your now deprecated example and hence how to achieve that purpose in the newer version of the library.

sam-w
  • 7,478
  • 1
  • 47
  • 77
  • Can you link us to where you found your sample code? That might help shed some light :) – sam-w Aug 10 '12 at 21:38
-1

Possibly you missed your library header... as your error message says: 'has no member named...'

nat
  • 69
  • 5