14 #include <botan/botan.h>
15 #include <botan/init.h>
16 #include <botan/auto_rng.h>
19 namespace cryptolink {
24 Botan::LibraryInitializer botan_init_;
27 CryptoLink::~CryptoLink() {
36 rng.reset(
new Botan::AutoSeeded_RNG());
43 std::vector<uint8_t> random(
size_t len) {
44 std::vector<uint8_t> data;
48 rng->randomize(&data[0], len);
49 }
catch (
const Botan::Exception& ex) {
51 "Botan error: " << ex.
what());
57 boost::shared_ptr<Botan::RandomNumberGenerator> rng;
66 }
catch (
const Botan::Exception& ex) {
73 }
catch (
const Botan::Exception& ex) {
81 return (Botan::version_string());